Was this article helpful?
Thanks for your feedback
Contentstack allows you to create a copy of a stack (along with the data) or export all data of a stack into a new or existing empty stack by using the ‘stack-clone’ CLI command.
Note: Before executing this command, ensure you have the required permissions for creating or accessing the destination stack. Refer to the Stack Roles documentation to check permissions.
You can clone a stack by performing the following two steps:
Note: By default, the CLI uses the North American region. To set the European or Azure North America region, refer to the Set Region command for more details.
You will need an authtoken to perform the clone operations. To generate the authtoken, open your terminal (command prompt), and run the following command to log in to your Contentstack account:
csdx auth:login
It will ask you to provide the email address and password of your Contentstack account. After logging in successfully, an authtoken will be generated and saved to the CLI session until you log out from this session.
Additional Resource: To learn more about the login command, refer to the Login command section.
Now that you are logged into Contentstack, let’s proceed to export content from the source stack and import it into the destination stack instantly by running the following command in your terminal:
csdx cm:stack-clone
This will prompt you to provide the following details:
Tip: To ensure the above operations are error-free, we recommend that you select the option of creating a new destination stack. This is because the new stack will be empty and you can easily import content to it. If you choose to import content to an existing stack, you first need to ensure that the stack is empty and then proceed with the import operation.
Finally, the content of the source stack will be imported into the destination stack, thus completing the cloning process.
While importing workflows from one stack to another, admins and workflow stage users are not included. Therefore, admins and stage users of your workflows will not be migrated to the new stack.
Was this article helpful?
Thanks for your feedback