Migrating from other instances

Last Updated: May 27, 2016

Description

Migrates data from other RDS instances. It supports MySQL and SQLServer exclusive instances.MySQL instances support batch database migration. During migration, the source instance status is “Migrating” and the destination instance status is “Importing data”. The following conditions must be met:

  • Database migration is performed between different instances that belong to the same user;
  • The instance is running
  • The instance database is running
  • The destination instance lock mode is Normal
  • Destination instance storage space > Space occupied by the destination instance – Destination instance database space + Source instance database space
  • Databases to be migrated exist in both the source and destination instances and are activated.

SQLServer instances support batch database migration. During migration, the source instance status is “Migrating” and the destination instance status is “Importing data”. The following conditions must be met:

  • Database migration is performed between different instances that belong to the same user;
  • The instance is running
  • The instance database is running
  • The destination instance lock mode is Normal
  • Destination instance storage space > Space occupied by the destination instance – Destination instance database space + Source instance database space

Request parameters

Name Type Required? Description
Action String Yes Required parameter. Value: ImportDatabaseBetweenInstances
DBInstanceId String Yes Instance ID
SourceDBInstanceId String Yes Name of the source instance, which cannot be the same as the name of the instance to which data will be migrated
DBInfo String Yes DB information (in the JSON string format) of the instance to which data will be migrated. For MySQL instances, the parameter value is an array, for example, {“DBNames”:[“mydb”,”mydb2”]}. For the MySQL type, the names of the source database and destination database must be the same. In the example, data is migrated to two databases (mydb and mydb2), which must exist in the source and destination instances. For SQLServer instances, the parameter value is in the format of key-value pair, where key indicates the source database, and the destination is the database to which data will be migrated, for example, {“DBNames”:{“srcdb”:”destdb”,”srcdb2”:”destmydb2”}}. For the SQLServer type, the names of the source database and destination database may be different. In this example, the data of srcdb is migrated to destdb, and the data of srcdb2 is migrated to destmydb2. However, the names of multiple source databases must be different, and the names of multiple destination databases must be different too

DBInfo parameters

Name Type Required? Description
DBNames List Yes Names of the databases to be migrated, for example, [“mydb”,”mydb2”]

Return parameters

Name Type Description
<Public Return Parameters> - For details, refer to the Appendix
ImportId Integer ID of the instance to which data is imported

Example

  • Request example
  1. https://rds.aliyuncs.com/?Action=ImportDatabaseBetweenInstances
  2. &DBInstanceId=riauvjz6zajfiq6ba1370329449201
  3. &SourceDBInstanceId=rdsmn6nqimn6nqi
  4. &{"DBNames":["mydb","mydb2"]}
  5. &<Public Request Parameters>
  • Return example

XML format:

  1. <ImportDatabaseBetweenInstancesResponse>
  2. <ImportId>2122321</ImportId>
  3. <RequestId>5A77D650-27A1-4E08-AD9E-59008EDB6927</RequestId>
  4. </ImportDatabaseBetweenInstancesResponse>

JSON format:

  1. {
  2. "ImportId":2122321
  3. "RequestId":"5A77D650-27A1-4E08-AD9E-59008EDB6927"
  4. }
Thank you! We've received your feedback.