tencent cloud

Synchronization Instructions
Last updated:2025-12-03 10:43:49
Synchronization Instructions
Last updated: 2025-12-03 10:43:49

Scenarios

This document provides the instructions for using the data synchronization feature of Data Transfer Service (DTS) to synchronize data from SQL Server to TencentDB for SQL Server.

Preparations

1. Read the Usage Instructions carefully to learn about feature constraints and must-knows.
2. Establish the access channel between DTS and the database in advance according to the access type you want to use. For details, see Network Preparations.
IDC self-built databases: The access method can be set to Public Network, Direct Connect (DC), VPN Access, and Cloud Connect Network (CCN).
Self-built databases on Cloud Virtual Machine (CVM) instances: The access method can be set to Self-Built on CVM.
Databases of third-party cloud vendors: The access method can be set to Public Network, DC, VPN Access, and CCN.
Tencent Cloud database instances: The access method can be set to Cloud Database.
3. The source database must be set to the "full recovery mode", and it is recommended that users perform a full backup before synchronization.
4. The local disk space of the source database should be large, with enough remaining free space to accommodate the size of the database to be synchronized.

Environment Requirements

Note:
The system will automatically perform checks on the following environment requirements before starting the synchronization task and report errors if the requirements are not met. If users can identify the issues, they can refer to Pre-check Failure Handling to fix the issues. If not, the users should wait for the system check to complete and follow the error prompts to perform modifications.
Type
Environment Requirement
Source database requirements
The networks between the source and target databases can be connected.
The server where the source database is located is required to have sufficient outbound bandwidth; otherwise, the migration speed is affected.
Target database requirements
The version number of the target instance cannot be earlier than that of the source instance.
The target database cannot contain any database with the same name as the source database.
The disk space of the target database should be larger than the size of the source database, at least 1.5 times the source database size.
It is not recommended to write data to the target database during synchronization, as this may cause synchronization task exceptions.

Synchronization Operations

1. Log in to the DTS console, choose Data Synchronization in the left-side bar, and then click Create Synchronization Task to go to the synchronization task creation page.
2. On the synchronization task creation page, select the source instance type and region as well as the target instance type, region, and specification for synchronization, and then click Buy Now.
Parameter
Description
Service Type
Select data synchronization.
Creation Mode
New task: Create a task.
Create a similar task: Quickly create a task with the same configuration as the historical task. The default pre-filled options, such as the database type and billing mode, of the new task are consistent with those of the historical task. Users can also modify them as needed.
Billing Mode
The yearly/monthly subscription and pay-as-you-go modes are supported.
Source Instance Type
Select SQL Server. It cannot be modified after purchase.
Source Instance Region
Select the source instance region. It cannot be modified after purchase.
Target Instance Type
Select SQL Server. Currently, only the synchronization link from SQL Server to SQL Server is supported.
Specification
The default value is Medium.
Tag
Set tag keys and values for synchronization tasks to facilitate efficient management of multiple tasks through tags.
Task Name
Set it to Name the Task After Creation. The task name is the same as the task ID by default. After the synchronization task is created, the task name can be reset.
Set it to Name Now. Enter the task name in the input box below.
Agreement Terms
Make sure to check "I have read and agree to the Cloud Database Service Terms".
3. After the purchase is completed, return to the data synchronization task list to see the newly created data synchronization task. It requires configuration before usage.
4. In the data synchronization task list, click Configure in the operation column to go to the synchronization task configuration page.

5. On the synchronization source and target database settings page, enter the information such as the source and target databases, and then click Test Connectivity. After connectivity testing, click Next.

