tencent cloud

Data Transfer Service

Migration Instructions

Baixar
Modo Foco
Tamanho da Fonte
Última atualização: 2026-11-30 10:19:39
Traduzido e Verificado por IA

Operation Scenes

DTS-based data migration supports full + incremental data migration, allowing both the historical data in the source database before the migration and any new data written during the migration process to be migrated together.
This document describes how to use the DTS data migration feature to migrate data from Redis to Tencent Cloud Distributed Cache.

Preparations

1. Establish the access channel between DTS and the database in advance according to the type of access you need. For detailed instructions, see Network Preparations.
IDC self-built databases/Databases from other cloud providers: The available access methods include Public Network/Direct Connect/VPN Access/CCN.
When public network instances are migrated, ensure that the source instance is accessible over the public network and that the connection remains stable. Network fluctuations or failures can cause the migration to fail, and if that happens, you need to restart the migration task.
Self-built databases on Cloud Virtual Machine (CVM) instances: The access method can be set to Self-Built on CVM.
TencentDB Instance: Select Database as the access method.
2. Pre-Migration Check
You should check and make sure that the following items are passed before the migration; otherwise, the migration may fail.
2.1 Big keys in the source database
They may cause the buffer (client-output-buffer-limit) to overflow during the migration, leading to a migration failure.
For TencentDB, use the diagnostic optimization feature of DBbrain to quickly analyze large keys. For detailed directions, see Memory Analysis (Large Key Analysis).
For databases not provided by Tencent Cloud, use rdbtools to analyze large keys in Redis.
Evaluate large keys for splitting or cleaning. If you need to retain them, set the source buffer size (client-output-buffer-limit) to infinite.
config set client-output-buffer-limit 'slave 0 0 0'
2.2 Limit on the number of TCP connections in the source Linux kernel
If the number of concurrent business requests is high, check the limit on the number of connections in the Linux kernel before the migration. If this value is exceeded, the Linux server will actively disconnect from DTS.
echo "net.ipv4.tcp_max_syn_backlog=4096" >> /etc/sysctl.conf
echo "net.core.somaxconn=4096" >> /etc/sysctl.conf
echo "net.ipv4.tcp_abort_on_overflow=0" >> /etc/sysctl.conf
sysctl -p
2.3 Access permission of the source RDB file directory
Before the migration, check and make sure that the directory where RDB files are stored in the source database is readable; otherwise, the migration will fail.
If the directory containing RDB files is unreadable, run the following command on the source to enable diskless replication, sending the RDB files directly to DTS for persistence without saving them to the source disk first.
config set repl-diskless-sync yes
2.4 (Optional) For scenes involving migration from a standard architecture to a cluster architecture, check for command compatibility issues. For detailed static and dynamic evaluations, see Standard Architecture to Cluster Architecture Migration Check.

Directions

Step 1:

1. Log in to DTS console, select Data Migration page, then on the right side click Create Migration Task.
2. On the new migration task page, select the task creation parameters, and then click Buy Now.
Configuration Parameter
Description
Service Type
Select Data Migration.
Creation Mode
Create a task: Create a completely new task.
Create a similar task: Quickly create a task with the same configuration as that of a previous task. The new task's pre-filled options such as database type, access method, billing mode, and migration type are consistent with that of the historical task. Users can modify the settings if needed.
Billing Mode
Only pay-as-you-go is supported.
Source Instance Type
Select the source database type, which cannot be changed after purchase. Here, select Distributed Cache.
Source Instance Region
Select the source database region. If the source database is a self-built one, select a region nearest to it.
Target Instance Type
Select the target database type, which cannot be changed after purchase. Here, select Distributed Cache.
Target Instance Region
Select the target database region.
Version
Currently, only NewDTS is supported.
Specification
Select specifications according to your business requirements. Higher specifications deliver better performance. For details, see Billing Overview.
Tag
Set tag keys and values for the migration task to efficiently manage multiple tasks using tags.
Task Name
Select Name After Creation: The default task name will be the same as the task ID. You can rename the task after the migration task is created.
Select Name Now: Enter the task name in the input box below.
Terms of service
Make sure to check "I have read and agree to the Cloud Database Service Terms".
Quantity
You can purchase up to 10 migration tasks at a time.
3. After the purchase is completed, the page will automatically redirect to the Data Migration Task List.

