Migrate from CockroachDB to YugabyteDB

A planning guide for moving schemas, data and applications from CockroachDB to YugabyteDB's PostgreSQL-compatible YSQL, with what transfers cleanly, what needs rework and what drives effort.

On this page

Migrate from CockroachDB to YugabyteDB: what the move involves

CockroachDB versions from 24.3.0 onward ship under the proprietary CockroachDB Software License, so a team running those versions has to decide whether YugabyteDB's Apache 2.0 core fits its needs. The move is a schema, SQL, data and application cutover, not a lift-and-shift. The effort depends on two things: how much CockroachDB-specific SQL and types the application uses, and how the current multi-region design places data and survives failures. A cluster with simple tables and a single region is a very different project from one that relies on region-aware table placement and retry-heavy transaction code.

The work usually falls to three groups. Platform engineers size and deploy the YugabyteDB cluster, set up backups and monitoring, and plan placement. Database engineers own the schema translation, index rebuilds, data export and validation. Application engineers review every query path that touches CockroachDB-specific behavior and test the cutover. YugabyteDB's YSQL layer reuses the PostgreSQL query layer, so much of the schema and query code carries over. The translation effort centers on CockroachDB features that have no direct PostgreSQL-style equivalent, such as its unique rowid defaults, region and zone configuration statements, and its transaction retry handling. Confirm the exact compatibility differences against the YugabyteDB documentation for the release you plan to run, since the YSQL feature set changes between series.

Before any data moves, ask for a written inventory of the CockroachDB features in use: SQL statements, data types, sequences, indexes, changefeeds, multi-region settings and client retry logic. Use that inventory to decide whether a fixed-scope assessment comes first, and to set the validation criteria, such as row counts, checksums on key tables and replayed workloads, that must pass before each application is switched over.

Which CockroachDB features map to YugabyteDB and which need rework

This table compares common CockroachDB features with their YugabyteDB equivalents and marks each as clean, needs rework or gap. Use it to scope the migration work before you test. Treat every mapping as a starting point to verify against the YugabyteDB documentation for the release you choose, either v2025.2 LTS or v2026.1 STS.

FeatureYugabyteDB positionStatusWhat to confirm
PostgreSQL-compatible SQL and DDLYSQL reuses the PostgreSQL query layer, so most standard SELECT, JOIN and DDL statements carry overCleanRun your full query set against the target release and check for CockroachDB-only functions and syntax
Data typesCommon PostgreSQL types map directly, but CockroachDB-specific types and type casts need reviewNeeds reworkCheck every column type in your schema, including types tied to CockroachDB behavior, and confirm equivalents in the chosen release
Sequences and unique IDsSequences work in YSQL, but CockroachDB-generated IDs such as unique_rowid() or UUID defaults need an explicit replacementNeeds reworkDecide how existing keys are preserved and confirm sequence caching and ordering behavior in the target release
Transactions and retry logicTransactions are distributed, but application retry loops written for CockroachDB's serializable retry errors must be re-testedNeeds reworkConfirm isolation levels, retry error codes and default behavior in the release you deploy
IndexesSecondary indexes and partial indexes are available, but index definitions and hash-sharded index syntax from CockroachDB need translationNeeds reworkRebuild and benchmark each index, and confirm which index options your release supports
Multi-region table localities and survivabilityGeo-partitioning and placement policies use different configuration, so CockroachDB locality settings do not transfer automaticallyGapDesign tablespace and placement rules for your regions, and confirm survivability goals against current documentation
Changefeeds and CDCCockroachDB changefeeds have no direct drop-in equivalent, so downstream consumers need a new capture pathGapDefine the CDC replacement and confirm supported change capture options in the chosen release
User and privilege managementRoles and GRANT statements follow PostgreSQL patterns, but CockroachDB-specific role and certificate settings must be recreatedNeeds reworkMap every role, grant and authentication method, then test access with each application account

Migration sequence from inventory to decommission

