• Cheat sheets
  • Documentation
  • API reference
  • Product updates
  • Sign in
Kontent.ai Learn
  • Plan
  • Set up
  • Model
  • Develop
  • Create
  • Overview
    • Overview
      • Overview
      • Create migration scripts
        • When to use migration scripts
        • The building blocks of content migration
        • Before you start
        • Example content migration scenario
        • Create a migration script
        • Write a rollback function
        • Keep your scripts maintainable
        • Run your scripts safely
      • Safe content migration practices

Create migration scripts with data-ops

Tomas Dvorak
6 minutes
0% complete
Changing your content model often means updating existing content to match the new structure. Migration scripts help you automate content changes across your project so you can update items in bulk without manually changing them through the Management API. This lesson walks you through creating migration scripts with data-ops.

The building blocks of content migration

Whenever you want to migrate your content, you need to deal with three things:
  1. Source – defines the data you want to migrate. For example, this can be content in an old CMS, CRM, spreadsheet, or even in a CSV file.
  2. Destination – defines where you want to put the source data. This is Kontent.ai.
  3. Adapter – transforms and maps the data between the source and the destination, and imports it to the destination. This is what Kontent.ai CLI helps with.

Explore the CLI migration samples

In the video, Jake Kula, our Presales Engineer, shows you how to use the migrations boilerplate for Kontent.ai CLI to run a series of content migrations. This approach works well for content migrations within an existing Kontent.ai project as well as for importing content from external resources such as databases, other CMSs, spreadsheets, or CSV files. You can also use the same approach to import and export content for your backups.
Play video on https://kontent.ai/develop/migrate/automate-migrations-with-cli/create-migration-scripts
The boilerplate comes with migration scripts built around the example of making a content model change and updating the affected content items.
Why not just one script that handles it all?It's a good practice to have one migration script per task. That way you know better where to look when something fails.

Create migration scripts that suit your use case

Once you know how to work with the CLI and how to run the migration scripts, you can adjust the existing scripts. Depending on the amount of content you need to migrate, decide whether you want to hardcode specific values in your scripts or get the values dynamically from the source of the migration.In the next lesson, you’ll go over our best practices for content migrations so that you can be confident your migrations won't affect your production environment.
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
Copyright © 2026 Kontent.ai. All rights reserved.
  • Web
  • Privacy policy
  • Cookies policy
  • Consent settings
  • Security
  • GDPR