Configures a data synchronization task.

Before you call this operation, you must call the CreateSynchronizationJob operation to create a data synchronization instance.

Note
  • After you call this operation to configure a data synchronization task, the task will be automatically started and prechecked. You do not need to call the StartSynchronizationJob operation to start the task.
  • A data synchronization task may fail to be started due to precheck failures. You can call the DescribeSynchronizationJobs operation to query the status of the task. Then, you can change parameter settings based on the error messages about precheck failures. After you fix the issue, you must call the StartSynchronizationJob operation to restart the data synchronization task.

Debugging

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

Request parameters

Parameter Type Required Example Description
Action String Yes ConfigureSynchronizationJob

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

DataInitialization Boolean Yes true

Specifies whether to perform initial full data synchronization. Valid values:

  • true: yes
  • false: no
Note Default value: true.
StructureInitialization Boolean Yes true

Specifies whether to perform initial schema synchronization. Valid values:

  • true: yes
  • false: no
Note Default value: true.
SynchronizationJobId String Yes dtsz4ao1dor13d****

The ID of the data synchronization instance. You can call the DescribeSynchronizationJobs operation to query the instance ID.

SynchronizationObjects String Yes [{"DBName":"dtstestdata","TableIncludes":[{"TableName":"customer"}]}]

The objects that you want to synchronize. The value is a JSON string and can contain regular expressions. For more information, see SynchronizationObjects.

RegionId String No cn-hangzhou

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

SynchronizationJobName String No MySQL Synchronization

The name of the data synchronization task.

Note We recommend that you specify an informative name for easy identification. You do not need to use a unique task name.
SynchronizationDirection String No Forward

The synchronization direction. Valid values:

  • Forward
  • Reverse
Note
  • Default value: Forward.
  • The value Reverse takes effect only if the topology of the data synchronization instance is two-way synchronization.
SourceEndpoint.InstanceId String No rm-bp1i99e8l7913****

The ID of the source instance.

SourceEndpoint.InstanceType String No RDS

The type of the source instance. Valid values:

  • RDS: ApsaraDB RDS instance
  • Redis: ApsaraDB for Redis instance
  • PolarDB: PolarDB for MySQL cluster or PolarDB-O cluster
  • ECS: self-managed database that is hosted on Elastic Compute Service (ECS)
  • Express: self-managed database that is connected over Express Connect
  • dg: self-managed database that is connected over Database Gateway
  • cen: self-managed database that is connected over Cloud Enterprise Network (CEN)
Note The default value is RDS.
SourceEndpoint.IP String No 172.16.88.***

The IP address of the source database.

Note You must specify this parameter only if the SourceEndpoint.InstanceType parameter is set to ECS, Express, dg, or cen.
SourceEndpoint.Port String No 3306

The service port number of the source database.

Note You must specify this parameter only if the SourceEndpoint.InstanceType parameter is set to ECS, Express, dg, or cen.
SourceEndpoint.UserName String No dtstestaccount

The database account of the source database.

Note
  • You must specify this parameter only if the SourceEndpoint.InstanceType parameter is set to ECS, Express, dg, or cen.
  • If the SourceEndpoint.InstanceType parameter is set to Redis, you do not need to specify the database account.
  • The permissions that are required for database accounts vary with the synchronization scenario. For more information, see Overview of data synchronization scenarios.
SourceEndpoint.Password String No Test123456

The password of the source database account.

Note You must specify this parameter only if the SourceEndpoint.InstanceType parameter is set to ECS, Express, dg, or cen.
DestinationEndpoint.InstanceId String No rm-bp1r46452ai50****

The ID of the destination instance.

Note If the DestinationEndpoint.InstanceType parameter is set to MaxCompute or DataHub, you must specify the name of the MaxCompute project or the DataHub project.

If the destination instance is an AnalyticDB for MySQL cluster, specify the ID of the AnalyticDB for MySQL cluster.

DestinationEndpoint.InstanceType String No RDS

The type of the destination instance. Valid values:

  • Redis: ApsaraDB for Redis instance
  • RDS: ApsaraDB RDS instance
  • PolarDB: PolarDB for MySQL cluster or PolarDB-O cluster
  • ECS: self-managed database that is hosted on ECS
  • Express: self-managed database that is connected over Express Connect
  • DataHub: DataHub project
  • MaxCompute: MaxCompute project
  • AnalyticDB: AnalyticDB for MySQL V2.0 cluster
  • AnalyticDB30: AnalyticDB for MySQL V3.0 cluster
  • Greenplum: AnalyticDB for PostgreSQL instance
Note The default value is RDS.
DestinationEndpoint.IP String No 172.16.88.***

The IP address of the destination database.

Note You must specify this parameter only if the DestinationEndpoint.InstanceType parameter is set to Express, dg, or cen.
DestinationEndpoint.Port String No 3306

The service port number of the destination database.

Note You must specify this parameter only if the DestinationEndpoint.InstanceType parameter is set to ECS, Express, dg, or cen.
DestinationEndpoint.UserName String No dtstestaccount

The database account of the destination database.

Note
  • The permissions that are required for database accounts vary with the synchronization scenario. For more information, see Overview of data synchronization scenarios.
  • If the DestinationEndpoint.InstanceType parameter is set to ECS, Express, dg, or cen, you must specify the DestinationEndpoint.UserName parameter.
  • If the DestinationEndpoint.InstanceType parameter is set to RDS and the database version is MySQL 5.5 or MySQL 5.6, you do not need to specify the DestinationEndpoint.UserName and DestinationEndpoint.Password parameters.
  • If the DestinationEndpoint.InstanceType parameter is set to Redis, you do not need to specify the DestinationEndpoint.UserName parameter.
DestinationEndpoint.Password String No Test654321

The password of the destination database account.

Note
  • If the DestinationEndpoint.InstanceType parameter is set to ECS, Express, dg, or cen, you must specify the DestinationEndpoint.Password parameter.
SourceEndpoint.OwnerID String No 140692647406****

The ID of the Alibaba Cloud account that owns the source RDS instance.

Note You can specify this parameter to synchronize data across different Alibaba Cloud accounts. In this case, you also need to specify the SourceEndpoint.Role parameter.
SourceEndpoint.Role String No ram-for-dts

The name of the RAM role configured for the Alibaba Cloud account that owns the source instance.

Note You must specify this parameter when you synchronize data across different Alibaba Cloud accounts. For information about the permissions and authorization methods of the RAM role, see Configure RAM authorization for cross-account data migration and synchronization.
PartitionKey.ModifyTime_Year Boolean No true

Specifies whether the incremental data table contains partitions defined by the modifytime_year field. Valid values: true and false.

Note This parameter is available only if the DestinationEndpoint.InstanceType parameter is set to Maxcompute.
PartitionKey.ModifyTime_Month Boolean No true

Specifies whether the incremental data table contains partitions defined by the modifytime_month field. Valid values: true and false.

Note This parameter is available only if the DestinationEndpoint.InstanceType parameter is set to Maxcompute.
PartitionKey.ModifyTime_Day Boolean No true

Specifies whether the incremental data table contains partitions defined by the modifytime_day field. Valid values: true and false.

Note This parameter is available only if the DestinationEndpoint.InstanceType parameter is set to Maxcompute.
PartitionKey.ModifyTime_Hour Boolean No true

Specifies whether the incremental data table contains partitions defined by the modifytime_hour field. Valid values: true and false.

Note This parameter is available only if the DestinationEndpoint.InstanceType parameter is set to Maxcompute.
PartitionKey.ModifyTime_Minute Boolean No true

Specifies whether the incremental data table contains partitions defined by the modifytime_minute field. Valid values: true and false.

Note This parameter is available only if the DestinationEndpoint.InstanceType parameter is set to Maxcompute.
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 1610540493

The synchronization checkpoint.

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.

SourceEndpoint.DatabaseName String No dtstestdata

The name of the database to which the synchronization object in the source instance belongs.

DestinationEndpoint.DataBaseName String No dtstestdata

The name of the database to which the synchronization object in the destination instance belongs.

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 2690E467-7773-43BC-A009-370EE2E7****

The ID of the request.

Success String true

Indicates whether the call was successful.

Examples

Sample requests

http(s)://dts.aliyuncs.com/?Action=ConfigureSynchronizationJob
&DataInitialization=true
&StructureInitialization=true
&SynchronizationJobId=dtsz4ao1dor13d****
&SynchronizationObjects=[{"DBName":"dtstestdata","TableIncludes":[{"TableName":"customer"}]}]
&<Common request parameters>

Sample responses

XML format

<ConfigureSynchronizationJobResponse>
      <RequestId>2690E467-7773-43BC-A009-370EE2E7****</RequestId>
      <Success>true</Success>
</ConfigureSynchronizationJobResponse>

JSON format

{
    "RequestId": "2690E467-7773-43BC-A009-370EE2E7****",
    "Success": true
}

Error codes

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