Step 2:

1. In the Data Migration Task List, find the task you just created, and click Configure in the Operation column.
2. Go to the Set source and target databases tab, fill in the source and target database information,and then click Test Connectivity. Once the test passes, click Save to proceed to the next step.
Task Configuration
Configuration Parameter
Description
Task Name
Set a task name that is easy to identify.
Running Mode
Immediate execution: The task will start immediately after the pre-check validation passes.
Scheduled execution: Set a specific time for the task to start. The task will not start immediately after the pre-check validation passes; instead, it will start at the scheduled time.
Automatic Retry
If it is selected, the migration task will automatically retry within the specified time range in case of task interruptions caused by network exceptions or similar issues. No manual intervention is required. The retry mechanism restarts the data migration from the beginning. During the retry process, any data that was previously migrated to the target end will either be cleared or overwritten.
Source Database Settings
Configuration Parameter
Description
Source Database Type
The source database type selected during purchase, which cannot be changed.
Service Provider
If the source database is a self-built database on IDC or CVM, or a TencentDB database, select "Others".
If the source database is an Alibaba Cloud database, Huawei Cloud, etc., select "Others".
If the source database is an AWS database, select AWS. Currently, only AWS ElasticCache for Redis is supported; other AWS Redis databases are not supported. Depending on whether the PSYNC command is prefixed, there are different selections.
For the PSYNC command with a prefix, select AWS.
For the PSYNC command without a prefix, select Others.
Region
The region selected for the source database at the time of purchase cannot be modified.
Access Type
Select the network type through which the source database connects to Tencent Cloud. Different access types require different network connectivity operations. For details, see Network Preparation Overview.
If the source database is an IDC self-built database or a database from another cloud providers, the access methods available include Public Network/Direct Connect/VPN Access/CCN.
Public Network: The source database can be accessed through a public IP.
Direct Connect: The source database can be interconnected with VPCs through Direct Connect.
VPN Access: The source database can be interconnected with VPCs through VPN Access.
CCN: The source database can be interconnected with VPCs through CCN.
If the source database is a self-built database on a CVM instance, select Self-Built on CVM as the access method.
If the source database is a TencentDB instance, select Database as the access method.
Node type
Access Type: This parameter is displayed when an access type other than"Database" is selected. Choose according to your specific situation.
Single-node migration: Refers to a cluster architecture with one primary node and multiple replicas.
Cluster migration: Refers to a cluster architecture consisting of multiple shards, with each shard having several replica nodes. When cluster migration is selected, you will need to fill in the Node Info.
Enter the addresses and passwords for all shard nodes in the source database cluster (IP:port: password or IP:port). For multiple nodes, enter each on a new line.
When the source database is AWS, you need to enter the PSYNC name (IP address:Port:PSYNC Name:Password or IP address:Port:PSYNC Name). The PSYNC name refers to the PSYNC command prefix, which must be requested from AWS. If the PSYNC command has no prefix, set the Service Provider parameter to "General" and migrate it as a general cluster.
It is recommended to use the replica nodes (secondary nodes) of the source database. Migrating from the replica nodes can help avoid impacting the source database's business access.
Public Network
When Public Network is selected as the Access Type, the following parameters need to be configured.
Host Address: The IP address or domain name of the source database.
Port: The port used by the source database.
Password: The password for the migration account of the source database.
Self-Built on CVM
When Access Type is set to Self-Built on CVM, the following parameters are required to be configured.
CVM instance: The instance ID of the CVM.
Port: The port used by the source database.
Password: The password for the migration account of the source database.
Direct Connect
When Direct Connect is selected as the Access Type, the following parameters need to be configured.
VPC Direct Connect Gateway: Only VPC Direct Connect gateways are supported for Direct Connect. Ensure that the gateway is associated with the correct network type.
VPC: Select the VPC and subnet.
Host Address: The IP address of the source database.
Port: The port used by the source database.
Password: The password for the migration account of the source database.
VPN Access
When VPN Access is selected as the Access Type, the following parameters need to be configured.
VPN Gateway: Select the VPN gateway instance that connects to the source database network.
VPC: Select the VPC and subnet.
Host Address: The IP address of the source database.
Port: The port used by the source database.
Password: The password for the migration account of the source database.
Database
When Database is selected as the Access Type, the following parameters need to be configured.
Cross-account
Same account: The source database instance and the target database instance belong to the same Tencent Cloud account.
Cross-account: The source database and the target database instances belong to different Tencent Cloud accounts. For detailed instructions on cross-account operations, see Cross-Account Cloud Database Instance Migration.
Cloud Database Instance: Select the instance ID of the source database.
Password: Enter the account and password. For the default account, only the password.
Note:
Distributed Cache supports custom accounts. Enter the connection parameters for the custom account. The default delimiter is @, and the format is account@password (for example, user@password).
You can also change the delimiter to other characters in the Distributed Cache console (for example, user:password). DTS will stay consistent with Distributed Cache, so enter the credentials in the format of the delimiter you configured.
CCN
When the Access Type is set to CCN, the following parameters need to be configured.
When CCN is used for connection, it supports both same-account and cross-account CCN. Due to the complexity of network configurations, see Migrating Self-built Databases to TencentDB via CCN.
Host network environment: Select according to your actual situation.
If the source database is a TencentDB instance, select Tencent Cloud; if the source database is a self-built IDC database, select Self-built IDC; if the source database is from another cloud provider, select the corresponding network.
Host Address: The IP address of the source database host.
Port: The port used by the source database.
Password: The password for the migration account of the source database.
CCN instance account
My Account: The CCN resources and DTS belong to the same Tencent Cloud root account.
Other Account: The CCN resources and DTS belong to different Tencent Cloud root accounts.
VPC CCN : The name of the CCN instance.
VPC access: Select the VPC and subnet to access. The Access VPC refers to the VPC that connects to the DTS migration linkage within the CCN. Select a VPC other than the one to which the source database belongs from all the VPCs associated with the CCN.
VPC access region: The region of the source database selected at the time of task purchase should match the region of the VPC you are connecting to. If they do not match, DTS will automatically change the region of the source database selected during task purchase to match the VPC region.
Connection Method
Secure Sockets Layer (SSL) connection refers to the use of SSL to establish a secure connection between DTS and the database, encrypting the transfer link.
Enabling SSL secure connection may increase the connection response time of the database. Generally, Tencent Clouds private network linkage is relatively secure, and enabling SSL secure connection is not necessary. However, for scenarios using public network, DC, or other transmission methods where higher data security is required, enabling SSL secure connection is recommended. Ensure that SSL encryption is enabled in the database before selecting SSL secure connection.
Target Database Settings
The target database parameter settings are similar to those of the source database. Only the differences are described below.
Configuration Parameter
Description
Access Type
Select based on your scene. The configuration principles for different access types are similar to those for the source database.
Note:
Migration off the cloud is supported. When the source database access type is set to Cloud Database, the access type of the target database can be set to Public Network/Self-Built on CVM/DC/VPN Access/CCN.
Node type
This parameter appears when any Access Type other than "Database" is selected.
Select based on the actual situation of the target database. Supported options include Single-node Migration, Redis Cluster Migration, and Proxy Cluster Migration.

