--- title: "[Contentstack Command-line Interface (CLI)] - Cloning a Stack" description: Contentstack enables you to clone a stack and its associated structure and content using the cm:stacks:clone CLI command. url: https://www.contentstack.com/docs/developers/cli/cloning-a-stack product: Contentstack doc_type: cli-guide audience: - developers version: latest last_updated: 2026-03-25 --- # [Contentstack Command-line Interface (CLI)] - Cloning a Stack This page explains how to clone a Contentstack stack (structure and optionally content) using the Contentstack Command-line Interface (CLI). It is intended for developers and administrators who need to quickly set up, test, or migrate stack data between source and destination stacks using the `cm:stacks:clone` command. ## Cloning a Stack Contentstack enables you to **clone a stack** and its associated **structure and content** using the `cm:stacks:clone` CLI command. This process lets you [export](/docs/developers/cli/export-content-using-the-cli/) data from a source stack and [import](/docs/developers/cli/import-content-using-the-cli/) it into a new or existing stack, facilitating rapid setup, testing, or migration. This guide uses the latest **Contentstack CLI** commands to ensure a seamless cloning experience. **Note:** Before executing this command, ensure you have the required permissions for creating or accessing the destination stack. To know more about user roles and their permissions, refer to [this](/docs/developers/invite-users-and-assign-roles/types-of-roles#stack-roles-and-permissions-overview) documentation. ## Prerequisites - [Contentstack account](https://www.contentstack.com/login/) - Contentstack CLI [installed](/docs/developers/cli/install-the-cli) and [configured](/docs/developers/cli/configure-regions-in-the-cli/) - [Configured authtoken](/docs/developers/cli/cli-authentication#authentication) ## Commands The `cm:stacks:clone` command lets you export content from the source stack and import it into the destination stack instantly. **Note: **By default, an [audit fix](/docs/developers/cli/audit-plugin#issue-resolution-in-references) is performed on the exported content before import. This helps identify and address potential issues in the exported data. ## Options Use the following options while performing the clone operation: - `-n, --stack-name=stack-name`: Name for the new stack where cloned content will be stored. - `--destination-management-token-alias=destination-management-token-alias`: Alias for the destination stack's management token. - `--destination-stack-api-key=destination-stack-api-key`: API key of the destination stack. - `--source-stack-api-key=source-stack-api-key`: API key of the source stack. - `--source-branch=source-branch`: Name of the branch in the source stack. - `--source-branch-alias=source-branch-alias`: Alias of the branch in the source stack. - `--source-management-token-alias=source-management-token-alias`: Alias for the source stack's management token. - `--target-branch=target-branch`: Name of the branch in the target stack. - `--target-branch-alias=target-branch-alias`: Alias of the branch in the target stack. - `--import-webhook-status=