The cm:export-to-csv command lets you export the following data into a CSV file using Contentstack CLI:
You can use this to perform tasks such as creating content backups, analyzing data, and more.
Note: Only the Organization Owner/Admin has the permissions to export an organization’s user or teams’ data.
Contentstack CLI lets you export content from the source stack to a CSV file by running the following command in your terminal:
csdx cm:export-to-csvThis command prompts the following options:
The CSV file gets generated in the following format:
<stack_name>_<content_type>_<language>_entries_exports.csv
You can also export entries to CSV using the Management Token alias.
Note: You must be logged in to the Contentstack app to export organization users.
When prompted, select the organization containing the user data you want to export. The CSV file is generated in the following format:
<orgName>_users_exports.csv
The CSV file is generated in the following format:
<org-name>_teams_export.csv
The CSV file is generated in the following format:
<org-name>_team_<team-uid>_User_Details_export.csv
The CSV file is generated in the following format:
<org-name>_team_User_Details_export.csv
The CSV file is generated in the following format:
stack_role_mapping_<team-uid>.csv
The CSV file is generated in the following format:
stack_role_mapping.csv
The CSV files are generated in the following formats:
<stack-name>_taxonomies.csv
<stack-name>_<taxonomy-name>_<taxonomy-uid>_terms.csv
Once you select any of the above options, a “data” folder is automatically created in your current working directory. The corresponding CSV files are stored within this folder.
Alternatively, you can provide the required parameters after the command in a single line as shown below:
csdx cm:export-to-csv -a <alias_of_management_token> -n <name_of_the_stack> --action <<entries_or_users_or_taxonomies>> --org <organization_UID> --org-name <name_of_the_organization> --locale <name_of_the_locale> --content-type <content_type_name> --delimiter <value>Examples:
csdx cm:export-to-csv --action <entries> --locale <locale> --alias <management-token-alias> --content-type <content-type> csdx cm:export-to-csv --action <entries> --locale <locale> --alias <management-token-alias> --content-type <content-type> --stack-name <stack-name> csdx cm:export-to-csv --action <users> --org <org-uid>csdx cm:export-to-csv --action <users> --org <org-uid> --org-name <org-name> csdx cm:export-to-csv --action <teams> --org <org-uid>csdx cm:export-to-csv --action <teams> --team-uid <team-uid>csdx cm:export-to-csv --action <teams> --org <org-uid> --org-name <org-name> --team-uid <team-uid>csdx cm:export-to-csv --action <taxonomies> --alias <management-token-alias> --taxonomy-uid <taxonomy-uid>csdx cm:export-to-csv --action <taxonomies> --alias <management-token-alias>csdx cm:export-to-csv --action <taxonomies> --alias <management-token-alias> --delimiter <delimiter>csdx cm:export-to-csv --action <entries> --locale <locale> --alias <management-token-alias> --content-type <content-type> --stack-name <stack-name> --branch <branch-name> csdx cm:export-to-csv --action <taxonomies> --alias <management-token-alias> --locale <locale> csdx cm:export-to-csv --action <taxonomies> --alias <management-token-alias> --locale <locale> --include-fallbackcsdx cm:export-to-csv --action <taxonomies> --alias <management-token-alias> --locale <locale> --include-fallback --fallback-locale <fallback-locale>