The Kontent.ai migrations boilerplate aims to provide a exemplary introduction in developing migrations using Kontent.ai data-ops. Migrations allow you to perform any operation supported by the Management API through smaller executable scripts. This repository showcases various migration scenarios, including the creation of different entities. Each migration also includes a rollback function to reverse the changes made by the migration.
Note
The migrations in this repository are written in TypeScript
and must be transpiled before execution.
- Install required depencies
npm ci
- Set up mandatory parameters for data-ops migrations:
- Copy
exampleParams.json
and rename it tomigrationsParams.json
- Fill in the missing parameters for your environment.
- Copy
- Inspect the migrations in the
src
folder. - Examine prepared scripts in
package.json
. - Try out the scripts
- e.g.
npm run migrate:all
to run all of the migrations
- e.g.
Tip
You can add additional parameters using --
. For example, to rollback next 5 migrations, use npm run migrate:next -- 5 -b
.
Tip
You can view all parameters by using npm run data-ops -- migrations <command> --help