• Cheat sheets
  • Documentation
  • API reference
  • Product updates
  • Sign in
Kontent.ai Learn
  • Try Kontent.ai
  • Plan
  • Set up
  • Model
  • Develop
  • Create
Copyright © 2025 Kontent.ai. All rights reserved.
  • Web
  • Privacy policy
  • Cookies policy
  • Consent settings
  • Security
  • GDPR
  • Overview
  • Manage API keys
  • Hello World
  • Hello Web Spotlight
  • Try sample apps
  • Build apps
  • Decide navigation and URLs
  • Environments
    • What are environments?
    • Set up an environment
    • Environment tools
    • Sync environments
    • Migrate content
    • Backup, restore, and clean
    • Example
  • Get Developer Certification

Migrate content to other environments

Carlo Vinci
4 minutes
Environments
Download PDF
0% complete
Once your environments are structurally aligned, the next step is to migrate content and assets. This lesson explains how to use the data-ops tool to export and transfer your content. 

Migrate your content and assets

Once your environments are synced, you’re ready to migrate content items (language variants) and assets using the migrate-content command. This command is ideal for:
  • Restoring content and assets between environments.
  • Promoting content from staging to production.
  • Copying content from production to test or transitional environments.

Prepare which content to migrate 

Before migrating content, it’s important to plan and understand your migration options. A few minutes of preparation can save hours of post-migration cleanup. The migrate-content command offers flexible parameters to help you scope the migration according to your needs.  To run the command, the minimal required parameters are:
  • Environment IDs: Required to identify both source and target environments.
  • Management API key: Required for both source and target environments, with read/write permissions.
  • Language: Define which language to include in the migration.
Define your parameters, which are mutually exclusive. 
  • Use items when you know the exact codenames of the content items you want to migrate.
    • Codenames for items can be found in More actions > Codename.
  • Use the filter parameter to apply custom Delivery API filters and narrow down which items are migrated. 
  • Apply the depth parameter to control how many levels of linked items are included.
  • Choose the byTypesCodenames parameter to filter content items by their content type.
For a complete list of available parameters and their usage, refer to the documentation in GitHub.

Choose a migration approach

To run a successful content migration, choose an approach that best suits your needs. You can either create a snapshot or run the migration directly.
  • Snapshot: Creates a ZIP file containing selected content items and assets. You can preview which items will be affected without making any changes. Snapshots are useful for versioning, auditing, testing, storing content offline, and preparing content for external processing or transformation.
  • Direct migration: Executes the migration immediately and applies changes to the target environment. It’s best used when you‘re confident in the migration setup and ready to migrate content. 

What gets migrated? 

Only content items and assets are migrated. However, if the target environment already contains any of the entities listed below, they will remain unchanged. The migration process performs a patch operation—it updates existing content rather than replacing it entirely. Entities excluded from the migration:
  • Assignees
  • Content item history 
  •  Workflows
  • Tasks, notes, and comments

Run the migration

Before you start the migration, double-check:
  • Environment IDs
  • API keys
  • Any filters you’ve applied.
These details help ensure the command targets the right content and destination. Before executing the migration, the CLI prints a list of content item codenames that will be affected. Review this list carefully to ensure only the intended items are included. This helps avoid accidental overwrites or updates.  After running the command, review the logs for errors and confirm that the expected content and assets appear in the target environment. It’s also a good practice to spot-check key items and run automated tests if you have them. This helps to make sure that everything is transferred correctly and is working as expected.

Considerations

When migrating or syncing changes to environments, here are some key points to consider:
  • Once items are migrated to the target environment, reverting changes is not straightforward. Plan carefully, as there’s no built-in rollback mechanism.
  • Avoid syncing or migrating large changes all at once. Smaller, incremental updates are safer and easier to troubleshoot.
  • Use snapshots and visual diffs to preview changes before any major updates.
  • Consider disabling webhooks during migration to avoid triggering unintended actions.
Sign in with your Kontent.ai credentials or sign up for free to unlock the full lesson, track your progress, and access exclusive expert insights and tips!
Sign in
For more complex migrations, you can completely clean the target environment using the environment clean command, or control exactly what gets removed with the include or exclude parameters.
Always test your migration in a staging or non-production environment before applying it to production. This helps catch issues early and prevents data loss.
  • Migrate your content and assets
  • Prepare which content to migrate 
  • What gets migrated? 
  • Run the migration
  • Considerations