This sequence moves a CockroachDB workload to YugabyteDB in stages, so each step produces evidence that the next one depends on. The order keeps production traffic on CockroachDB until validation has passed and a rollback path has been tested.

  1. Inventory schemas, queries and CockroachDB features

    Your engineering team lists every database, schema, table, sequence, index, user-defined type, and trigger or function in use, along with the ORM or driver that issues queries against each one. Include CockroachDB-specific features such as UUID defaults using gen_random_uuid, unique_rowid(), regional tables, locality settings, follower reads, changefeeds, and the transaction retry logic in application code. The output is a written inventory with one row per object and a flag for each feature that does not map directly to YSQL. Confirm the list with the application owners before moving on.

  2. Run a pilot on a non-critical schema

    Choose one schema that has low business risk, a manageable size, and a clear owner, then load it into a non-production YugabyteDB cluster. Your team runs the application test suite and representative queries against it, recording every syntax error, type mismatch, and behavior difference, such as sequence ordering or serialization errors. The pilot produces a defect list and a first estimate of how much application change is needed. Do not treat a passing pilot as proof for the rest of the estate.

  3. Translate schema and confirm the Voyager source path

    Use the schema translation and export steps documented for YugabyteDB Voyager, and confirm first that your source matches a supported path. Voyager is documented as a PostgreSQL migration tool, and its offline migration paths from MySQL and Oracle are deprecated and will no longer be supported after October 13, 2026, so confirm with the vendor how a CockroachDB source is handled in your target version before you plan around it. Hand-correct any DDL that Voyager cannot translate, such as CockroachDB-specific types, index options, and region constraints. The output is a reviewed DDL set in version control with a record of every manual change.

  4. Export data and load it into staging

    Export table data from CockroachDB in a consistent snapshot, then import it into the YugabyteDB staging cluster using the load method you confirmed in the previous step. Record row counts per table, checksums or aggregate values for key columns, and load duration. Rebuild secondary indexes after the bulk load where the documented procedure recommends it, and rebuild multi-region placement rules explicitly rather than assuming they carry over. The output is a staging environment with reconciled counts for every table in scope.

  5. Validate in parallel with live traffic

    Replicate ongoing changes from CockroachDB into YugabyteDB, or dual-run a defined set of read and write paths, and compare results for the same inputs. Check transactions that depend on retries, sequence and identity values, time zone handling, and performance on your top queries against the latency targets your team already tracks. Run reconciliation queries daily until differences are zero for an agreed observation window. The output is a signed validation report that lists every accepted difference and the reason for it.

  6. Cut over applications to YugabyteDB

    Schedule the cutover with a freeze window, stop writes to CockroachDB, confirm the final delta has been applied, and switch application connection strings and configuration to YugabyteDB. Run smoke tests on critical user journeys and watch error rates, retries, and latency. Keep the CockroachDB cluster read-only and retain the rollback procedure with its own tested steps and owners. The output is a confirmed production cutover record and a documented rollback decision point.

  7. Decommission CockroachDB after the rollback window

    After the agreed rollback window closes without an incident that requires reverting, take a final backup of CockroachDB for retention purposes, then shut down nodes and revoke application credentials and network access. Update the configuration management, monitoring, backup jobs, and runbooks so nothing still points at the old cluster. Confirm the retention policy for the final backup with your compliance team. The output is a decommission record showing that no active workload, credential, or backup job depends on CockroachDB.

Which data, identities and integrations move, and which must be rebuilt

Plan on moving the table data, but treating everything around it as a separate workstream. The documented migration path in YugabyteDB Voyager starts from PostgreSQL as its primary source, so a CockroachDB export into YugabyteDB is a custom or two-step route that your team must prove in a pilot before anyone commits to a cutover date. Confirm with the YugabyteDB migration documentation which source types are supported today, and run a test export of your largest tables with row counts, checksums and sequence values compared on both sides.

Changefeeds are the piece most often forgotten. If CockroachDB changefeeds feed Kafka topics, search indexes, caches or analytics jobs, each consumer needs a decision: rebuild the feed from YugabyteDB's CDC capabilities, backfill from a snapshot, or retire the consumer. Inventory every changefeed, its sink and its consumer owner before the pilot starts, because a silent gap in a downstream system often shows up later than the data itself. Application connection strings and drivers also change, since the PostgreSQL-compatible YSQL API and CockroachDB's own driver settings differ, so the team should review each service's driver version, connection pool and retry configuration.

