- The generic migration sequence
- MOLT tools
- Variables to consider when choosing a migration approach
- Common migration approaches
Migration sequence
A migration to CockroachDB generally follows a variant of this sequence:- Assess and discover: Inventory the source database, flag unsupported features, make a migration plan.
- Prepare the environment: Configure networking, users and permissions, bucket locations, and replication settings.
- Convert the source schema: Generate CockroachDB-compatible . Apply the converted schema to the target database. Drop constraints and indexes to facilitate data load.
- Load data into CockroachDB: Bulk load the source data into the CockroachDB cluster.
- Finalize target schema: Recreate indexes or constraints on CockroachDB that you previously dropped to facilitate data load.
- Replicate ongoing changes (optional): Keep CockroachDB in sync with the source. This may be necessary for migrations that minimize downtime.
- Stop application traffic: Limit user read/write traffic to the source database. This begins application downtime.
- Verify data consistency: Confirm that the CockroachDB data is consistent with the source.
- Enable failback (optional): Replicate data from the target back to the source, enabling a reversion to the source database in the event of migration failure.
- Cut over application traffic: Resume normal application use, with the CockroachDB cluster as the target database. This ends application downtime.
MOLT tools
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, Replicator, and Verify are CLI-based to maximize control, automation, and visibility during the data load and replication stages.For CockroachDB-to-CockroachDB migrations, contact your account team for guidance.
Schema Conversion Tool
The converts a source database schema to a CockroachDB-compatible schema. The tool performs the following actions:- Identifies .
- Rewrites unsupported .
- Applies CockroachDB .
Fetch
performs the initial data load to CockroachDB. It supports:- Multiple migration flows via
IMPORT INTOorCOPY FROM. - Data movement via .
- from multiple source tables and shards.
- .
- After exporting data with
IMPORT INTO, safe to retry failed or interrupted tasks from specific checkpoints.
Replicator
provides capabilities for minimal-downtime migrations. It supports:- Continuous replication from source databases to CockroachDB.
- for balancing throughput and transactional guarantees.
- Failback replication from CockroachDB back to source databases.
- for high-throughput workloads.
- for defining data transformations.
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 variables
You must decide how you want your migration to handle each of the following variables. These decisions will depend on your specific business and technical considerations. The MOLT toolkit supports any set of decisions made for the supported source databases.
, how you should consider the different options for each variable, and how to use the MOLT toolkit for each variable.
Common migration approaches
MOLT supports various migration flows using for data loading and for ongoing replication. These common approaches are variants of the general migration sequence.
Each of these approaches has a detailed walkthrough guide for performing these migrations using the MOLT toolkit. While these approaches are among the most common, you may need to modify these instructions to suit the specific needs of your migration.

