All Products
Search
Document Center

ApsaraDB RDS:ImportDatabaseBetweenInstances

Last Updated:May 29, 2023

Migrates data across instances.

Operation Description

We recommend that you use Data Transmission Service (DTS). DTS provides data migration, subscription, and synchronization features that allow you to establish stable, secure transmission links. For more information, see DTS API overview.

During the migration, the source instance is in the Migrating state, and the destination instance is in the Importing state.

Before you call this operation, make sure that the following requirements are met:

  • The source and destination instances must run SQL Server and belong to the dedicated or dedicated host instance family. For more information about the supported instance types, see Primary instance types.
  • The source and destination instances must be created by using the same user credentials.
  • The instance is in the Running state.
  • The source and destination databases must be in the Running state.
  • The remaining storage of the destination instance must be greater than the storage capacity of the source instance.
Note
  • This operation is not supported for instances that run SQL Server 2017 on RDS Cluster Edition.

  • You can migrate the data of multiple databases at a time.

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • The required resource types are displayed in bold characters.
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
rds:ImportDatabaseBetweenInstancesWRITE
  • RDS
    acs:rds:{#regionId}:{#accountId}:dbinstance/{#dbinstanceId}
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
DBInstanceIdstringYes

The ID of the instance.

rm-uf6wjk5xxxxxxx
SourceDBInstanceIdstringYes

The ID of the source instance, which cannot be the same as the ID of the destination instance.

rm-g4a1jk8xxxxxxx
DBInfostringYes

The names of the source and destination databases. The value of this parameter is a JSON string.

NoteIf the source and destination instances run SQL Server, the value of this parameter consists of one or more key-value pairs. In each key-value pair, the key specifies the name of the source database, and the value specifies the name of the destination database. A source database can have a different name from the destination database. For example, {"DBNames":{"srcdb":"destdb","srcdb2":"destmydb2"}} indicates that srcdb is migrated to destdb and srcdb2 is migrated to destmydb2. The names of source databases cannot be the same, and the names of destination databases cannot be the same.
{"DBNames":["mydb","mydb2"]}

Response parameters

ParameterTypeDescriptionExample
object

The response parameters.

ImportIdstring

The ID of the import task.

852654*****
RequestIdstring

The ID of the request.

5A77D650-27A1-4E08-AD9E-59008EDB6927

Examples

Sample success responses

JSONformat

{
  "ImportId": "852654*****",
  "RequestId": "5A77D650-27A1-4E08-AD9E-59008EDB6927"
}

Error codes

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
2022-06-23API Description Update
Change itemChange content
API DescriptionAPI Description Update