User roles, grants and certificates do not come across automatically in a data move. Recreate database roles and grants from a reviewed inventory, map each application service account to a least-privilege role, and re-issue the TLS certificates and secrets your clusters use. Backup retention is the last item: keep CockroachDB backups under their existing retention and legal hold rules until the new platform has passed restore tests, and confirm with your compliance owner which backup copies must be kept for audit evidence after decommissioning.

What usually goes wrong and how to prevent it

Most failed CockroachDB to YugabyteDB moves do not fail on the first load. They fail later, when application behavior, retries, IDs or regional placement differ from what the team assumed. Each card below names one risk and the check that catches it before cutover.

CockroachDB-specific SQL behavior

Queries and DDL that depend on CockroachDB features, such as certain crdb_internal views, SHOW RANGES output, or CockroachDB-only functions and syntax, will not run unchanged. Inventory every statement the application issues, including ORM-generated SQL and scheduled jobs, and run them against a YugabyteDB test cluster. Treat any error or silent result change as a blocking defect.

Transaction retry logic that does not carry over

CockroachDB asks clients to retry transactions that fail with serialization errors, and many applications wrap writes in retry loops tuned to that behavior. YugabyteDB uses its own transaction conflict handling and isolation settings, so retry code written for CockroachDB may retry too little, too much, or at the wrong level. Confirm the isolation level in use on both sides and load-test the hot write paths under concurrency.

Multi-region placement assumptions

Table localities, zone configurations and survival goals in CockroachDB do not map one to one onto YugabyteDB's tablespaces, placement rules and geo-partitioning. A table that was regional by row in CockroachDB may need explicit partitioning in YugabyteDB to keep latency and data residency the same. Write down the expected read and write latency per region and verify it on the target topology before moving production traffic.

Sequence and ID ordering differences

Applications that rely on monotonically increasing IDs, or on the ordering of auto-generated values across nodes, can behave differently after the move. Compare how each database generates default and serial IDs, and check whether any logic assumes gap-free or time-ordered keys. Decide whether to keep existing key values, reset sequence start points above the highest migrated value, or change the key strategy, and test that choice on a full copy of the data.

Unvalidated row counts and checksums

A successful import does not prove the data is complete or correct. Compare row counts for every table, then compare per-table checksums or hashes computed over ordered primary keys on both sides, and check NULLs, decimal precision, timestamp time zones and JSON content. Keep the validation output as a signed-off record, because it is the evidence the migration team will need during change review.

Cutover without a rollback path

Once writes land only on YugabyteDB, returning to CockroachDB means losing those writes unless the team planned for it. Before cutover, define the rollback trigger, the time window in which rollback is possible, and how writes made after cutover would be copied back or replayed. Rehearse the full rollback on the staging environment and keep the CockroachDB cluster available until the new one has run under real load.

What drives migration cost and duration

This table lists the factors that set the effort of moving from CockroachDB to YugabyteDB, with the reason each one matters and how to reduce it. Read each row against your own cluster, then use the answers to scope the work and request a quote built on the same inventory.

DriverWhy it changes effortHow to keep it down
Number of schemas and tablesEach table needs DDL translation, data export, index rebuilds and row-count checks, so effort grows with object count and with the number of foreign key chains.Inventory every database, schema and table with a script before scoping. Retire unused tables and group migration waves by dependency.
SQL features in useCockroachDB-specific constructs such as unique_rowid(), crdb_internal objects, zone configurations and some type or function differences need rewriting against YSQL, which is PostgreSQL-compatible.Run the queries from application logs and check each against YugabyteDB's compatibility notes. Keep the list of rewritten statements in version control.
Application count and ORM couplingEach service that uses an ORM or driver with CockroachDB-specific behavior needs configuration, retry logic and testing. Coupling to transaction retry handling is often the largest single item.List services, drivers and ORM versions. Consolidate connection and retry code into one library so changes are made once.
Data volume and downtime toleranceLarger datasets lengthen the initial load and the catch-up window. A tight cutover window forces a more careful sync and rollback plan.Measure data size per table and the write rate during peak hours. Agree the acceptable cutover window with business owners before choosing the load method.
Multi-region designSurvival goals, table locality and region placement must be recreated with YugabyteDB placement and tablespace settings. Latency-sensitive tables may need re-architecture, not just re-creation.Document current regions, survival goals and locality settings per table. Start with a single-region migration if the business case allows, then add regions.
Validation depthRow counts alone miss type drift, sequence gaps and constraint differences. Checksums, sampled business queries and parallel reads add time but reduce post-cutover defects.Define the validation set with application owners: critical queries, reconciliation reports and checksums for key tables. Automate it so it runs at each sync.
Internal skillsTeams familiar with PostgreSQL operations and distributed systems tuning shorten the learning curve. Gaps are usually in tablet placement, backups and upgrade procedures.Assess skills honestly, name owners for each area, and ask the implementation partner for knowledge transfer and runbooks as deliverables.

