Before you begin
These instructions assume you already have the following:- A from which you want to migrate data.
- A .
- .
Step 1. Export data to cloud storage
First, upload your CockroachDB Standard data to a cloud storage location where the CockroachDB Advanced cluster can access it.-
and run the statement for each table you need to migrate. For example, the following statement exports the
warehousetable from the database to an Amazon S3 bucket:This command uploads the table in CSV format to amigration-datadirectory in the S3 bucket. The output shows the programmatically generated filename, which you’ll reference when you import the CSV:The export file contains the following CSV data: -
Repeat this step for each table you want to migrate. For example, export one more table (
district) from thetpccdatabase:The export file contains the following CSV data:
Step 2. Import the CSV
-
and you want to import the tables into. For example:
- Write a statement that matches the schema of the table data you’re importing.
The column order in your schema must match the column order in the file being imported.
tpcc.warehouse data into a warehouse table, issue the following statement to create the new table:
IMPORT INTO to import the data into the new table, specifying the filename of the export from Step 1:
-
Repeat the previous command for each CSV file you want to import. For example, import the
tpcc.districtdata: Issue the following statement to create a newdistricttable:Next, useIMPORT INTOto import the data into the new table, specifying the filename of the export from Step 1: -
(Optional) To verify that the data was imported, use :

