The MOLT (Migrate Off Legacy Technology) toolkit enables safe, minimal-downtime database migrations to CockroachDB. MOLT combines schema transformation, distributed data load, continuous replication, and row-level validation into a highly configurable workflow that adapts to diverse production environments.
This page provides an overview of the following:
- Overall migration sequence
- MOLT tools
- Supported migration flows
Migration sequence
Before you begin the migration, review Migration Strategy.
A migration to CockroachDB generally follows this sequence:
- Prepare the source database: Configure users, permissions, and replication settings as needed.
- Convert the source schema: Use the Schema Conversion Tool to generate CockroachDB-compatible DDL. Apply the converted schema to the target database. Drop constraints and indexes to facilitate data load.
- Load data into CockroachDB: Use MOLT Fetch to bulk-ingest your source data.
- (Optional) Verify consistency before replication: Use MOLT Verify to confirm that the data loaded into CockroachDB is consistent with the source.
- Finalize target schema: Recreate indexes or constraints on CockroachDB that you previously dropped to facilitate data load.
- Replicate ongoing changes: Enable continuous replication with MOLT Fetch to keep CockroachDB in sync with the source.
- Verify consistency before cutover: Use MOLT Verify to confirm that the CockroachDB data is consistent with the source.
- Cut over to CockroachDB: Redirect application traffic to the CockroachDB cluster.
Refer to Migration flows.
MOLT tools
MOLT (Migrate Off Legacy Technology) is a set of tools for schema conversion, data load, replication, and validation. Migrations with MOLT are resilient, restartable, and scalable to large data sets.
MOLT Fetch and Verify are CLI-based to maximize control, automation, and visibility during the data load and replication stages.
Tool | Usage | Tested and supported sources | Release status |
---|---|---|---|
Schema Conversion Tool | Schema conversion | PostgreSQL, MySQL, Oracle, SQL Server | GA (Cloud only) |
Fetch | Initial data load; optional continuous replication | PostgreSQL 11-16, MySQL 5.7-8.0+, Oracle Database 19c (Enterprise Edition) and 21c (Express Edition), CockroachDB | GA |
Verify | Schema and data validation | PostgreSQL 12-16, MySQL 5.7-8.0+, Oracle Database 19c (Enterprise Edition) and 21c (Express Edition), CockroachDB | Preview |
Schema Conversion Tool
The MOLT Schema Conversion Tool converts a source database schema to a CockroachDB-compatible schema. The tool performs the following actions:
- Identifies unimplemented features.
- Rewrites unsupported DDL syntax.
- Applies CockroachDB schema best practices.
Fetch
MOLT Fetch performs the core data migration to CockroachDB. It supports:
- Multiple migration flows via
IMPORT INTO
orCOPY FROM
. - Data movement via cloud storage, local file servers, or direct copy.
- Concurrent data export from multiple source tables and shards.
- Continuous replication, enabling you to minimize downtime before cutover.
- Schema transformation rules.
- After exporting data with
IMPORT INTO
, safe continuation to retry failed or interrupted tasks from specific checkpoints. - Failback, which replicates changes from CockroachDB back to the original source via a secure changefeed.
Verify
MOLT Verify checks for data and schema discrepancies between the source database and CockroachDB. It performs the following verifications:
- Table structure.
- Column definition.
- Row-level data.
Migration flows
MOLT Fetch supports various migration flows using MOLT Fetch modes.
Migration flow | Mode | Description | Best for |
---|---|---|---|
Bulk load | --mode data-load |
Perform a one-time bulk load of source data into CockroachDB. | Testing, migrations with planned downtime |
Data load and replication | --mode data-load-and-replication |
Load source data, then replicate subsequent changes continuously. | Minimal downtime migrations |
Data load then replication-only | --mode data-load , then --mode replication-only |
Load source data first, then start replication in a separate task. | Minimal downtime migrations |
Resume replication | --mode replication-only |
Resume replication from a checkpoint after interruption. | Resuming interrupted migrations, post-load sync |
Failback | --mode failback |
Replicate changes from CockroachDB back to the source database. | Rollback scenarios |
Bulk load
For migrations that tolerate downtime, use data-load
mode to perform a one-time bulk load of source data into CockroachDB. Refer to Bulk Load.
Migrations with minimal downtime
To minimize downtime during migration, MOLT Fetch supports replication streams that sync ongoing changes from the source database to CockroachDB. Instead of performing the entire data load during a planned downtime window, you can perform an initial load followed by continuous replication. Writes are only briefly paused to allow replication to drain before final cutover. The length of the pause depends on the volume of write traffic and the amount of replication lag between the source and CockroachDB.
- Use
data-load-and-replication
mode to perform both steps in one task. Refer to Load and Replicate. - Use
data-load
followed byreplication-only
to perform the steps separately. Refer to Load and Replicate Separately.
Recovery and rollback strategies
If the migration is interrupted or you need to abort cutover, MOLT Fetch supports safe recovery flows:
- Use
replication-only
to resume a previously interrupted replication stream. Refer to Resume Replication. - Use
failback
to reverse the migration, syncing changes from CockroachDB back to the original source. This ensures data consistency on the source so that you can retry later. Refer to Migration Failback.