Skip to main content

Hi Everyone,

Just joined the community and will start by posting a question to which I guess we all know the answer, i.e “Is there a way we can copy entire Commercetools project content to another Commercetools Project?”

I know the answer is No as of now, but is there any updates or any alternative wayout to attain the same ?  

I haven't used it, but this might be an interesting read commercetools/commercetools-project-sync: Dockerized CLI application which allows to automatically sync different resources between commercetools projects (github.com)


I thought IaC was the answer. use terraform maybe?


Yes, it is possible!

Project Sync as mentioned by @Leighton is a Dockerized CLI open source tool offered by commercetools using which you can sync two commercetools projects. Majority of the CoCo Backend resources are available to copy using project sync and you can add more or modify to fit your needs if a resource that you’re looking to sync is not available.

  • CartDiscounts
  • Categories
  • InventoryEntries
  • Products
  • ProductTypes
  • Types
  • States
  • TaxCategories
  • CustomObjects
  • Customers
  • ShoppingLists

Hi, 

We used IaC with terraform provider ( https://registry.terraform.io/providers/labd/commercetools/latest/docs ) to versionning and deploying the common settings (settings, countries, taxes, shippings method,.. ) between any env/Projects. For business data (products, customers), it handled by the glue with the Information System.

The approach via sync kit is also an good option.

We take also tips for this use case. 

+


I can share information on migrating projects and data within commercetools. 

First Steps

Before migration, you're required to manually set up your organization in the new region - if it does not exist. This involves:

  • Creating a new organization and setting up roles and permissions. (optional)
  • Inviting and assigning roles to team members. (optional)
  • Creating new projects and API credentials, ensuring they include the necessary scopes detailed at Project Sync Scopes.

Once your projects are set up, reach out to commercetools support (Support Ticket) or ask your Customer Success Manager to adjust your project to remove trial trial flags and denote production projects (optional). Be sure to provide all the necessary project details.

Include additional information regarding custom configurations. Referencing former support tickets can be useful here.

The Migration Process

Terraform and Commercetools Configuration

We recommend that you codify your project configuration using a tool likeTerraform. Then, deploy these configurations to your new projects using the Labd provider, which ensures a more reliable and controlled process. Keep in mind that Project-sync does not handle project settings migration.

https://github.com/labd/terraform-provider-commercetools
https://registry.terraform.io/providers/labd/commercetools/latest/docs/guides/extensions

 

Using Project-sync

Ensure project-sync supports the resources you need to migrate;. Custom scripts may be needed for any unsupported resources.

  • Before using Project-sync, review the prerequisites here.
  • Check your existing project data, following the instructions in the documentation to set required feeds.
  • Verify that the priceMode for all products is set correctly (Product PriceMode Documentation), as incorrect priceMode settings can prevent imports.

Using Java-sync

Just like with Project-sync, ensure that the resources you intend to migrate are supported by the framework.

  • The minimum required JDK version for this library is 8, and it has been tested across major JDK versions.
  • A destination commercetools project should be prepared for your data sync.
  • Review your existing data, update feeds as advised, and again, ensure that the priceMode is correctly configured.

Follow the quick start guide to learn about the framework and begin data movement.

Creating API Credentials

If you haven't established API credentials, set them up in both your source and destination projects with the right scopes. Always prioritize least privilege access control for security (Least Privilege Access Control Information).

Resources

commercetools Terraform Provider

For achieving seamless infrastructure as code (IaC) management within commercetools environments, the Terraform provider for commercetools offers a powerful tool. This provider allows the creation, management, and updating of commercetools resources through Terraform scripts, facilitating a consistent and reproducible setup across development, staging, and production environments.

commercetools-sync-java

For developers and teams eager to jump-start their integration with commercetools, the Quick Start Guide offers invaluable insights and actionable steps. It provides a succinct overview on initializing and executing your first data sync. Detailed instructions, including code snippets and configuration examples, ease the process of integrating the sync library into your project. Begin your sync integration smoothly by visiting Quick Start Guide.

commercetools-project-sync

Another essential tool for developers looking to enhance their commercetools integration is the commercetools-project-sync utility. This tool simplifies the synchronization of data between commercetools projects, making it ideal for migrations, backups, or consistent data replication across environments. With its focus on ease of use and efficiency, commercetools-project-sync allows for the rapid update and synchronization of categories, products, inventory, and more. For a comprehensive understanding of its capabilities and to get started, visit the project's GitHub page: commercetools-project-sync GitHub.

reach out through community if you have additional questions, Mike


Reply