tencent cloud

Synchronization Guidance
Last updated:2025-04-30 18:29:39
Synchronization Guidance
Last updated: 2025-04-30 18:29:39

Overview

This document introduces the process of synchronizing PostgreSQL data to TencentDB for PostgreSQL using Data Transfer Service (DTS).

Preparations

1. Read carefully instructions to understand feature constraints and precautions.
2. According to the access type you need to use, connect DTS and the database in advance. For details, see Network Preparation Work.
Self-hosted IDC database/database from other cloud vendors: The access methods available include "Public Network/Direct Connect/VPN Access/Cloud Connect Network".
When migrating a public network instance, please ensure that the source instance service is accessible in the public network environment, and maintain the stability of the public network connection. Fluctuations or failures in the network can cause migration failure. Once the migration fails, you need to reinitiate the migration task.
Self-built Database on CVM: Select "self-built on CVM" as the access method.
Tencent Cloud database instance: Select "CloudDB" as the access method.
3. The account that executes the DTS synchronization task must have the permissions of the source database: Event Trigger, Replication, CREATE, DROP, ALTER, SELECT, UPDATE, INSERT, DELETE.
4. The account that executes the DTS synchronization task must have the permissions of the target database: CREATE, DROP, ALTER, SELECT, UPDATE, INSERT, DELETE.

Operation Steps

1. Log in to data synchronization purchase page, select the corresponding configuration, and click Buy Now.
Parameter
Description
Billing Mode
Support annual and monthly subscription and pay-as-you-go.
Source instance type
Select PostgreSQL. It cannot be modified after purchase.
Source instance region
Select the source instance location. It cannot be modified after purchase.
Types of target instances
Select PostgreSQL. It cannot be modified after purchase.
Target instance region
Select the target instance location. It cannot be modified after purchase.
Specification
Select specifications according to business requirements. The higher the specifications, the better the performance. For details, see Billing Overview.
2. After purchase completion, return to Data Sync List. You can see the newly created data sync task. The newly created sync task needs to be configured before use.
3. In the data synchronization list, click Configure in the Operation column to enter the synchronization task configuration page.

4. On the synchronization task configuration page, configure the source instance, account and password, configure the target instance, account and password. After testing connectivity, click Next.

