Documentation
Import and export blog content
Use these commands to move Off the Shelf articles between the database and the version-controlled JSON files in content/off-the-shelf/.
Import articles
Section titled “Import articles”Validate an import without changing the database first:
php artisan blog:import --dry-runImport articles that do not already exist:
php artisan blog:importOverwrite database articles with matching slugs:
php artisan blog:import --forceUse a different content directory:
php artisan blog:import --path=/absolute/path/to/content --dry-runThe command reports how many articles it created, updated, and skipped. Without --force, an existing article with the same slug is skipped.
Export articles
Section titled “Export articles”Export the database’s current articles to the default version-controlled directory:
php artisan blog:exportOr export to another directory:
php artisan blog:export --path=/absolute/path/to/contentReview the resulting JSON changes with Git before committing them.
Relevant source
Section titled “Relevant source”app/Console/Commands/ImportBlogContent.phpapp/Console/Commands/ExportBlogContent.phpapp/Support/BlogContentRepository.phpcontent/off-the-shelf/