To migrate content from one stack to another, begin by exporting content from the source stack, then import it into the destination stack.
This guide explains how to use the cm:stacks:export command by logging in to the CLI (or using a management token), using configuration files, or using direct CLI parameters.
The cm:stacks:export command lets you export content from one stack to another.
Usage
csdx cm:stacks:export -k <<stack_ApiKey>> -d <<file_path>>Options
Use the following options with any applicable export command:
Available modules: assets, content-types, entries, environments, stacks, extensions, marketplace-apps, global-fields, labels, locales, webhooks, workflows, custom-roles, taxonomies, personalize, and studio
Note:
Examples
csdx cm:stacks:export -d "C:\Users\Name\Desktop\cli\content" -k bltxxxxxxcsdx cm:stacks:export -d "C:\Users\Name\Desktop\cli\content" -k bltxxxxxx --branch developcsdx cm:stacks:export -d "C:\Users\Name\Desktop\cli\content" -k bltxxxxxx --branch-alias developAliascsdx cm:stacks:export -d "C:\Users\Name\Desktop\cli\content" --module content-types -k bltxxxxxxNote: When exporting modules individually, follow this module sequence:
assets → environments → stacks → locales → extensions → marketplace-apps → webhooks → taxonomies → global-fields → content-types → workflows → entries → labels → custom-roles → personalize → studio
For example, before exporting entries, you must have already exported assets, environments, stacks, locales, extensions, marketplace-apps, webhooks, taxonomies, global-fields, content-types, and workflows.
You can also export content using a configuration file.
To get started, follow the steps below:
Usage
csdx cm:stacks:export -c <<config_file_path>>Example
csdx cm:stacks:export -c "C:\Users\Name\Desktop\cli\config.json"Note:
Configuration File Options
The following are the possible file options in the configuration file:
You can also export content from your stack using a management token.
Usage
csdx cm:stacks:export -a <<alias>>Alternatively, refer to the following command to add several parameters or options in a single line:
csdx cm:stacks:export -a <<alias>> -d <<file_path>>You can also export content by using a management token and a configuration file that contains the parameters or options and the associated values.
By doing so, you don’t need to separately provide parameters or options in the command.
Usage
csdx cm:stacks:export -a <<alias>> -c <<config_file_path>>Example
csdx cm:stacks:export -a mytoken -c "C:\Users\Name\Desktop\cli\config.json"Contentstack CLI lets you toggle between the raw console logs and the visual Progress Manager UI during export or plugin workflows.
Default Usage:
csdx cm:stacks:export -d "./export-data" -k bltxxxxxxNote: By default, the Progress Manager UI displays when you run the export command and does not require any configuration.
Example for Progress Manager View (Default Mode):
STACK:
├─ Settings |████████████████████████████████████████| 100% | 1/1 | ✓ Complete (1/1)
├─ Locale |████████████████████████████████████████| 100% | 1/1 | ✓ Complete (1/1)
LOCALES:
└─ Locales |████████████████████████████████████████| 100% | 2/2 | ✓ Complete (2/2)
CONTENT TYPES:
└─ Content types |████████████████████████████████████████| 100% | 6/6 | ✓ Complete (6/6)
ENTRIES:
├─ Entries |████████████████████████████████████████| 100% | 12/12 | ✓ Complete (12/12)
Steps to Switch to Console Logs (Optional):
csdx config:set:log --show-console-logscsdx cm:stacks:export -d "./export-data" -k bltxxxxxxThe screen displays the console logs for the export operation.
Tip: Use --show-console-logs for detailed debugging when troubleshooting export issues.
csdx config:set:log --no-show-console-logsOptions:
Example for Console Log Mode:
[2025-08-22 16:12:23] INFO: Exporting content from branch main
[2025-08-22 16:12:23] INFO: Started to export content, version is 2
[2025-08-22 16:12:23] INFO: Exporting module: stack
[2025-08-22 16:12:24] INFO: Exporting stack settings
[2025-08-22 16:12:25] SUCCESS: Exported stack settings successfully!
For example, use delayMs: 1000 (for a 1-second delay).
Additional Resource: Learn more about the CLI-supported export operations in the CLI-Supported Features for Export, Import, and Clone Operations document.