Parameter
Description
Task Name
A task name is automatically generated by DTS. It is recommended that users modify it to a meaningful name to facilitate task identification.
Running Mode
Immediate execution: The task will be started immediately once the pre-check passes.
Scheduled execution: Set a start time for the task execution. After the pre-check passes, the task is not started immediately, but is started at the scheduled time.
Automatic Retry
When it is enabled, if a synchronization task is temporarily interrupted due to network exceptions or other issues, DTS will automatically retry and resume the task within the specified time range without requiring manual intervention from users.
The supported time range for automatic retries is 5–720 minutes.
Source Instance Type
Source instance type selected during purchase. It cannot be modified.
Source Instance Region
Source instance region selected during purchase. It cannot be modified.
Service Provider
Select the access type according to your scenario. Set it to Cloud Database for this scenario. For preparations related to different access types, see Preparation Overview.
Cross-Account
Intra account: The Tencent Cloud root account for both the source and target database instances is the same.
Cross-account: The Tencent Cloud root accounts for the source and target database instances are different. For guidance on cross-account synchronization operations, see Synchronization Between Cross-Account Cloud Database Instances.
Instance ID
ID of the source instance.
Account
Source instance account. The account permissions should meet the requirements.
Password
Password of the source instance account.
Target Instance Type
Target instance type selected during purchase. It cannot be modified.
Target Instance Region
Target instance region selected during purchase. It cannot be modified.
Access Type
Select the access type based on your scenario. Set it to Cloud Database for this scenario.
Instance ID
Target Instance ID.
Account
Target instance account. The account permissions should meet the requirements.
Password
Password of the target instance account.
6. On the synchronization option and synchronization object settings page, complete the following configurations and click Save and Go Next.

Parameter
Description
Initialization Type
Structure initialization: When a synchronization task is executed, the data of the source instance is initialized to the target instance first.
Full data initialization: When a synchronization task is executed, the data of the source instance is initialized to the target instance first.
By default, both options are checked and cannot be unchecked. Synchronization tasks include incremental data synchronization by default, which synchronizes the incremental data generated from the source database to the target database in real time. If incremental synchronization is not required, use data migration instead.
Existing Tables with the Same Name
The default option is pre-check and error reporting. If tables with the same name exist, an error will be reported, and the process will be stopped.
Primary Key Conflict Handling
The default option is to report a conflict error, indicating that if a primary key conflict is detected during synchronization, the system will report an error and pause the data synchronization task.
DML
Currently, only data manipulation language (DML) operations are supported for synchronization. The operations that are checked by default include Insert, Update, and Delete. These operations can be unchecked, but at least one operation should be checked.
Synchronization Object
The default option is the specified objects, indicating that all tables and views of the source database are synchronized. Additionally, objects of the type selected under Advanced Migration Objects will be synchronized.
Advanced Migration Object
In addition to tables and views, select objects to be synchronized, such as procedures, functions, custom data types, and plan guides. Replication of advanced objects is a one-time operation; newly created advanced objects will not be synchronized after the task is started. Check the source databases to be synchronized in the source database list and add them to the list of selected objects on the right.
Transfer Rate Limit
It is enabled by default. Once enabled, it allows you to control the transfer rate of data synchronization and can be disabled.
Number of Concurrent Threads for Full Export of the Source Database
The full export phase consists of two steps: chunk calculation and chunk export. To reduce the total time of the full export phase, you can appropriately increase the number of threads. Note: Increasing the number of threads will increase the load on the source database. The value range for the parameter is 1–16.
Source Database Full Export RPS
0 Counts/s indicates no limit, and 50 million Counts/s is the maximum input limit. The actual export speed depends on various factors such as source or target database load and network conditions.
Number of Concurrent Threads for Full Import of the Target Database
Increasing the number of concurrent threads for import can improve the full write speed to the target database. The value range for this parameter is 1–16.
Target Database Full Import RPS
0 Counts/s indicates no limit, and 50 million Counts/s is the maximum input limit. The actual import speed depends on various factors such as source or target database load and network conditions.
7. On the consistency check settings page, check Enable data consistency verification, configure the parameters, and then click Next.