Due to the considerable intersect scenarios between the source database deployment form and access type, the sync operation steps in each scenario are similar. The following only provides configuration examples of typical scenarios. For other scenarios, users can refer to the configuration.
Example one: Synchronize the locally self-built database to the tencent cloud database via dedicated line/VPN.
Settings
Parameter
Description
Task Settings
Task Name
DTS will automatically generate a task name. Users can set it according to the actual situation.
Running Mode
Support two modes: immediate execution and scheduled execution.
Source Instance Setting
Source instance type
The source instance type selected at the time of purchase cannot be modified.
Source instance region
The source instance location selected at the time of purchase cannot be modified.
Access type
Based on your scenario selection, this scenario chooses "Direct Connect" or "VPN Access". This scenario requires configuring interconnectivity between VPN and IDC. For preparation work of other access types, refer to Preparation Overview.
Public network: The source database can be accessed through a public IP address.
Self-built cloud host: The source database is deployed on Tencent Cloud CVM.
Dedicated line access: The source database can be connected to the Tencent Cloud private network through Dedicated Line Access.
VPN access: The source database can be connected to the Tencent Cloud private network through VPN Connections.
Cloud database: The source database belongs to a Tencent Cloud database instance.
CCN: The source database can be connected to the Tencent Cloud private network through CCN.
VPC Direct Connect gateway/VPN gateway
Direct connect only supports VPC direct connect gateway. Please confirm the gateway associated network type. For VPN gateway, please select the VPN gateway instance that accesses via VPN gateway.
Virtual Private Cloud (VPC)
Select the Virtual Private Cloud (VPC) and subnet associated with the VPC Direct Connect gateway and VPN gateway.
Host address
Source instance access IP address or domain name.
Port
Source instance access port.
Account
Source instance account and account permission should meet the requirements.
Password
The password of the source instance account.
Target instance settings
Types of target instances
The type of target instance selected when purchased cannot be modified.
Target instance region
The target instance region selected when purchased cannot be modified.
Access type
Based on your scenario selection, this scenario selects "CloudDB".
Instance ID
Select the target instance ID.
Account
Target instance account and account permission should meet the requirements.
Password
The password of the target instance account.
Example II: Synchronize the tencent cloud database to the tencent cloud database.
Settings
Parameter
Description
Task Settings
Task Name
DTS will automatically generate a task name. Users can set it according to the actual situation.
Running Mode
Support two modes: immediate execution and scheduled execution.
Source Instance Setting
Source instance type
The source instance type selected at the time of purchase cannot be modified.
Source instance region
The source instance location selected at the time of purchase cannot be modified.
Access type
For this scenario, select "TencentDB". For preparation work for different access types, refer to Preparation Overview.
Public network: The source database can be accessed through a public IP address.
Self-built cloud host: The source database is deployed on Tencent Cloud CVM.
Direct Connect: The source database can be connected to the Tencent Cloud private network through Direct Connect.
VPN access: The source database can be connected to the Tencent Cloud private network through VPN Connections.
Cloud database: The source database belongs to a Tencent Cloud database instance.
CCN: The source database can be connected to the Tencent Cloud private network through CCN.
Instance ID
The ID of the source instance.
Account
Source instance account and account permission should meet the requirements.
Password
The password of the source instance account.
Target instance settings
Types of target instances
The type of target instance selected when purchased cannot be modified.
Target instance region
The target instance region selected when purchased cannot be modified.
Access type
Based on your scenario selection, this scenario selects "CloudDB".
Instance ID
Select the target instance ID.
Account
Target instance account and account permission should meet the requirements.
Password
The password of the target instance account.
Example III: Synchronize PostgreSQL from a third-party cloud vendor to the tencent cloud database through the public network.
Settings
Parameter
Description
Task Settings
Task Name
DTS will automatically generate a task name. Users can set it according to the actual situation.
Running Mode
Support two modes: immediate execution and scheduled execution.
Automatic Retry
After configuration, if the migration task is temporarily interrupted due to network exceptions, DTS will automatically retry and recover the task within the set time. No manual intervention is required.
The configurable time range is 5 - 720 minutes.
Source Instance Setting
Source instance type
The source instance type selected at the time of purchase cannot be modified.
Source instance region
The source instance location selected at the time of purchase cannot be modified.
Access type
For third-party cloud vendor databases, you can generally choose the public network method, or choose VPN access, direct connect, or CCN. You need to choose according to the actual network conditions.
This scenario selects "public network". For preparation work for different access types, refer to Overview of Preparation Work.
Public network: The source database can be accessed through a public IP address.
Self-built cloud host: The source database is deployed on Tencent Cloud CVM.
Dedicated line access: The source database can be connected to the Tencent Cloud private network through Dedicated Line Access.
VPN access: The source database can be connected to the Tencent Cloud private network through VPN Connections.
Cloud database: The source database belongs to a Tencent Cloud database instance.
CCN: The source database can be connected to the Tencent Cloud private network through CCN.
Host address
Source instance access IP address or domain name.
Port
Source instance port.
Account
Source instance account and account permission should meet the requirements.
Password
The password of the source instance account.
Target instance settings
Types of target instances
The type of target instance selected when purchased cannot be modified.
Target instance region
The target instance region selected when purchased cannot be modified.
Access type
Based on your scenario selection, this scenario selects "CloudDB".
Instance ID
Select the target instance ID.
Account
Target instance account and account permission should meet the requirements.
Password
The password of the target instance account.
5. On the Synchronization Options and Objects page, settings can be done for data initialization options, data synchronization option, and synchronization object options. After the settings are completed, click Save and Next.
Notes:
When only full data initialization is selected for initialization type, the system, by default, assumes that the user has already created the table structure in the target database. No table structure synchronization will be performed, nor will it verify whether there are tables with the same name in the source and target databases. Therefore, when the user selects pre-validation and error reporting in existing homonymous tables at the same time, the validation and error reporting feature does not take effect.
If the user determines that a rename operation will be performed on a certain table during the sync process (for example, renaming table A to table B), then synchronization object needs to select the entire database (or entire instance) where table A resides, rather than just selecting table A. Otherwise, after the rename operation, the data of table B will not be synchronized to the target database.

Settings
Parameter
Description
Data Initialization Option
Initialization Type
Table structure initialization: During synchronous task execution, the table structure in the source instance will be initialized to the target instance first.
Full data initialization: During synchronous task execution, the data in the source instance will be initialized to the target instance first. In scenarios where only full data initialization is selected, users need to create the table structure in the target database in advance.
Both are selected by default and can be canceled based on the actual situation.
Existing homonymous table
Pre-validation and error reporting: If a table with the same name exists, an error will be reported and the process will no longer continue.
Ignore and continue execution: Add full data and incremental data directly to the table of the target instance.
Data Sync Option
Conflict Resolution Mechanism
Conflict Error: When a primary key conflict is detected during synchronization, an error will be reported and the data sync task will be suspended.
Conflict ignored: When a primary key conflict is detected during synchronization, retain the primary key record in the target database.
Conflict overwrite: When a primary key conflict is detected during synchronization, overwrite the primary key record in the target database with the primary key record in the source database.
Sync operation type
Support operations: Insert, Update, Delete, DDL. DDL customization is not supported currently.
Synchronization object options
Source instance database and table objects
Select objects to be synchronized. Basic tables and views are supported. Only SEQUENCE is supported for advanced objects.
6. On the task verification page, after completing verification and passing all verification items, click Start Task.
7. If the validation task fails, refer to handling method for validation failure to fix issues and re-initiate the validation task.
Failure: Indicate that a check item fails, task blocking, need to fix the problem and run the verification again.
Warning: Indicate that the inspection item check is not fully compliant. The task can be continued, but it has an impact on the business. Assess based on the prompt whether to ignore the warning or fix the problem and continue.
Note:
When performing plug-in detection in the pre-verification stage, after reporting an alarm for the first mismatched plug-in, continue detection of the remaining plug-ins no longer.

8. Return to the data synchronization task list. The task starts and enters the Running status.
Note:
Select More > Finish in the Operation column to close the sync task. Please make sure data synchronization is complete before closing the task.

9. (Optional) You can click Task Name to go to task details page and view task initialization status and monitoring data.
Was this page helpful?
You can also Contact Sales or Submit a Ticket for help.
Yes
No

Feedback