Migration Overview

CockroachDB supports importing data from the following databases:

  • MySQL
  • Postgres
    and from the following data formats:

  • CSV/TSV
    This page lists general considerations to be aware of as you plan your migration to CockroachDB.

In addition to the information listed below, see the following pages for specific instructions and considerations that apply to the database (or data format) you're migrating from:

File storage during import

During migration, all of the features of IMPORT that interact with external file storage assume that every node has the exact same view of that storage. In other words, in order to import from a file, every node needs to have the same access to that file.

Schema and application changes

In general, you are likely to have to make changes to your schema, and how your app interacts with the database. We strongly recommend testing your application against CockroachDB to ensure that:

Data type sizes

Above a certain size, many data types such as STRINGs, DECIMALs, ARRAY, BYTES, and JSONB may run into performance issues due to write amplification. See each data type's documentation for its recommended size limits.

Unsupported data types

CockroachDB does not provide ENUM or SET data types.

In Postgres, you can emulate an ENUM type using a CHECK constraint as shown below. For MySQL, we perform this conversion automatically during the import.

  1. > CREATE TABLE orders (
  2. id UUID PRIMARY KEY,
  3. -- ...
  4. status STRING check (
  5. status='processing' or status='in-transit' or status='delivered'
  6. ) NOT NULL,
  7. -- ...
  8. );

See also

Was this page helpful?
YesNo