How the migration changes by cluster size and starting point

A single-region CockroachDB cluster is usually the simplest starting point. The main work is schema and SQL translation, plus a data load and a validation pass. Placement rules and multi-region survivability goals do not need to be recreated, so the migration effort centers on the application layer and the data itself.

  • Schema translation: Review CockroachDB-specific types, SERIAL and unique_rowid() defaults, and sequence behavior, then map them to YSQL equivalents.
  • Data export and load: Confirm the export method and the import path into YugabyteDB, and test it on a copy of the largest table first.
  • Transaction behavior: Check whether application code depends on CockroachDB's retry errors and adjust it for YugabyteDB's transaction semantics.
  • Operational baseline: Decide the YugabyteDB release line (for example, the LTS series with the longest maintenance window) and how backups will run.
  • Cutover window: Plan a write freeze or a delta sync, since a single region keeps the cutover path short.

Confirm the exact version of your CockroachDB cluster, the list of SQL features in use, and whether any table relies on features that need a manual rewrite.

What buyers ask before moving off CockroachDB

How much effort and cost should we expect to move off CockroachDB to YugabyteDB?

The cost depends mainly on how much SQL and schema you must translate, how many tables and applications touch the database, and how much multi-region placement you need to rebuild. The YugabyteDB database itself is Apache 2.0 licensed, so there is no license fee for the core. Recurring costs are the servers or cloud accounts that run the cluster, the staff who operate it, and an optional commercial support contract if you want one. One-time costs include schema translation, application changes for CockroachDB-specific behavior, testing, and cutover. Ask any provider for a quote that separates these items and states which applications and environments are in scope. Your own inventory of queries and transaction patterns is the best input for an accurate estimate.

How long does a CockroachDB to YugabyteDB migration usually take?

The timeline is set by the number of schemas and tables, the amount of data to move, the number of applications that must change, and how much validation your compliance rules require. Teams with few tables and simple SQL usually finish sooner than teams with many multi-region tables, custom types, or heavy use of transaction retry logic. Load volume and the size of your change window also matter, because a cutover needs a period when writes are paused or replicated. No duration is fixed by the product, so ask for a plan with phases, a test environment that mirrors production, and named acceptance checks before you agree to a date.

Can our own team migrate to YugabyteDB without outside help?

Many teams can do it in house if they already run PostgreSQL-style SQL, understand distributed transactions, and have time for testing. The main risks are missed CockroachDB-specific syntax, sequence and ID behavior, serializable transaction handling, and multi-region placement settings that differ in YugabyteDB. Internal teams usually need to build their own validation scripts and rehearse cutover at least once. Outside help is most useful for a fixed-scope review of the schema, a test plan, and a cutover runbook, which DeployOpen can plan, implement and document inside your own infrastructure under a written scope.

What skills and staff time does the move require from our team?

Expect to need database engineers who can read and change SQL, application developers who own the queries and transaction logic, and an operations owner who will run the cluster after cutover. Security and compliance staff should review access control, encryption settings, backup procedures and audit logging before go-live. Product owners need to sign off on acceptance criteria. Plan for these people to be available during schema translation, test runs, and the cutover window, not only at the start. Ask your provider which roles they expect you to fill and which they will cover.

Is YugabyteDB fully open source, or is part of it under a restrictive license?

