All Products
Document Center

Import data

Last Updated: Apr 05, 2018

When you start to use DRDS and want to retain existing data, you can import data to the DRDS database from RDS or MySQL databases.

For example, if your existing data is in an RDS database, you need to import the data to DRDS because the DRDS uses a storage mode different from RDS.

Import method

  • To import a small volume of data, for example, less than 5 million data records in total, you can use mysqldump to export the data and then use the MySQL source command to import the data to the DRDS database.

  • To import a large volume of data, you can import the data on the DRDS console.

Import data on the DRDS console

  1. On the DRDS console, select Instances in the left-side navigation pane.

  2. Click the name of the target instance.

  3. Click Databases on the left-side navigation pane.

  4. Click the name of the target database.

  5. On the Basic Information page, click Import Data at the upper-right corner.

  6. Import data. Data is imported through Data Transmission Service (DTS). When selecting the target database, select DRDS.


    Note: DTS does not support schema import to DRDS databases. To import schemas, create a table in the DRDS database first.

  7. Handle the conflict of the imported primary key.

    When data is imported to a DRDS database through DTS, DRDS Sequence cannot be changed because the records contain the primary key ID. As a result, the primary key ID of the imported data takes precedence over the current value of DRDS Sequence, causing a primary key conflict. To avoid this error, you need to change the initial value of Sequence. For the change method, see Modify sequence.