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.
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.
On the DRDS console, select Instances in the left-side navigation pane.
Click the name of the target instance.
Click Databases on the left-side navigation pane.
Click the name of the target database.
On the Basic Information page, click Import Data at the upper-right corner.
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.
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.