CockroachDB supports importing data from the following databases:

  • MySQL
  • Oracle (using CSV)
  • Postgres (and New in v20.2: PostGIS)

and from the following data formats:

  • CSV/TSV
  • Avro
  • New in v20.2: ESRI Shapefiles (.shp) (using shp2pgsql)
  • New in v20.2: OpenStreetMap data files (.pbf) (using osm2pgsql)
  • New in v20.2: GeoPackage data files (.gpkg) (using ogr2ogr)
  • New in v20.2: GeoJSON data files (.geojson) (using ogr2ogr)

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:

Tip:

For best practices for optimizing import performance in CockroachDB, see Import Performance Best Practices.

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:

  1. The state of your data is what you expect post-migration.
  2. Performance is as expected for your application's workloads. You may need to apply some best practices for optimizing SQL performance in CockroachDB.

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.

See also



YesYes NoNo