Contentstack CLI offers support for export, import, and clone operations, including Marketplace apps, module-wise imports, error handling, and Personalize project integration.
This guide outlines these features to help you manage content migration operations with flexibility and control.
You can export/import public and private Marketplace apps into a stack using CLI commands.
If a public Marketplace app with a specific configuration already exists in the destination organization, you will be prompted with the following options during import:
Warning: Skipping may result in issues with imported content.
If the imported app has the same name as an existing app in the destination stack:
Note: App names must be 3-20 characters long.
During the stack import:
csdx cm:stack:import -k <<stack_ApiKey>> -d <<path_of_folder_where_content_is_stored>> --skip-app-recreation --yesIf an error occurs while importing a public or private app:
Note: You cannot reuse any existing private apps during the import process.
When working with stacks that are synced with a Personalize project, certain modules and configurations are automatically handled during export and import operations:
If the stack you're exporting is linked to a Personalize project, the following items will be exported:
If the content you're importing is associated or synced with a Personalize project, a new Personalize project will be created and linked to the new stack. Additionally, the items below will be imported into the target stack:
Options
Note: Variants and Personalize currently support only basic authentication.
The -a <alias> flag skips Personalize modules as they require an auth token for import and cannot be imported using a management token.
Studio is Contentstack’s visual composition builder for creating digital experiences using predefined configurations, including components, layout structures, and page data.
When a stack is connected to Studio, its project configuration becomes part of the Studio setup, and it must be included during migration to ensure the target stack can accurately reproduce the source project’s structure and page layouts.
When exporting a stack that is connected to Studio, the CLI automatically includes the following:
These items get exported along with the standard stack modules.
When importing content into a stack, the CLI handles Studio-related modules based on the destination stack’s setup. The behaviour varies across the following scenarios:
Tip: Enable Studio in the destination stack before running the import to migrate Studio projects and compositions.
Note: Studio migration currently supports only basic authentication (username and password).