Edit on GitHub
Jump to docs navigation

Nut command / Database / database:export

Note: You are currently reading the documentation for Bolt 3.7. Looking for the documentation for Bolt 5.2 instead?

Nut's database:export command exports the database records to a YAML or JSON file.

Usage

    php ./app/nut database:export [options]

Options

Option Description
-f, --file=FILE A YAML or JSON file to use for export data. Must end with .yml, .yaml or .json
-d, --directory=DIRECTORY A destination directory. The command will automatically generate file names.
-c, --contenttype=CONTENTTYPE ContentType name to export records for (can be used multiple times). (multiple values allowed)

Example

Exporting "Pages" ContentType records

$ php ./app/nut database:export --file=my-site-export.json --contenttype=pages

 [WARNING] This command operates on the current database, taking a backup is advised before export.

 Are you sure you want to continue with the export (yes/no) [yes]:
 > y

 ! [NOTE] Exported:

 * pages: 5 records

 [OK] Database exported to my-site-export.json


Edit this page on GitHub
Couldn't find what you were looking for? We are happy to help you in the forum, on Slack or on Github.