Registry / devops / migratortron

migratortron

JSON →
library1.0.0-beta.87jsnpmunverified

Migratortron-1000 (v1.0.0-beta.87) is a TypeScript library for cloning data or entire sites between Contensis CMS projects. It supports migrating content types, components, content models, assets, entries, site view nodes, and individual fields. Key differentiators include deterministic GUID transformation, two-pass migration for handling dependencies, automatic language code replacement between projects, and availability as both a REST API and CLI. The library ships TypeScript types.

npm install migratortron
INSTALL
IMPORT
SIG · MIGRATORTRON
M
migratortron
devopsjavascriptv1.0.0-beta.87
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

ContensisRepository
import { ContensisRepository } from 'migratortron'
const ContensisRepository = require('migratortron').ContensisRepository
ESM-only; use named import.
HydrateContensisRepositories
import { HydrateContensisRepositories } from 'migratortron'
import HydrateContensisRepositories from 'migratortron'
Named export, not default.
GetEntries
import { GetEntries } from 'migratortron'
All exports are named; no default export.

Demonstrates setting up source and target repositories, hydrating them, getting entries, and building migration payloads.

import { ContensisRepository, HydrateContensisRepositories, GetEntries, BuildEntries } from 'migratortron'; const sourceRepo = new ContensisRepository({ rootUrl: process.env.CONTENSIS_SOURCE_URL ?? '', clientId: process.env.CONTENSIS_SOURCE_CLIENT_ID ?? '', clientSecret: process.env.CONTENSIS_SOURCE_CLIENT_SECRET ?? '', }); const targetRepo = new ContensisRepository({ rootUrl: process.env.CONTENSIS_TARGET_URL ?? '', clientId: process.env.CONTENSIS_TARGET_CLIENT_ID ?? '', clientSecret: process.env.CONTENSIS_TARGET_CLIENT_SECRET ?? '', }); const transformGuid = (guid: string, alias: string, project: string) => `${alias}-${project}-${guid}`; async function migrate() { await HydrateContensisRepositories({ source: sourceRepo, targets: [targetRepo] }); const entries = await GetEntries({ source: sourceRepo, targets: [targetRepo], transformGuid }); const built = await BuildEntries({ source: sourceRepo, targets: [targetRepo], entries, transformGuid }); console.log('Migration built:', built); } migrate().catch(console.error);
Debug
Known issues
breakingMigratortron is in beta (v1.0.0-beta.87). API may break between beta versions.
fix
Pin to exact version or stay updated with changelog.
affects: >=1.0.0-beta
gotchaThe transformGuid function must produce unique, deterministic GUIDs across different projects/aliases to avoid collisions.
fix
Include alias and project in the returned string as shown in quickstart.
affects: >=1.0.0-beta
gotchaMigration requires both read and write permissions on Contensis projects; authentication errors can occur if client credentials lack scope.
fix
Ensure client IDs have appropriate roles (e.g., 'ProjectAdmin').
affects: >=1.0.0-beta
deprecatedThe 'download' and 'commit' flags may be removed in future versions; rely on the newer configuration pattern.
fix
Use the dedicated commit/download methods or pass flags in the options object.
affects: >=1.0.0-beta.80
Errors
Common errors & fixes
Error: transformGuid is not a function
transformGuid was not passed or is undefined.
fix
Provide a transformGuid function that takes (guid, alias, project) and returns a string.
HydrateContensisRepositories is not a function
Using default import instead of named import.
fix
Use import { HydrateContensisRepositories } from 'migratortron'.
Error: Unauthorized. Check your Contensis credentials.
Invalid clientId or clientSecret for one of the repositories.
fix
Verify environment variables CONTENSIS_SOURCE_CLIENT_ID, etc. are set correctly.
Upgrade
Version history
1.0.0-beta.87latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
3 hits · last 30 days
node
2
Amazon
1
Resources
migratortron — npm install migratortron · libregistry