Configures a data migration task.

After you call this operation to configure a data migration task, the task will be automatically started. You do not need to call the StartMigrationJob operation to start the task.

A data migration task may fail to be started due to precheck failures. You can call the DescribeMigrationJobStatus operation to query the error messages about precheck failures. Then, you can fix the issue based on the error messages. After you fix the issue, you must call the StartMigrationJob operation to restart the data migration task.

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 ConfigureMigrationJob

The operation that you want to perform. Set the value to ConfigureMigrationJob.

DestinationEndpoint.InstanceType String Yes RDS

The instance type of the destination database. Valid values:

  • ECS: self-managed database that is hosted on Elastic Compute Service (ECS)
  • LocalInstance: self-managed database with a public IP address
  • RDS: ApsaraDB RDS instance
  • DRDS: PolarDB-X instance
  • MongoDB: ApsaraDB for MongoDB instance
  • Redis: ApsaraDB for Redis instance
  • PetaData: HybridDB for MySQL instance
  • POLARDB: PolarDB for MySQL cluster or PolarDB for PostgreSQL cluster
  • PolarDB_o: PolarDB O Edition cluster
  • AnalyticDB: AnalyticDB for MySQL cluster V3.0 or V2.0
  • Greenplum: AnalyticDB for PostgreSQL instance
MigrationJobId String Yes dtsl3m1213ye7l****

The ID of the data migration instance. You can call the DescribeMigrationJobs operation to query the instance ID.

MigrationJobName String Yes MySQL_TO_RDS

The name of the data migration task. The name can be up to 32 characters in length. We recommend that you specify an informative name to identify the task. You do not need to use a unique task name.

MigrationMode.DataIntialization Boolean Yes true

Specifies whether to perform full data migration. Valid values:

  • true: yes
  • false: no
Note For more information about databases that support full data migration, see Supported databases and migration types.
MigrationMode.DataSynchronization Boolean Yes true

Specifies whether to perform incremental data migration. Valid values:

  • true: yes
  • false: no
Note For more information about databases that support incremental data migration, see Supported databases and migration types.
MigrationMode.StructureIntialization Boolean Yes true

Specifies whether to perform schema migration. Valid values:

  • true: yes
  • false: no
Note For more information about databases that support schema migration, see Supported databases and migration types.
MigrationObject String Yes [{"DBName":"dtstestdata","TableIncludes":[{"TableName":"customer"}]}]

The objects that you want to migrate. The value is a JSON string and can contain regular expressions.

For more information, see MigrationObject.

SourceEndpoint.InstanceType String Yes RDS

The instance type of the source database. Valid values:

  • RDS: ApsaraDB RDS instance
  • ECS: self-managed database that is hosted on ECS
  • LocalInstance: self-managed database with a public IP address
  • Express: self-managed database that is connected over Express Connect, VPN Gateway, or Smart Access Gateway
  • dg: self-managed database that is connected over Database Gateway
  • cen: self-managed database that is connected over Cloud Enterprise Network (CEN)
  • MongoDB: ApsaraDB for MongoDB instance
  • POLARDB: PolarDB for MySQL cluster or PolarDB for PostgreSQL cluster
  • PolarDB_o: PolarDB O Edition cluster
RegionId String No cn-hangzhou

The ID of the region where the data migration instance resides. For more information, see List of supported regions.

Note The region ID of the data migration instance is the same as that of the destination database.
SourceEndpoint.InstanceID String No rm-bp1i99e8l7913****

The ID of the instance that hosts the source database.

Note
  • You must specify the instance ID only if the SourceEndpoint.InstanceType parameter is set to RDS, ECS, Express, MongoDB, POLARDB, or PolarDB_o. For example, if the SourceEndpoint.InstanceType parameter is set to ECS, you must specify the ID of the ECS instance.
  • If the SourceEndpoint.InstanceType parameter is set to Express, you must specify the ID of the virtual private cloud (VPC).
SourceEndpoint.EngineName String No MySQL

The engine type of the source database. Valid values: MySQL, TiDB, SQLServer, PostgreSQL, Oracle, MongoDB, Redis, POLARDB, and polardb_pg.

Note You must specify the engine type only if the DestinationEndpoint.InstanceType parameter is set to RDS, POLARDB, ECS, LocalInstance, or Express.
SourceEndpoint.Region String No cn-hangzhou

The region ID of the source database.

Note If the SourceEndpoint.InstanceType parameter is set to LocalInstance, you can enter cn-hangzhou or the ID of the region closest to the self-managed database. For more information, see List of supported regions.
SourceEndpoint.IP String No 172.16.88.***

The endpoint of the source database.

Note You must specify the endpoint only if the SourceEndpoint.InstanceType parameter is set to LocalInstance or Express.
SourceEndpoint.Port String No 3306

The service port number of the source database.

Note You must specify the service port number only if the SourceEndpoint.InstanceType parameter is set to ECS, LocalInstance, or Express.
SourceEndpoint.OracleSID String No testsid

The system ID (SID) of the Oracle database.

Note You must specify this parameter only if the SourceEndpoint.EngineName parameter is set to Oracle and the Oracle database is deployed in a non-RAC architecture.
SourceEndpoint.DatabaseName String No dtstestdatabase

The name of the source database or the authentication database.

