Create migration scripts with data-ops
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:- 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.
- Destination – defines where you want to put the source data. This is Kontent.ai.
- 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
The boilerplate comes with migration scripts built around the example of making a content model change and updating the affected content items.
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.