Parameter
Description
Check Content
The default option is full check, which indicates that all data in the source and target databases is compared when a check task is initiated.
Check Benchmark
The default option is the source, which indicates that data from the source is used as the check benchmark.
Thread Number Selection
The value range is 1–8. Select an appropriate value according to the actual situation.
Increasing the number of threads can accelerate the consistency check speed, but it will also increase the load on the source and target databases. Please adjust the number with caution. Each additional thread approximately increases CPU usage by one core.
The data consistency check may increase the load on the source database instance. It is recommended to perform operations during off-peak hours.
Number of Rechecks
Set the number of rechecks. If the first full data check result is inconsistent, the background will recheck the inconsistent data in the full check. The value range is 1–2.
Recheck Interval
Set the recheck interval in the unit of minutes. The value range is 1–10.
Check Object
All synchronization objects: The check scope includes all objects selected for the synchronization task.
Custom selection: Select specific objects from the selected synchronization objects for checking.
Note:
If table renaming was performed during the initial link configuration, it is required to check individual table objects in turn for check instead of checking the entire database when the check objects are selected. Otherwise, tables that were previously renamed will be skipped during the check.
The consistency check object configuration will automatically apply the database and table renaming and where condition filtering policies of the selected objects; it is not required to configure these repeatedly on the current page.
8. On the check task page, click Immediate start after the check is completed, and all check items are passed.
If the check task fails, you can see Pre-check Failure Handling to fix the issue and reinitiate a check task.
Failed: indicates that a check item fails and the task is blocked. Fix the issue and execute the check task again.
Warning: indicates that a check item does not completely meet the requirements, and the task can be continued, but the business may be affected. Users are required to assess whether to ignore the warning or fix the issue before continuing to execute the task based on the prompt.
Note:
Clicking Start Now may increase the load on both the source and target database instances. Perform this operation during off-peak hours.
Do not change the source or target database passwords after Start Now is clicked.
Do not perform data definition language (DDL) operations on the source database during the process.
Do not disconnect the network or switch the source database during the process.
9. Return to the data synchronization task list, and the task status is changed to Running.
Note:
Choose More > End in the operation column to disable the synchronization task. Ensure that data synchronization is completed before disabling the task.
10. (Optional) You can click the task name to go to the task details page and view the task initialization status and monitoring data.

Business Migration Description After Data Synchronization

Note:
The current data synchronization capability only supports one-time or short-term data synchronization.
When the data synchronization feature of DTS is used to synchronize data from SQL Server to TencentDB for SQL Server, as long as the synchronization task is not completed and is in the incremental synchronization phase, both the source and target databases will remain in the incremental synchronization status. To ensure that issues such as data loss and inconsistency do not occur between the two ends during business migration to the target database, DTS provides a data consistency check feature for data synchronization. This feature employs the static data consistency check to help users verify data consistency and facilitate a smoother business migration. For instructions on how to perform a data consistency check, see Creating a Data Consistency Check Task. For preparation suggestions and descriptions related to business migration during data synchronization, see the following descriptions:
1. Business write operations stopped: Stop all business write operations on the source instance and wait for the data synchronization between the source and target databases is completed.
2. Source account permissions revoked and source connections cleared: Ensure that data in the source database can no longer be modified to prevent data inconsistency caused by incomplete synchronization during the traffic switch.
3. After write operations are stopped on the source database and data synchronization between the source and target databases is completed, check that the latency is 0 seconds and the data difference is 0 KB.
4. Data consistency check: Perform a data consistency check to ensure the data between the source and target databases is consistent. If the business migration time is short, perform a row number check on key business data or a full check on critical tables (note that a full check may take a long time when there is a large data volume).
5. Business verification of target database data through read operations: The business can verify a portion of the read traffic in the target database.
6. After data consistency between the source and target databases is confirmed, end the data synchronization task.

Related Operation Description

Configuring a Data Synchronization Metric Alarm

Before data synchronization is performed, task running metrics can be monitored through configuring a data synchronization metric alarm to promptly observe task running status, such as excessively high task incremental synchronization delay or excessively large delayed data volume.

Configuring an Event Alarm Notification

Before data synchronization is performed, task running status can be monitored through configuring an event alarm notification to promptly receive notifications on exceptions such as task interruption.
Was this page helpful?
You can also Contact Sales or Submit a Ticket for help.
Yes
No

Feedback