You can call the ImportUserBackupFile operation to import a specific full backup file of a self-managed MySQL database into an ApsaraDB RDS for MySQL instance.
Before you call this operation, make sure that the following requirements are met:
- The self-managed MySQL database must run MySQL 5.7, and the data of the database must
be backed up by using XtraBackup and saved as a full backup file whose name ends with
_qp.xb
. For more information, see Migrate the full backup data of a self-managed MySQL 5.7 database to an ApsaraDB RDS for MySQL instance. - The full backup file of the self-managed MySQL database must be uploaded to an Object Storage Service (OSS) bucket in the region of the ApsaraDB RDS for MySQL instance. For more information, see Migrate the full backup data of a self-managed MySQL 5.7 database to an ApsaraDB RDS for MySQL instance.
Debugging
Request parameters
Parameter | Type | Required | Example | Description |
---|---|---|---|---|
Action | String | Yes | ImportUserBackupFile |
The operation that you want to perform. Set the value to ImportUserBackupFile. |
BackupFile | String | Yes | {"Bucket":"test", "Object":"test/test_db_employees.xb","Location":"ap-southeast-1"} |
A JSON array that consists of the information about the full backup file stored as an object in an OSS bucket. Example: {"Bucket":"test", "Object":"test/test_db_employees.xb","Location":"ap-southeast-1"}
The following parameters are used in the array:
|
BucketRegion | String | Yes | cn-hangzhou |
The region ID of the OSS bucket where the full backup file is located. You can call the DescribeRegions operation to query the most recent region list. |
EngineVersion | String | Yes | 5.7 |
The version of the database engine that is run on the self-managed MySQL database and ApsaraDB RDS for MySQL instance. Set the value to 5.7. |
RegionId | String | Yes | cn-hangzhou |
The region ID of the ApsaraDB RDS for MySQL instance. You can call the DescribeRegions operation to query the most recent region list. Note
|
Comment | String | No | BackupTest |
The description of the full backup file. |
RestoreSize | Integer | No | 20 |
The size of storage space that is required to restore the data of the full backup file. Unit: GB. Note
|
Retention | Integer | No | 30 |
The retention period of the full backup file. Unit: days. Valid values: any non-zero positive integer. |
ZoneId | String | No | cn-hangzhou-b |
The zone ID of the ApsaraDB RDS for MySQL instance. You can call the DescribeRegions operation to query the IDs of zones. Note
|
Response parameters
Parameter | Type | Example | Description |
---|---|---|---|
BackupId | String | b-n8tpg24c6i0v******** |
The ID of the full backup file. |
RequestId | String | A140DD14-DCC9-4548-9C72-52A49A58A310 |
The ID of the request. |
Status | Boolean | true |
Indicates whether the full backup file is imported into the ApsaraDB RDS for MySQL instance. If the full backup file is imported, the true is returned. Otherwise, an error message is returned. |
Examples
Sample requests
http(s)://rds.aliyuncs.com/?Action=ImportUserBackupFile
&BackupFile={"Bucket":"test", "Object":"test/test_db_employees.xb","Location":"ap-southeast-1"}
&BucketRegion=cn-hangzhou
&EngineVersion=5.7
&RegionId=cn-hangzhou
&<Common request parameters>
Sample success responses
XML
format
<ImportUserBackupFileResponse>
<RequestId>A140DD14-DCC9-4548-9C72-52A49A58A310</RequestId>
<BackupId>b-n8tpg24c6i0v********</BackupId>
<Status>true</Status>
</ImportUserBackupFileResponse>
JSON
format
{
"RequestId":"A140DD14-DCC9-4548-9C72-52A49A58A310",
"BackupId":"b-n8tpg24c6i0v********",
"Status":"true"
}
Error codes
HTTP status code | Error code | Error message | Description |
---|---|---|---|
400 | InvalidOssBackupFile.InvalidFile | The specified OSS backup file is invalid. | The error message returned because the specified full backup file cannot be found in the specified OSS bucket. |
400 | OperationDenied.Product | The product code is not supported. | The error message returned because the product code is not supported. |
For a list of error codes, visit the API Error Center.