The core YugabyteDB database is licensed under Apache 2.0, and the default build generates only those Apache 2.0 licensed database binaries. The separate YugabyteDB Anywhere management platform is licensed under the Polyform Free Trial License 1.0.0, so its terms differ from the database. If you plan to use YugabyteDB Anywhere, read its license terms with your legal team before deployment. You can run the open-source database without it, using your own deployment, monitoring and backup tooling. Confirm the licensing of any optional component you intend to use against the current repository and documentation.

Which YugabyteDB release should we target for a new deployment?

Choose a release based on your support window and upgrade cadence. The YugabyteDB release page lists v2025.2 as a long-term support series released December 11, 2025, with maintenance support until December 11, 2027 and end of life on June 11, 2028. It lists v2026.1 as a standard-term support series released June 29, 2026, with maintenance support until June 29, 2027 and end of life on December 29, 2027. It also lists v2024.2 LTS, with maintenance support ending December 9, 2026 and end of life on June 9, 2027. Check the YugabyteDB release page for the current status before you commit, because support dates can change.

How do we run CockroachDB and YugabyteDB in parallel during cutover?

A common approach is to load the YugabyteDB cluster with a bulk copy, then keep it current with change capture or application-level dual writes until validation passes. Reads can be compared between the two systems for a sample of queries, and row counts and checksums can be checked table by table. Keep CockroachDB as the system of record until the acceptance checks pass, and define a rollback path that returns traffic to CockroachDB if a problem appears after cutover. Dual writes add application complexity, so decide early whether your workload can tolerate that. Ask your provider to document the parallel run, the rollback steps, and who approves each stage.

What does a fixed-scope engagement for this migration include?

A fixed-scope engagement sets out the systems, schemas, applications and environments in scope, the deliverables, and the timeline in writing before work starts. For a migration like this, deliverables typically include a schema and SQL translation review, a data movement plan, a validation approach, a cutover runbook, and documentation for operations. DeployOpen plans, implements, customizes, integrates, hardens, backs up, upgrades, documents and supports self-hosted open-source platforms inside your own infrastructure. It does not issue audit reports or certifications, so compliance evidence still needs review by your independent auditor. Ask for the written scope and the acceptance criteria before you sign.

How the cutover phases fit together

The flow starts with inventory of schemas, queries and CockroachDB-specific features, then runs a pilot on a copy of a non-critical database before full schema translation to YSQL and data load into YugabyteDB. Parallel validation compares results from both clusters while the application still reads from CockroachDB. Only after that comparison passes does cutover begin, and a rollback path returns traffic to CockroachDB if problems appear. Decommission waits until the rollback window closes.

Phases from inventory to decommission, with the rollback branch from cutover.

How DeployOpen scopes and runs a CockroachDB to YugabyteDB migration

DeployOpen plans and implements the move from CockroachDB to a self-hosted YugabyteDB cluster inside your own cloud accounts, data centers or air-gapped network. The work covers schema translation, data movement, validation and cutover, with each step agreed in writing before it starts.

How we scope

  • Inventory every CockroachDB cluster, database, table, sequence, changefeed and application that connects to it
  • Map CockroachDB-specific SQL, types and multi-region settings to YSQL and document each gap that needs a design decision
  • Agree in writing the deliverables, cutover approach, acceptance criteria and timelines before any engagement work starts

How we build

  • Stand up the YugabyteDB cluster on your infrastructure with the release line you select, checked against the vendor's support dates
  • Rebuild schemas, indexes and multi-region placement, then run data export and load with Voyager or a method you approve
  • Test transaction retry behavior, query results and performance on representative workloads before any application traffic moves

How we hand over

  • Deliver runbooks for cutover, rollback, backup and restore, and routine operations on your own staff
  • Provide validation records comparing row counts, checksums and application test results from source and target
  • Document the architecture, access controls, audit logging and data handling settings for your compliance and security reviewers

How we support

  • Support hypercare after cutover under the agreed scope, with issues handled against the documented runbooks
  • Offer ongoing upgrades, backup testing and continuous security testing as a retainer, priced from a separate written scope
  • Confirm with DeployOpen during scoping which support tier, response expectations and retainer terms apply to your cluster

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.