A command-line migration tool for Contentful, version 0.17.0, that manages content type schema changes through incremental scripted files based on the CMS as Code approach. It tracks the state of each content type in a 'Migration' content type within the space, ensuring idempotent and reversible migrations. Key differentiators: supports up/down migrations, per-content-type subdirectories, and integration with Contentful's migration library.
npm install contentful-migrateNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Initialize Contentful space for migrations, create a new migration script for a 'post' content type, then apply it.
Ensure CONTENTFUL_MIGRATION_DIR points to a git-tracked folder under the project.
Install compatible contentful-migration version (see package.json peerDependencies).
Use CONTENTFUL_MIGRATION_DIR or watch for breaking changes in config.
Run 'ctf-migrate init' only once per space/environment.
Set CONTENTFUL_MANAGEMENT_ACCESS_TOKEN environment variable or pass --access-token.
Do not run init again; use 'ctf-migrate status' to see existing state.
Create the migrations directory structure matching expected content type subfolders, or set CONTENTFUL_MIGRATION_DIR correctly.
Ensure CONTENTFUL_MANAGEMENT_ACCESS_TOKEN is set and valid.
Install the correct contentful-migration version (e.g., npm install contentful-migration@peerVersion).