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 has an overview of the following:
- Overall migration flow
- MOLT tools
- Supported migration and failback modes
Migration flow
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.
- Replicate ongoing changes. Enable continuous replication 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.
- Finalize target schema: Recreate indexes or constraints on CockroachDB that you previously dropped to facilitate data load.
- Cut over to CockroachDB. Redirect application traffic to the CockroachDB cluster.
For a practical example of the preceding steps, refer to Migrate to CockroachDB.
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 scale 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-14, MySQL 5.7-8.0+, CockroachDB | GA |
Verify | Schema and data validation | PostgreSQL 12-14, MySQL 5.7-8.0+, CockroachDB | Preview |
Schema Conversion Tool
The MOLT Schema Conversion Tool converts a source database schema to a CockroachDB-compatible schema. The tool:
- 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 modes 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
- Safe continuation to retry failed or interrupted tasks from specific checkpoints
- Failback to replicate 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:
- Table structure verification
- Column definition verification
- Row-level data verification
- Continuous, live, or one-time verification
Migration modes
MOLT Fetch supports multiple data migration modes. These can be combined based on your testing and cutover strategy.
Mode | Description | Best For |
---|---|---|
--mode data-load |
Performs one-time load of source data into CockroachDB | Testing, migrations with planned downtime, phased migrations |
--mode data-load-and-replication |
Loads source data and starts continuous replication from the source database | Migrations with minimal downtime |
--mode replication-only |
Starts replication from a previously loaded source | Phased migrations, post-load sync |
--mode failback |
Replicates changes on CockroachDB back to the original source | Rollback scenarios |
--mode export-only / --mode import-only |
Separates data export and import phases | Large-scale migrations, custom storage pipelines |
--direct-copy |
Loads data without intermediate storage using COPY FROM |
Local testing, limited infra environments |
Migrations with minimal downtime
MOLT simplifies and streamlines the following migration patterns that use a replication stream to minimize downtime. Rather than load all data into CockroachDB during a planned downtime window, you perform an initial data load and continuously replicate any subsequent changes to CockroachDB. Writes are only briefly paused to allow replication to drain before final cutover.
Full migration with minimal downtime
Run MOLT Fetch in data-load-and-replication
mode to load the initial source data into CockroachDB. Continuous replication starts automatically after the initial load. When ready, pause application traffic to allow replication to drain, validate data consistency with MOLT Verify, then cut over to CockroachDB. For example steps, refer to Migrate to CockroachDB.
Phased migration with minimal downtime
Run MOLT Fetch in data-load
mode to incrementally load and validate data in batches. After loading the initial source data, switch to replication-only
mode to sync ongoing changes. When ready, pause application traffic to allow replication to drain, validate again with MOLT Verify, then cut over to CockroachDB. For example steps, refer to Migrate in Phases.
Migration failback
If issues arise post-cutover, run MOLT Fetch in failback
mode to replicate changes from CockroachDB back to the original source database. This ensures that data is consistent on the original source so that you can retry the migration later. For example steps, refer to Migration Failback.