> ## Documentation Index
> Fetch the complete documentation index at: https://docs.cockroachlabs.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Migration Assistant Overview

<Note>
  **This feature is in [preview](/docs/releases/cockroachdb-feature-availability)** and subject to change. To share feedback and/or issues, contact [Support](https://support.cockroachlabs.com).
</Note>

Moving data from an existing database is often the largest step in adopting a new platform. Migration Assistant is [Cockroach Continuum](/docs/continuum/overview)'s AI-guided workflow for moving from an existing PostgreSQL database onto CockroachDB: it guides you through connecting a source database, converting its schema, loading and verifying data, and planning your next steps. The Assistant explains its work and lets you review and edit generated statements before you apply them.

This page explains what the Migration Assistant is and how it works at a high level. For instructions on deploying it, refer to [Deploy the Migration Assistant](/docs/continuum/migration-assistant-deploy). For instructions on using it to move your data, refer to [Use the Migration Assistant](/docs/continuum/migration-assistant-use).

## Eligibility

The Migration Assistant is available in open preview, with no organization enrollment required. Your source database and target cluster must meet the following requirements:

* The source database runs PostgreSQL 15 to 18.
* The target is an existing, single-region [Mission Critical](/docs/continuum/editions-and-add-ons#editions) cluster in a Cockroach Continuum organization or an existing, single-region [CockroachDB Advanced](/docs/cockroachcloud/plan-your-cluster-advanced) cluster in another CockroachDB Cloud organization.
* The target cluster does not already have a Migration Assistant instance. Each target cluster can have one instance at a time.

[CockroachDB Basic](/docs/cockroachcloud/plan-your-cluster-basic), [CockroachDB Standard](/docs/cockroachcloud/plan-your-cluster), [CockroachDB BYOC](/docs/cockroachcloud/byoc-overview), CockroachDB self-hosted, and multi-region target clusters are not supported in the Migration Assistant preview.

Azure target clusters are not currently supported.

## PostgreSQL compatibility

Support for a PostgreSQL source version does not mean that every feature used by the source database can be migrated automatically. Review the converted schema and migration plan for unsupported objects and changes that affect application behavior. The Migration Assistant reports which objects cannot be converted and require manual work.

The following limitations apply during preview:

| Source feature                             | Migration behavior and required action                                                                                                                                                                                                                                                                                                                                  |
| ------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Users, roles, privileges, and ownership    | The Assistant does not migrate users, roles, role memberships, grants, default privileges, or object ownership. Newly created objects are owned by the target connection user. Re-create the required users and roles, then apply the appropriate ownership and privileges on the target. Per-role and per-database default settings also require manual configuration. |
| Row-level security (RLS)                   | The Assistant does not migrate policies or the settings that enable or force RLS. Newly created tables have RLS disabled and no policies. Re-create the policies and enable the required RLS settings before allowing application access. Refer to [Row-Level Security](/docs/stable/row-level-security).                                                               |
| Triggers                                   | Supported PL/pgSQL trigger functions can migrate through the routine workflow, but the Assistant does not create the trigger objects that invoke them. Review the skipped triggers and manually re-create those supported by the target after their functions are installed. Refer to [CREATE TRIGGER](/docs/stable/create-trigger).                                    |
| Features that depend on the target version | A converted statement can require a newer CockroachDB version than the target cluster runs. Check feature availability in the documentation for your target version and test the generated SQL before relying on it. Successful conversion alone does not establish target-version compatibility.                                                                       |

For broader differences between PostgreSQL and CockroachDB, refer to [PostgreSQL Compatibility](/docs/stable/postgresql-compatibility). CockroachDB support for a feature does not by itself mean that the Migration Assistant migrates it automatically.

## How it works

You [deploy the Migration Assistant to CockroachDB Cloud](/docs/continuum/migration-assistant-deploy). There is nothing to install locally.

The Assistant uses the [MOLT (Migrate Off Legacy Technology) toolset](/docs/molt/migration-overview) for conversion, data load, and verification. You can download converted DDL and generated scripts.

During the migration, you can ask the **Migration agent** questions about your schema and the conversion in a chat panel. The Migration agent may suggest updates to your schema, stored procedures, and user-defined functions, which you can choose whether to apply. For more information, refer to [Ask questions in the Migration agent panel](/docs/continuum/migration-assistant-use#ask-questions-in-the-migration-agent-panel).

## Migration sequence

The Assistant guides you through the following migration sequence.

1. **Connect and verify.** In this step the Assistant connects to the source database and verifies read permissions. It also connects to the target database and verifies write permissions.
2. **Select what to migrate.** The Assistant discovers the source schema, and you select the objects to migrate.
3. **Convert the schema.** The Assistant converts the source schema to CockroachDB DDL, explains each change it makes, and calls out anything that needs your decision. You can edit any statement before applying it.
4. **Generate the plan.** The Assistant assesses the selected objects and schema-conversion decisions, then produces an ordered migration plan.
5. **Complete pre-migration work.** You review and complete the executable and manual steps required to prepare the target for loading data.
6. **Load data.** The Assistant moves the source data into the target cluster, using [MOLT Fetch](/docs/molt/molt-fetch).
7. **Convert and test routines.** The Assistant classifies and converts source [stored procedures](/docs/continuum/stored-procedures) and [user-defined functions (UDFs)](/docs/continuum/user-defined-functions), and generates tests for your review.
8. **Complete post-migration work.** You restore deferred database objects including indexes and foreign keys, and verify loaded data with [MOLT Verify](/docs/molt/molt-verify). Later, outside the Migration Assistant, you will test the application against the target.
9. **Review results.** The Assistant summarizes the migration, identifies objects that still require manual work, and recommends next steps.

For more information about the migration sequence, refer to [Use the Migration Assistant](/docs/continuum/migration-assistant-use).

<Note>
  The Assistant does not run ongoing replication or perform application cutover. Its scope ends at a converted, loaded, and verified target. For ongoing replication, refer to [MOLT Replicator](/docs/molt/molt-replicator). For application validation and cutover preparation, refer to [Migration Best Practices](/docs/molt/migration-strategy).
</Note>

## What is shared with the Migration agent

The **Migration agent** is the AI component of the Migration Assistant. Cockroach Labs manages the Migration agent in its own cloud account, so you do not need to configure or connect a separate AI service. Your database credentials stay with the Migration Assistant and are never shared with the Migration agent.

To analyze compatibility and generate a migration plan, the Assistant shares the following information with the Migration agent:

* Schema structure and definitions, including object DDL for tables, views, types, and routines.
* Limited table statistics, such as row counts, that help determine how to group tables in [MOLT Fetch](/docs/molt/molt-fetch) commands.
* Text that you enter in the **Migration agent** panel.

The Assistant tokenizes schema identifiers by default. Tokenization obfuscates names by replacing database, schema, table, column, type, routine, and routine-variable names with generated identifiers before schema content is shared with the Migration agent. The **Tokenization** tab previews what will be shared and lets you inspect the generated mappings.

Database row data is **never** shared with the Migration agent. It moves only between the source database, target database, and customer-controlled storage.

## Demo video

For a demonstration of how to use the Migration Assistant, watch the following video:

<iframe width="560" height="315" src="https://www.youtube.com/embed/O7wiXpMgx24" title="YouTube video player" frameBorder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowFullScreen />

## See also

* [Deploy the Migration Assistant](/docs/continuum/migration-assistant-deploy)
* [Use the Migration Assistant](/docs/continuum/migration-assistant-use)