Step 3:

In the Set migration options and select migration objects tab, configure the parameters and then click Next.


Basic Options
Configuration Item
Description
Migration Type
The default is full + incremental migration and cannot be modified. Full + incremental migration means migrating the historical data of the source database before the migration and the new data written to the source database during the migration.
Migration Object
The default is to select the entire instance and cannot be modified.
Enable Key Filtering
Prefix filtering rules can be configured for multi-key commands. For details, see Key Prefix Filtering.
Target Database Writing Mode
Clear Target Instance: When the source database data is synchronized to the target database, the existing data in the target database will be cleared and then rewritten.
Overwrite: When the source database data is synchronized to the target database, the keys from the source database will overwrite the keys in the target database.
For the scenario of migrating data from the cloud to on-premises environments, if Overwrite is not selected in the DTS task configuration, the pre-check will fail when existing data is detected on the target database, and automatic retries will not be triggered.
Enable Target Database Read/Write
DTS or other services are allowed to write data to the target database. For Redis migration scenarios, enable read/write on the target database.
Automatic expiry of keys
1. When this option is selected, expired keys are automatically evicted from the target database, saving space. However, selecting this option may cause data inconsistency between the source and target databases. Proceed with caution.
2. Normally, the target is configured to automatically evict expired keys. To ensure data consistency between the source and target, if you do not select Automatic Eviction of Expired Keys in the DTS task configuration, expired keys on the target will not be evicted. After the DTS task ends, this configuration is reverted, and expired keys on the target database will be automatically evicted again.
3. For Redis migration scenarios, target database read/write must be enabled. If you need to migrate the SET NX command (which executes only when the key does not exist) from the source database, it is recommended to enable automatic eviction of expired keys. Otherwise, when DTS writes the SET NX command to the target database, the migration task may report an error due to the presence of expired keys on the target database.
Advanced Options
Configuration Item
Description
Limit Data Transfer Rate
This generally does not need to be set. However, if the DTS transfer rate is impacting the load on the target database, you can set a rate limit.
Number of shards in the target database: If the target database is a TencentDB instance, the number of shards is automatically retrieved and cannot be modified.
Traffic limit per shard in the target database: Enter the traffic limit per shard, with the setting range between 0-100 MB/s.
If the target instance has a cluster architecture, then the maximum traffic per second for a single instance = number of shards * If the target instance has a cluster architecture, the maximum traffic per second for the entire instance is calculated as: number of shards x traffic limit per shard (MB/s).

