Skip to main content
The statements on this page are deprecated as of v23.1 and will be removed in a future release. To move data into CockroachDB, use IMPORT INTO or COPY FROM.
The cockroach import command imports a database or table from a local dump file into a running cluster. This command uploads a userfile, imports its data, then deletes the userfile. PGDUMP and MYSQLDUMP file formats are currently supported.

Required privileges

The user must have CREATE privileges on defaultdb.

Synopsis

Import a database:
Import a table:
View help:

Supported formats

Flags

Examples

Import a database

To import a database from a local file:

Import a table

To import a table from a local file:

Import a database with unsupported SQL syntax and log all unsupported statements

To import a database from a PGDUMP file that contains unsupported SQL syntax and log the ignored statements to a userfile:

Import a limited number of rows from a dump file

To limit the number of rows imported from a dump file:

See also