Note
  • You must specify the database name only if the SourceEndpoint.EngineName parameter is set to PostgreSQL or MongoDB.
  • If the SourceEndpoint.EngineName parameter is set to PostgreSQL, specify the name of the source database. If the SourceEndpoint.EngineName parameter is set to MongoDB, specify the name of the authentication database.
SourceEndpoint.UserName String No dtstestaccount

The database account of the source database.

Note The permissions that are required for database accounts vary with the migration scenario. For more information, see Overview of data migration scenarios.
SourceEndpoint.Password String No Test123456

The password of the source database account.

SourceEndpoint.OwnerID String No 140692647406****

The ID of the Alibaba Cloud account to which the source instance belongs.

Note You must specify this parameter only when you configure data migration across different Alibaba Cloud accounts.
SourceEndpoint.Role String No ram-for-dts

The authorized RAM role of the source instance. You must specify the RAM role only if the source instance and the destination instance belong to different Alibaba Cloud accounts. You can use the RAM role to allow the Alibaba Cloud account that owns the destination instance to access the source instance.

Note For information about the permissions and authorization methods of the RAM role, see Configure RAM authorization for cross-account data migration and synchronization.
DestinationEndpoint.InstanceID String No rm-bp1r46452ai50****

The ID of the instance that hosts the destination database.

Note You must specify the instance ID only if the DestinationEndpoint.InstanceType parameter is set to RDS, ECS, MongoDB, Redis, DRDS, PetaData, OceanBase, POLARDB, PolarDB_o, AnalyticDB, or Greenplum. For example, if the DestinationEndpoint.InstanceType parameter is set to ECS, you must specify the ID of the ECS instance.
DestinationEndpoint.EngineName String No MySQL

The engine type of the destination database. Valid values: MySQL, DRDS, SQLServer, PostgreSQL, PPAS, MongoDB, Redis, POLARDB, and polardb_pg.

Note You must specify the engine type only if the DestinationEndpoint.InstanceType parameter is set to RDS, POLARDB, ECS, LocalInstance, or Express.
DestinationEndpoint.Region String No cn-hangzhou

The region ID of the destination database.

Note If the DestinationEndpoint.InstanceType parameter is set to LocalInstance, you can enter cn-hangzhou or the ID of the region closest to the self-managed database. For more information, see List of supported regions.
DestinationEndpoint.IP String No 172.16.88.***

The endpoint of the destination database.

Note You must specify the endpoint only if the DestinationEndpoint.InstanceType parameter is set to LocalInstance or Express.
DestinationEndpoint.Port String No 3306

The service port number of the destination database.

Note You must specify the service port number only if the DestinationEndpoint.InstanceType parameter is set to ECS, LocalInstance, or Express.
DestinationEndpoint.DataBaseName String No dtstestdatabase

The name of the destination database or the authentication database.

Note
  • You must specify the database name only if the DestinationEndpoint.EngineName parameter is set to PostgreSQL, DRDS, or MongoDB.
  • If the DestinationEndpoint.EngineName parameter is set to PostgreSQL or DRDS, specify the name of the destination database. If the DestinationEndpoint.EngineName parameter is set to MongoDB, specify the name of the authentication database.
DestinationEndpoint.UserName String No dtstestaccount

The database account of the destination database.

Note The permissions that are required for database accounts vary with the migration scenario. For more information, see Overview of data migration scenarios.
DestinationEndpoint.Password String No Test123456

The password of the destination database account.

MigrationReserved String No { "autoStartModulesAfterConfig": "none", "targetTableMode": 2 }

The reserved parameter of DTS. The value is a JSON string. You can specify this parameter to meet special requirements, for example, whether to automatically start a precheck. For more information, see MigrationReserved.

Checkpoint String No 111

The start offset of incremental data migration. The value is a UNIX timestamp. Unit: seconds.

AccountId String No 12323344****

The ID of the Alibaba Cloud account. You do not need to specify this parameter because this parameter will be removed in the future.

DestinationEndpoint.OracleSID String No testsid

The SID of the Oracle database.

Note You must specify this parameter only if the DestinationEndpoint.EngineName parameter is set to Oracle and the Oracle database is deployed in a non-RAC architecture.

Response parameters

Parameter Type Example Description
ErrCode String InternalError

The error code returned if the call failed.

ErrMessage String The request processing has failed due to some unknown error.

The error message returned if the call failed.

RequestId String 40E35BD9-002E-4D63-9BE5-FBA48833****

The ID of the request.

Success String true

Indicates whether the call was successful.

Examples

Sample requests

http(s)://dts.aliyuncs.com/?Action=ConfigureMigrationJob
&DestinationEndpoint.InstanceType=RDS
&MigrationJobId=dtsl3m1213ye7l****
&MigrationJobName=MySQL_TO_RDS
&MigrationMode.DataIntialization=true
&MigrationMode.DataSynchronization=true
&MigrationMode.StructureIntialization=true
&MigrationObject=[{"DBName":"dtstestdata","TableIncludes":[{"TableName":"customer"}]}]
&SourceEndpoint.InstanceType=RDS
&<Common request parameters>

Sample success responses

XML format

<ConfigureMigrationJobResponse>
      <RequestId>40E35BD9-002E-4D63-9BE5-FBA48833****</RequestId>
      <Success>true</Success>
</ConfigureMigrationJobResponse>

JSON format

{
    "RequestId": "40E35BD9-002E-4D63-9BE5-FBA48833****",
    "Success": true
}

Error codes

For a list of error codes, visit the API Error Center.