Step 4: Setting Consistency Checks

Data consistency check compares table data between the source and target databases through DTS during data synchronization, providing comparison results and inconsistency details to help users quickly verify synchronization results.
On the Set consistency check page, select Enable data consistency verification, configure the parameters, and then click Next.
Note:
If you do not need to enable data consistency check, do not select Enable Data Consistency Check and click Next.

check option
Configuration Item
Description
Verification Scope
Full check: Perform a record-by-record comparison of all object data selected for migration from the source database to ensure the integrity of migrated data.
Verification Benchmark
Source: Use data from the source as the check benchmark.
Verification Mode
Compare Key + Value: Checks whether all data is consistent.
Compare Keys only: Only checks the existence of Keys.
Compare Value length: Only checks whether the lengths of Values are the same.
Compare Value: For Keys with a length exceeding 1000, only the length is compared, not the content.
Verification Parameters
Configuration Item
Description
QPS verification
Set the queries per second (QPS) limit for the check task.
QPS is the upper limit for queries per second when a single shard is checked. A value of 0 indicates no limit.
Number of reviews
Set the number of rechecks.
If the first full data check result is inconsistent, the background will re-initiate a check of the inconsistent data identified during the full check.
Recheck time interval
Set the interval for rechecks.
Verified Object option
Configuration Item
Description
Check Object
All migration objects: The check scope includes all objects selected for the migration task.

Step 5: Checking and Starting the Task

1. On the Validation Task page, the system automatically performs a pre-check. After the pre-check passes, click Start Now to immediately initiate the data migration. If a scheduled execution time was set during task configuration, you may also select Start Later, and the task will start at the specified time.
Note:
If the validation fails, see Pre-Check Failure Handling.
Pre-check failure: indicates that check items do not pass, the task is blocked, and you need to resolve the issues and execute the check task again.
If the result is Warning, it indicates that the check items do not fully meet the requirements. The task can still proceed, but business operations may be affected. Users need to evaluate whether to ignore the warning or resolve the issue before continuing, based on the system prompt.
2. In the pop-up Start Migration Task dialog box, click OK.
3. Return to the data migration task list. The task enters the ready-to-run status. After running for 1 to 2 minutes, the data migration task will officially start.

Step 6: Ending the Task

1. If you need to view task progress details, delete the task, or perform other operations, click the corresponding button in the Operation column. For more details, see Task Management.
2. When the task status is Ready to complete, it indicates that the incremental synchronization is finished, and you can end the task. Click Complete in the Operation column to end the migration task.
It is recommended to end the task when the data difference between the target and source databases is 0 KB, and the time difference is 0 seconds.
Before ending the task, perform a data consistency check and confirm that the comparison results are consistent.
Note:
It is recommended to perform a full data check or a check of critical business data, with priority given to a complete check. For large data volumes, you can choose a sampling check based on business requirements.
If you need to perform a business cutover after the migration is completed, see Cutover Instructions.

Ajuda e Suporte

Esta página foi útil?

comentários