You can call the CreateCloudMigrationPrecheckTask operation to create an assessment task for cloud migration to an ApsaraDB RDS for PostgreSQL instance.
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 standard SSDs or enhanced SSDs (ESSDs).
- 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.
PostgreSQL migration with public network address (including migrating from other cloud vendors)
The source PostgreSQL instance is assigned with a public IP address.
- If the self-managed PostgreSQL instance resides on an ECS instance, an ECS security group is configured. For more information, see ~~369726~~.
- 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.
Debugging
Request parameters
| Parameter | Type | Required | Example | Description |
|---|---|---|---|---|
| Action | String | Yes | CreateCloudMigrationPrecheckTask | The operation that you want to perform. Set the value to CreateCloudMigrationPrecheckTask. |
| DBInstanceName | String | Yes | pgm-bp102g323jd4**** | The ID of the instance. You can call the DescribeDBInstances operation to query the IDs of instances. |
| SourceIpAddress | String | Yes | 172.2.XX.XX | The private IP address that is used to connect to the self-managed PostgreSQL instance.
|
| SourcePort | Long | Yes | 5432 | The port that is used to connect to the self-managed PostgreSQL instance. You can run the |
| SourceAccount | String | Yes | migratetest | The username of the account. Enter the username of the account that you created in the Create an account for cloud migration on a self-managed PostgreSQL instance topic. |
| SourcePassword | String | Yes | 123456 | The password of the account. Enter the password of the account that you created in the Create an account for cloud migration on a self-managed PostgreSQL instance topic. |
| TaskName | String | No | slf7w7wj3g | The name of the cloud migration task. If you do not specify this parameter, ApsaraDB RDS automatically generates a name for the cloud migration task. |
| SourceCategory | String | Yes | ecsOnVpc | The environment in which the self-managed PostgreSQL instance runs.
|
Response parameters
| Parameter | Type | Example | Description |
|---|---|---|---|
| DBInstanceName | String | pgm-bp102g323jd4**** | The name of the instance. |
| RequestId | String | 60F9A12A-16B8-4728-B099-4CA38D32C31C | The ID of the request. |
| TaskId | Long | 439946016 | The ID of the cloud migration task. |
| TaskName | String | slf7w7wj3g | The name of the cloud migration task. |
Examples
Sample requests
http(s)://rds.aliyuncs.com/?Action=CreateCloudMigrationPrecheckTask
&DBInstanceName=pgm-bp102g323jd4****
&SourceIpAddress=172.2.XX.XX
&SourcePort=5432
&SourceAccount=migratetest
&SourcePassword=123456
&TaskName=slf7w7wj3g
&SourceCategory=ecsOnVpc
&Common request parameters
Sample success responses
XML format
HTTP/1.1 200 OK
Content-Type:application/xml
<CreateCloudMigrationPrecheckTaskResponse>
<DBInstanceName>pgm-bp102g323jd4****</DBInstanceName>
<RequestId>60F9A12A-16B8-4728-B099-4CA38D32C31C</RequestId>
<TaskId>439946016</TaskId>
<TaskName>slf7w7wj3g</TaskName>
</CreateCloudMigrationPrecheckTaskResponse>
JSON format
HTTP/1.1 200 OK
Content-Type:application/json
{
"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 error message returned because this operation is not supported for the state in which the instance stays. |
| 403 | IncorrectDBInstance | The current DB instance does not support this operation. | The error message returned because the operation is not supported by the instance. |
| 403 | IncorrectDBInstanceType | The database instance type does not support the operation. | The error message returned because this operation is not supported by the database engine that is run on the instance. |
| 404 | InvalidDBInstanceName.NotFound | The database instance does not exist. | The error message returned because the name of the instance cannot be found. Check whether the name is correct. |
| 404 | IncorrectDBInstanceLockMode | Current DB instance lock mode does not support this operation. | The error message returned because the instance is locked. |
For a list of error codes, see Service error codes.