Skip to content

abigah/importer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Importer for Statamic Statamic v2

CLI commands to create import content from a database. Import will import a single entry from the ID given. Import all will do its best to go through the table and import everything.

Assumptions

  • The table you are pulling content from should have a primary key called id.
  • You want it imported as a draft. (It needs to have someone look at each piece of content. Imports aren't perfect.)

Usage

  • Install the addon by copying the files into site/addons/importer.
  • Add the following with connection information to your .env
DB_HOST=database_host
DB_DATABASE=database_name
DB_USERNAME=database_username
DB_PASSWORD=database_password
  • Run the please command.

Commands

Running the please commands without any arguments will give you interactive prompts to help you import a piece of content.

php please importer:import [<id>] [<folder>]
php please importer:import_all [<folder>]

Thanks to the Gentlemen for the Overload plugin which got me started.

Warning

This can be destructive and is not meant to be a perfect import. Assume that you will have to touch each piece of content.

You will need to publish the content after.

About

CLI commands to import a single entry or a complete database table to Statamic v2 entries.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages