tencent cloud

Data Transfer Service

Release Notes and Announcements
Release Notes
Announcements
Product Introduction
Overview
Data Migration
Data Sync
Data Subscription (Kafka Edition)
Strengths
Supported Regions
Specification Description
Purchase Guide
Billing Overview
Configuration Change Description
Payment Overdue
Refund
Getting Started
Data Migration Guide
Data Sync Guide
Data Subscription Guide (Kafka Edition)
Preparations
Business Evaluation
Network Preparation
Adding DTS IP Addresses to the Allowlist of the Corresponding Databases
DTS Service Permission Preparation
Database and Permission Preparation
Configuring Binlog in Self-Built MySQL
Data Migration
Databases Supported by Data Migration
Cross-Account TencentDB Instance Migration
Migration to MySQL Series
Migrating to PostgreSQL
Migrating to MongoDB
Migrating to SQL Server
Migrating to Tencent Cloud Distributed Cache
Task Management
Data Sync
Databases Supported by Data Sync
Cross-Account TencentDB Instance Sync
Sync to MySQL series
Synchronize to PostgreSQL
Synchronization to MongoDB
Synchronize to Kafka
Task Management
Data Subscription (Kafka Edition)
Databases Supported by Data Subscription
MySQL series Data Subscription
Data Subscription for TDSQL PostgreSQL
MongoDB Data Subscription
Task Management
Consumption Management
Fix for Verification Failure
Check Item Overview
Cutover Description
Monitoring and Alarms
Supported Monitoring Indicators
Supported Events
Configuring Metric Alarms and Event Alarms via the Console
Configuring Indicator Monitoring and Event Alarm by APIs
Ops Management
Configuring Maintenance Time
Task Status Change Description
Practical Tutorial
Synchronizing Local Database to the Cloud
Creating Two-Way Sync Data Structure
Creating Many-to-One Sync Data Structure
Creating Multi-Site Active-Active IDC Architecture
Selecting Data Sync Conflict Resolution Policy
Using CLB as Proxy for Cross-Account Database Migration
Migrating Self-Built Databases to Tencent Cloud Databases via CCN
Best Practices for DTS Performance Tuning
FAQs
Data Migration
Data Sync
FAQs for Data Subscription Kafka Edition
Regular Expressions for Subscription
Error Handling
Common Errors
Failed Connectivity Test
Failed or Alarmed Check Item
Inability to Select Subnet During CCN Access
Slow or Stuck Migration
Data Sync Delay
High Data Subscription Delay
Data Consumption Exception
API Documentation
History
Introduction
API Category
Making API Requests
(NewDTS) Data Migration APIs
Data Sync APIs
Data Consistency Check APIs
(NewDTS) Data Subscription APIs
Data Types
Error Codes
DTS API 2018-03-30
Service Agreement
Service Level Agreements

CreateMigrateJob

PDF
フォーカスモード
フォントサイズ
最終更新日: 2025-10-28 22:21:01

1. API Description

Domain name for API request: dts.intl.tencentcloudapi.com.

This API (CreateMigrateJob) is used to create a data migration task.

For a finance zone linkage, please use the domain name dts.ap-shenzhen-fsi.tencentcloudapi.com.

A maximum of 20 requests can be initiated per second for this API.

We recommend you to use API Explorer
Try it
API Explorer provides a range of capabilities, including online call, signature authentication, SDK code generation, and API quick search. It enables you to view the request, response, and auto-generated examples.

2. Input Parameters

The following request parameter list only provides API request parameters and some common parameters. For the complete common parameter list, see Common Request Parameters.

Parameter Name Required Type Description
Action Yes String Common Params. The value used for this API: CreateMigrateJob.
Version Yes String Common Params. The value used for this API: 2018-03-30.
Region Yes String Common Params. For more information, please see the list of regions supported by the product.
JobName Yes String Data migration task name
MigrateOption Yes MigrateOption Migration task configuration options
SrcDatabaseType Yes String Source instance database type, which currently supports MySQL, Redis, MongoDB, PostgreSQL, MariaDB, Percona, and SQL Server. For more information on the supported types in a specific region, see the migration task creation page in the console.
SrcAccessType Yes String Source instance access type. Valid values: extranet (public network), cvm (CVM-based self-created instance), dcg (Direct Connect-enabled instance), vpncloud (Tencent Cloud VPN-enabled instance), cdb (TencentDB instance), ccn (CCN instance)
SrcInfo Yes SrcInfo Source instance information, which is correlated with the migration task type
DstDatabaseType Yes String Target instance access type, which currently supports MySQL, Redis, MongoDB, PostgreSQL, MariaDB, and Percona, SQL Server, and TDSQL-C for MySQL. For more information on the supported types in a specific region, see the migration task creation page in the console.
DstAccessType Yes String Target instance access type, which currently only supports cdb (TencentDB instance)
DstInfo Yes DstInfo Destination instance information
DatabaseInfo No String Information of the source table to be migrated, which is described in JSON string format. It is required if MigrateOption.MigrateObject is 2 (migrating the specified table).
For databases with a database-table structure:
[{"Database":"db1","Table":["table1","table2"]},{"Database":"db2"}]
For databases with a database-schema-table structure:
[{"Database":"db1","Schema":"s1","Table":["table1","table2"]},{"Database":"db1","Schema":"s2","Table":["table1","table2"]},{"Database":"db2","Schema":"s1","Table":["table1","table2"]},{"Database":"db3"},{"Database":"db4","Schema":"s1"}]
Tags.N No Array of TagItem Tag of the instance to be migrated.
SrcNodeType No String Source instance type. simple: Primary/Secondary node; cluster: Cluster node. If this field is left empty, the value defaults to primary/secondary node.
SrcInfoMulti.N No Array of SrcInfo Source instance information, which is correlated with the migration task type.

3. Output Parameters

Parameter Name Type Description
JobId String Data migration task ID
RequestId String The unique request ID, generated by the server, will be returned for every request (if the request fails to reach the server for other reasons, the request will not obtain a RequestId). RequestId is required for locating a problem.

4. Example

Example1 Creating a data migration task over Direct Connect

This example shows you how to fully and incrementally migrate a Direct Connect-enabled MySQL instance in Guangzhou to the instance cdb-d0dqi8nv in Shanghai.

Input Example

POST / HTTP/1.1
Host: dts.intl.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: CreateMigrateJob
<Common request parameters>

{
    "JobName": "Set an identifiable name",
    "SrcDatabaseType": "mysql",
    "SrcAccessType": "dcg",
    "SrcInfo": {
        "Supplier": "others",
        "UniqDcgId": "dcg-cyrjcc09",
        "VpcId": "vpc-72jblfaa",
        "SubnetId": "subnet-7raec42a",
        "Ip": "192.168.120.136",
        "Region": "ap-guangzhou",
        "User": "root",
        "Password": "yourPassword",
        "Port": 3306
    },
    "DstDatabaseType": "mysql",
    "DstAccessType": "cdb",
    "DstInfo": {
        "InstanceId": "cdb-d0dqi8nv",
        "Region": "ap-shanghai",
        "ReadOnly": 0,
        "User": "root",
        "Password": "yourPassword"
    },
    "DatabaseInfo": "[{\"Database\":\"test\",\"Table\":[\"user\",\"log\"]}]",
    "Tags": [
        {
            "TagKey": "Owner",
            "TagValue": "bob"
        }
    ],
    "MigrateOption": {
        "ExternParams": "{}",
        "MigrateObject": 1,
        "RunMode": 1,
        "ExpectTime": "2020-09-22 00:00:00",
        "ConsistencyType": 2,
        "MigrateType": 2,
        "IsOverrideRoot": 0
    }
}

Output Example

{
    "Response": {
        "JobId": "dts-o3s1vxsp",
        "RequestId": "915bc42a-714f-4faa-915b-a51cc09f5714"
    }
}

Example2 Creating a database migration task

This example shows you how to perform structural migration of selected tables from one MySQL instance to another MySQL instance on Tencent Cloud without performing data consistency check.

Input Example

POST / HTTP/1.1
Host: dts.intl.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: CreateMigrateJob
<Common request parameters>

