Migration sequence
Before you begin the migration, review the Migration Strategy guide.
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.
Verify consistency (optional)
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 Replicator 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.
MOLT tools
MOLT 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.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
MOLT Fetch
MOLT Fetch performs the initial data load to CockroachDB. It supports:- Multiple migration flows via
IMPORT INTOorCOPY FROM - Data movement via cloud storage, local file servers, or direct copy
- Concurrent data export from multiple source tables and shards
- Schema transformation rules
- Safe continuation to retry failed or interrupted tasks from specific checkpoints
MOLT Replicator
MOLT Replicator provides continuous replication capabilities for minimal-downtime migrations. It supports:- Continuous replication from source databases to CockroachDB
- Multiple consistency modes for balancing throughput and transactional guarantees
- Failback replication from CockroachDB back to source databases
- Performance tuning for high-throughput workloads
MOLT 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 supports various migration flows using MOLT Fetch for data loading and MOLT Replicator for ongoing replication.| Migration flow | Tools | Description | Best for |
|---|---|---|---|
| Bulk load | MOLT Fetch | Perform a one-time bulk load of source data into CockroachDB. | Testing, migrations with planned downtime |
| Data load and replication | MOLT Fetch + MOLT Replicator | Load source data with Fetch, then replicate subsequent changes continuously with Replicator. | Minimal downtime migrations |
| Resume replication | MOLT Replicator | Resume replication from a checkpoint after interruption. | Resuming interrupted migrations, post-load sync |
| Failback | MOLT Replicator | Replicate changes from CockroachDB back to the source database. | Rollback scenarios |
Bulk load
For migrations that tolerate downtime, use MOLT Fetch indata-load mode to perform a one-time bulk load of source data into CockroachDB.
Migrations with minimal downtime
To minimize downtime during migration, use MOLT Fetch for initial data loading followed by MOLT Replicator for continuous replication. Instead of loading all data during a planned downtime window, you can run an initial load followed by continuous replication. Writes are paused only briefly to allow replication to drain before the final cutover. The duration of this pause depends on the volume of write traffic and the replication lag between the source and CockroachDB.Recovery and rollback strategies
If the migration is interrupted or cutover must be aborted, MOLT Replicator provides safe recovery options:- Resume replication: Resume a previously interrupted replication stream
- Failback mode: Reverse the migration, synchronizing changes from CockroachDB back to the original source. This ensures data consistency on the source so that you can retry the migration later.
Next steps
PostgreSQL Migration
Migrate from PostgreSQL to CockroachDB
MySQL Migration
Migrate from MySQL to CockroachDB
Migration Strategy
Plan your migration approach
Schema Design
Best practices for schema design