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
) (usingshp2pgsql
) - New in v20.2: OpenStreetMap data files (
.pbf
) (usingosm2pgsql
) - New in v20.2: GeoPackage data files (
.gpkg
) (usingogr2ogr
) - New in v20.2: GeoJSON data files (
.geojson
) (usingogr2ogr
)
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:
- Migrate from Oracle
- Migrate from Postgres
- Migrate from MySQL
- Migrate from CSV
- Migrate from Avro
- Migrate from Shapefiles
- Migrate from OpenStreetMap
- Migrate from GeoPackage
- Migrate from GeoJSON
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:
- The state of your data is what you expect post-migration.
- 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 STRING
s, DECIMAL
s, 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
IMPORT
- Import Performance Best Practices
- Migrate from Oracle
- Migrate from CSV
- Migrate from MySQL
- Migrate from Postgres
- Migrate from Avro
- Can a Postgres or MySQL application be migrated to CockroachDB?
- PostgreSQL Compatibility
- SQL Dump (Export)
- Back Up and Restore
- Use the Built-in SQL Client
- Other Cockroach Commands