Migration Overview

On this page Carat arrow pointing down

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:

Migration sequence

Tip:

Before you begin the migration, review Migration Strategy.

A migration to CockroachDB generally follows this sequence:

MOLT tooling overview

  1. Prepare the source database: Configure users, permissions, and replication settings as needed.
  2. 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.
  3. Load data into CockroachDB: Use MOLT Fetch to bulk-ingest your source data.
  4. (Optional) Verify consistency before replication: Use MOLT Verify to confirm that the data loaded into CockroachDB is consistent with the source.
  5. Finalize target schema: Recreate indexes or constraints on CockroachDB that you previously dropped to facilitate data load.
  6. Replicate ongoing changes: Enable continuous replication with MOLT Fetch to keep CockroachDB in sync with the source.
  7. Verify consistency before cutover: Use MOLT Verify to confirm that the CockroachDB data is consistent with the source.
  8. 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:

Fetch

MOLT Fetch performs the core data migration to CockroachDB. It supports:

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.

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.

See also

×