{
    "JobName": "Set an identifiable name",
    "SrcDatabaseType": "mysql",
    "SrcAccessType": "cdb",
    "SrcInfo": {
        "Supplier": "others",
        "InstanceId": "cdb-ieow93923",
        "User": "root",
        "Password": "yourPassword"
    },
    "DstDatabaseType": "mysql",
    "DstAccessType": "cdb",
    "DstInfo": {
        "InstanceId": "cdb-e78e0nnv",
        "Region": "ap-shanghai",
        "ReadOnly": 0,
        "User": "root",
        "Password": "yourPassword"
    },
    "DatabaseInfo": "[]",
    "Tags": [
        {
            "TagKey": "Owner",
            "TagValue": "bob"
        }
    ],
    "MigrateOption": {
        "ExternParams": "{}",
        "MigrateObject": 1,
        "RunMode": 1,
        "ExpectTime": "2020-09-22 00:00:00",
        "ConsistencyType": 5,
        "MigrateType": 2,
        "IsOverrideRoot": 0
    }
}

Output Example

{
    "Response": {
        "JobId": "dts-46i7easd",
        "RequestId": "bc94c57b-9d69-11e9-84cb-256e968056b0"
    }
}

Example3 Creating a data migration task over public network

This example shows you how to fully migrate the data from a public network MySQL instance in Guangzhou to the instance cdb-e78e0nnv in Shanghai and perform a full data consistency check.

Input Example

POST / HTTP/1.1
Host: dts.intl.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: CreateMigrateJob
<Common request parameters>

{
    "JobName": "Set an identifiable name",
    "SrcDatabaseType": "mysql",
    "SrcAccessType": "extranet",
    "SrcInfo": {
        "Supplier": "others",
        "Ip": "14.17.22.36",
        "Region": "ap-guangzhou",
        "User": "root",
        "Password": "yourPassword",
        "Port": 3306
    },
    "DstDatabaseType": "mysql",
    "DstAccessType": "cdb",
    "DstInfo": {
        "InstanceId": "cdb-e78e0nnv",
        "Region": "ap-shanghai",
        "ReadOnly": 0,
        "User": "root",
        "Password": "yourPassword"
    },
    "DatabaseInfo": "[]",
    "Tags": [
        {
            "TagKey": "Owner",
            "TagValue": "bob"
        }
    ],
    "MigrateOption": {
        "ExternParams": "{}",
        "MigrateObject": 1,
        "RunMode": 1,
        "ExpectTime": "2020-09-22 00:00:00",
        "ConsistencyType": 2,
        "MigrateType": 2,
        "IsOverrideRoot": 0
    }
}

Output Example

{
    "Response": {
        "JobId": "dts-1kl0iy0v",
        "RequestId": "2201c42a-714f-4faa-915b-a51cc09f5cec"
    }
}

5. Developer Resources

SDK

TencentCloud API 3.0 integrates SDKs that support various programming languages to make it easier for you to call APIs.

Command Line Interface

6. Error Code

The following only lists the error codes related to the API business logic. For other error codes, see Common Error Codes.

Error Code Description
AuthFailure.UnauthorizedOperationError The current user is not allowed to perform this operation as the authentication failed.
FailedOperation.NotAllowOperation This operation is prohibited.
InternalError.DatabaseError Failed to access the database on the DTS platform.
InternalError.DuplicateJob Migration tasks are in conflict.
InternalError.InternalErrorError An internal error occurred.
InternalError.InternalHttpServerError An HTTP access request error occurred.
InternalError.InternalInnerCommonError An error occurred while accessing the internal component.
InternalError.ProtocolError A communication protocol error occurred.
InternalError.UnknownError An unknown internal error occurred.
InvalidParameter The parameter is incorrect.
InvalidParameter.BizInvalidParameterValueError Parameter value error.
InvalidParameter.InvalidParameterError The parameter is invalid.
InvalidParameterValue.BizInvalidParameterValueError Invalid business parameters.
InvalidParameterValue.DataConvertError A data conversion error occurred.
InvalidParameterValue.InvalidParameterValueError The parameter is invalid.
LimitExceeded.MaxUnusedJobs The number of idle migration tasks exceeds the limit.
OperationDenied The operation was denied.
OperationDenied.NotEnoughMoneyError The account balance is insufficient.
OperationDenied.OperationDeniedError The operation was denied.
UnauthorizedOperation.NotEnoughPrivileges Authentication failed as there were no required permissions.

ヘルプとサポート

この記事はお役に立ちましたか?

フィードバック