You can call the CreateCloudMigrationPrecheckTask operation to create an assessment task for cloud migration to an ApsaraDB RDS for PostgreSQL instance.

Prerequisites

The ApsaraDB RDS for PostgreSQL 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, or PostgreSQL 14.
  • 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 destination RDS instance is empty, and the available storage of the destination RDS instance is greater than or equal to the size of data in the self-managed PostgreSQL instance.

The self-managed PostgreSQL instance meets the following requirements:

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

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 or public IP address that is used to connect to the self-managed PostgreSQL instance.

  • If the self-managed PostgreSQL instance resides on an ECS instance, enter the private IP address of the ECS instance. For more information about how to obtain the private IP address of an ECS instance, see View IP addresses.
  • If the self-managed PostgreSQL instance resides in a data center, enter the IP address of the DNS server.
SourcePort Long Yes 5432

The port that is used to connect to the self-managed PostgreSQL instance. You can run the netstat -a grep PGSQL command to view the port.

SourceAccount String Yes migratetest

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.

SourcePassword String Yes 123456

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.

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.

  • idcOnVpc: The self-managed PostgreSQL instance resides in a data center, which can communicate with the VPC to which the ApsaraDB RDS for PostgreSQL instance belongs.
  • ecsOnVpc: The self-managed PostgreSQL instance resides on an ECS instance.
  • internet: The self-managed PostgreSQL instance resides on a device that is connected over the Internet.

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 while the instance is in the current state.
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 for the instance type of 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, visit the API Error Center.