Creates an assessment task for cloud migration to an ApsaraDB RDS for PostgreSQL instance.
Operation Description
Prerequisites
The RDS instance meets the following requirements:
- The RDS instance and the self-managed PostgreSQL instance run the same PostgreSQL version, which can be PostgreSQL 10, PostgreSQL 11, PostgreSQL 12, PostgreSQL 13, PostgreSQL 14, or PostgreSQL 15.
- The RDS instance is a primary instance. Read-only RDS instances do not support cloud migration.
- The RDS instance uses cloud disks.
- The RDS instance is empty. The available storage of the RDS instance is greater than or equal to the size of the data in the self-managed PostgreSQL instance.
The self-managed PostgreSQL instance meets the following requirements:
- Network configurations
Migration source | Network configuration |
---|---|
Self-managed ECS-based PostgreSQL Database | If the self-managed PostgreSQL instance resides on an Elastic Compute Service (ECS) instance, the ECS instance and the RDS instance must reside in the same virtual private cloud (VPC). If the ECS instance and the RDS instance reside in different VPCs, use Cloud Enterprise Network (CEN) to connect the VPCs. For more information, see What is CEN? |
Self-managed PostgreSQL database in a data center (within the same VPC as the destination database) | The data center is able to communicate with the VPC to which the destination RDS instance belongs. For more information, see Connect a data center to a VPC. |
- If the self-managed PostgreSQL instance resides on an ECS instance, an ECS security group is configured. For more information, see (Optional) Configure an ECS security group on a self-managed PostgreSQL instance.
- The configurations that are described in Configure a self-managed PostgreSQL instance to listen to remote connections are complete.
- The configurations that are described in Create an account for cloud migration on a self-managed PostgreSQL instance are complete.
- The configurations that are described in Update the pg_hba.conf file of a self-managed PostgreSQL instance are complete.
- The configurations that are described in Configure the firewall of the server on which a self-managed PostgreSQL instance resides are complete.
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.
Operation | Access level | Resource type | Condition key | Associated operation |
---|---|---|---|---|
rds:CreateCloudMigrationPrecheckTask | Read |
|
| none |
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
DBInstanceName | string | Yes | The ID of the instance. You can call the DescribeDBInstances operation to query the IDs of instances. | pgm-bp102g323jd4**** |
SourceIpAddress | string | Yes | The private IP address that is used to connect to the self-managed PostgreSQL instance.
| 172.2.XX.XX |
SourcePort | long | Yes | The port that is used to connect to the self-managed PostgreSQL instance. You can run the | 5432 |
SourceAccount | string | Yes | The username of the account that is used to connect to the self-managed PostgreSQL instance. Enter the username of the account that you created in the Create an account for cloud migration on a self-managed PostgreSQL instance topic. | migratetest |
SourcePassword | string | Yes | The password of the account that is used to connect to the self-managed PostgreSQL instance. Enter the password of the account that you created in the Create an account for cloud migration on a self-managed PostgreSQL instance topic. | 123456 |
TaskName | string | No | The name of the task. If you do not specify this parameter, ApsaraDB RDS automatically generates a name for the cloud migration task. | slf7w7wj3g |
SourceCategory | string | Yes | The environment in which the self-managed PostgreSQL instance runs.
| ecsOnVpc |
Response parameters
Examples
Sample success responses
JSON
format
{
"DBInstanceName": "pgm-bp102g323jd4****",
"RequestId": "60F9A12A-16B8-4728-B099-4CA38D32C31C",
"TaskId": 439946016,
"TaskName": "slf7w7wj3g"
}
Error codes
HTTP status code | Error code | Error message | Description |
---|---|---|---|
400 | IncorrectDBInstanceState | The current instance state does not support this operation. | The operation is not supported. The RDS instance is not in a ready state. |
403 | IncorrectDBInstance | The current DB instance does not support this operation. | The operation failed. The operation is not supported for the RDS instance. |
403 | IncorrectDBInstanceType | The database instance type does not support the operation. | The operation failed. The operation is not supported for the database engine of the RDS instance. |
404 | InvalidDBInstanceName.NotFound | The database instance does not exist. | The name of the RDS instance cannot be found. Check the name of the RDS instance. |
404 | IncorrectDBInstanceLockMode | Current DB instance lock mode does not support this operation. | The operation failed. The RDS instance is locked. |
For a list of error codes, visit the Service error codes.