https://github.com/kontent-ai/migrations-boilerplate
Sample migration scripts for Kontent.ai CLI tool
https://github.com/kontent-ai/migrations-boilerplate
boilerplate content-management hacktoberfest javascript kontent-ai kontent-ai-sample typescript
Last synced: 3 months ago
JSON representation
Sample migration scripts for Kontent.ai CLI tool
- Host: GitHub
- URL: https://github.com/kontent-ai/migrations-boilerplate
- Owner: kontent-ai
- License: mit
- Created: 2019-12-12T13:53:55.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2024-08-27T06:48:41.000Z (almost 2 years ago)
- Last Synced: 2025-04-07T13:11:15.657Z (about 1 year ago)
- Topics: boilerplate, content-management, hacktoberfest, javascript, kontent-ai, kontent-ai-sample, typescript
- Language: TypeScript
- Homepage:
- Size: 364 KB
- Stars: 4
- Watchers: 17
- Forks: 5
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
# Kontent.ai migrations examples
The Kontent.ai migrations boilerplate aims to provide a exemplary introduction in developing migrations using [Kontent.ai data-ops](https://github.com/kontent-ai/data-ops). Migrations allow you to perform any operation supported by the [Management API](https://kontent.ai/learn/reference/management-api-v2) 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.
## Quickstart
1. Install required depencies
```sh
npm ci
```
1. Set up mandatory parameters for data-ops migrations:
* Copy `exampleParams.json` and rename it to `migrationsParams.json`
* Fill in the missing parameters for your environment.
1. Inspect the migrations in the `src` folder.
1. Examine prepared scripts in `package.json`.
1. Try out the scripts
- e.g. `npm run migrate:all` to run all of the migrations
> [!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 --help`