Data export
The strapi export command is part of the Data Management feature and used to export data from a local Strapi instance. By default, the strapi export command exports data as an encrypted and compressed tar.gz.enc file which includes:
- the project configuration,
- entities: all of your content,
- links: relations between your entities,
- assets: files stored in the uploads folder,
- schemas,
- the
metadata.jsonfile.
The following documentation details the available options to customize your data export. The export command and all of the available options are run using the Strapi CLI.
- Admin users and API tokens are not exported.
Understand the exported archive
The exported .tar archive contains a flat structure of numbered JSON lines files arranged in folders for each exported resource:
export_202401011230.tar
├── metadata.json
├── configuration/
│ └── configuration_00001.jsonl
├── entities/
│ └── entities_00001.jsonl
├── links/
│ └── links_00001.jsonl
└── schemas/
└── schemas_00001.jsonl
Each folder (except for metadata.json) contains one or more .jsonl files named sequentially (e.g., entities_00001.jsonl). Each line in these .jsonl files represents a single record, making the archive convenient for line‑by‑line processing or conversion to formats such as CSV. To inspect these files directly, export without compression or encryption:
- Yarn
- NPM
yarn strapi export --no-encrypt --no-compress -f my-export
npm run strapi export -- --no-encrypt --no-compress -f my-export
The command above creates my-export.tar in the project root. After extracting the archive (tar -xf my-export.tar), open any .jsonl file to view individual records.
Large datasets are automatically split across multiple .jsonl files. The maxSizeJsonl provider option controls the maximum size of each file.
Name the export file
Exported data are contained in a .tar file that is automatically named using the format export_YYYYMMDDHHMMSS. You can optionally name the exported file by passing the --file or -f option with the strapi export command. Do not include a file extension as one will be set automatically depending on options provided.
Example: Export data with a custom filename
- yarn
- npm
yarn strapi export --file my-strapi-export
npm run strapi export -- --file my-strapi-export