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 flow

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.

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 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+, CockroachDB GA
Verify Schema and data validation PostgreSQL 12-16, 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 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 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, migrations with minimal downtime
--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 Migrations with minimal downtime, 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 Local performance testing
--direct-copy Loads data directly using COPY FROM, without intermediate storage Local testing, limited-infrastructure environments

Migrations with minimal downtime

MOLT simplifies and streamlines migrations by using 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. The length of the pause depends on the volume of write traffic and the amount of replication lag between the source and CockroachDB.

Run MOLT Fetch in either data-load-and-replication mode, or data-load mode followed by replication-only, to load the initial source data and continuously replicate subsequent changes to CockroachDB. 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.

Migration failback

If issues arise during the migration, start MOLT Fetch in failback mode after stopping replication and before sending new writes to CockroachDB. Failback mode replicates changes from CockroachDB back to the original source database, ensuring that data is consistent on the original source so that you can retry the migration later. For example steps, refer to Migration Failback.

See also


Yes No
On this page

Yes No