This topic describes how to use Alibaba Cloud DTS to perform a one-time full migration of data from a TencentDB for Redis instance to an Alibaba Cloud ApsaraDB for Tair (Redis-compatible) instance. For security reasons, major cloud providers disable the SYNC and PSYNC commands by default. The incremental migration feature of DTS relies on these commands to capture real-time changes from the source database. Therefore, this solution supports only full migration by default. To enable incremental migration, request permission from your source cloud provider to use the SYNC and PSYNC commands.
Migration workflow
The migration process has four main stages:
Preparation: Confirm prerequisites and understand the considerations, costs, and permission requirements.
Environment setup: Configure public network access for the source instance.
DTS configuration and execution: Create, configure, start, and monitor the DTS migration task on Alibaba Cloud.
Post-migration tasks: After the migration, perform a business cutover, security hardening, and resource cleanup.
Before you begin
Prerequisites
You must have an ApsaraDB for Tair (Redis-compatible) instance. To create one, see Create an instance.
NoteWe recommend that the storage capacity of the ApsaraDB for Tair (Redis-compatible) instance be at least 10% larger than the storage space used by the TencentDB for Redis instance. If the storage capacity of the created ApsaraDB for Tair (Redis-compatible) instance is too low, you must upgrade its storage capacity. For more information, see Change instance specifications.
Ensure the TencentDB for Redis instance allows public network access.
Usage notes
Because incremental migration is not supported, you must stop services related to the TencentDB for Redis instance before the migration begins. To ensure data consistency, do not write new data to the TencentDB for Redis database during the full migration.
During a full migration, DTS consumes a certain amount of resources from both the source and destination databases, which may increase the database server load. High database workloads or low server specifications can increase server load and risk service interruptions. We recommend assessing the impact and performing the migration during off-peak hours.
DTS automatically retries failed migration tasks. Before switching your business to the destination instance, end or release the migration task. This prevents the task from being automatically resumed, which could cause data from the source to overwrite data in the destination instance.
DTS uses concurrent writes, which may cause the storage space used by the destination database to be 5% to 10% larger than that of the source database.
Billing
Migration type | Link configuration fee | Public network traffic |
Full data migration | Free of charge. | Charges apply only when migrating data out of Alibaba Cloud over the public network. For more information, see DTS Billing Items. |
Incremental data migration | Charged. For more information, see DTS Billing Items. |
Supported commands for incremental migration
Incremental migration supports the following Redis commands:
APPEND
BITOP, BLPOP, BRPOP, BRPOPLPUSH
DECR, DECRBY, DEL
EVAL, EVALSHA, EXEC, EXPIRE, EXPIREAT
FLUSHALL, FLUSHDB
GEOADD, GETSET
HDEL, HINCRBY, HINCRBYFLOAT, HMSET, HSET, HSETNX
INCR, INCRBY, INCRBYFLOAT
LINSERT, LPOP, LPUSH, LPUSHX, LREM, LSET, LTRIM
MOVE, MSET, MSETNX, MULTI
PERSIST, PEXPIRE, PEXPIREAT, PFADD, PFMERGE, PSETEX, PUBLISH
RENAME, RENAMENX, RESTORE, RPOP, RPOPLPUSH, RPUSH, RPUSHX
SADD, SDIFFSTORE, SELECT, SET, SETBIT, SETEX, SETNX, SETRANGE, SINTERSTORE, SMOVE, SPOP, SREM, SUNIONSTORE
ZADD, ZINCRBY, ZINTERSTORE, ZREM, ZREMRANGEBYLEX, ZUNIONSTORE, ZREMRANGEBYRANK, ZREMRANGEBYSCORE
XADD, XCLAIM, XDEL, XAUTOCLAIM, XGROUP CREATECONSUMER, XTRIM
Prepare the environment
By default, TencentDB for Redis provides only private network access. You must enable public access to obtain a public endpoint.
Log on to the Tencent Cloud instance list console and click the ID of the source instance.
On the Instance Details page, in the Network Information section, find the Public Address row and click Enable.

After the operation is complete, note the public endpoint in the Network Information section of the instance. You will need this endpoint for the DTS configuration.
In the top navigation bar, click the Security group tab. In the Joined security groups list, click the target Security Group ID.
On the Inbound rules tab of the Security group rules page, click Add Rule.
In the Add inbound rule dialog box, allow access to the TencentDB for Redis port 6379 from the internet.
Important0.0.0.0/0allows access from all IP addresses and poses a security risk. Use with caution.We recommend that you add the DTS server IP addresses, which are provided in the authorization dialog box in a later step, as the source to adhere to the principle of least privilege.
Configure and run the DTS task
Log on to the DTS console.
In the left-side navigation pane, click Data Migration.
In the top navigation bar, select the region where the migration task resides.
-
Click Create Task to navigate to the task configuration page.
Configure the source and destination databases.
WarningAfter you select the source and destination instances, we recommend that you carefully read the limits displayed at the top of the page. Otherwise, the task may fail or data inconsistency may occur.
Category
Parameter
Description
N/A
Task Name
DTS automatically generates a task name. We recommend that you specify a descriptive name for easy identification. The name does not need to be unique.
Source Database
Database Type
Select Tair/Redis.
Access Method
Select Public IP Address.
Instance Region
Select the region where the TencentDB for Redis instance is located.
NoteIf the region of your TencentDB for Redis instance is not listed, you can select the region that is geographically closest to it.
Instance Mode
Standalone
Domain Name or IP
Enter the public IP address of the source TencentDB for Redis instance.
Port Number
Enter the public port of the source TencentDB for Redis instance.
Authentication Method
Select the authentication method based on your configuration. In this example, select Password Login.
Database Password
Enter the password for the TencentDB for Redis instance.
Encryption
Select Non-encrypted.
Destination Database
Database Type
Select Tair/Redis.
Access Method
Select Alibaba Cloud Instance.
Instance Region
Select the region where the destination ApsaraDB for Tair (Redis-compatible) instance is located.
Replicate Data Across Alibaba Cloud Accounts
No
Instance Type
Normal Instance
Instance ID
Select the ID of the destination ApsaraDB for Tair (Redis-compatible) instance.
Authentication Method
Select the authentication method based on your configuration. In this example, select Password Login.
Database Password
Enter the password for the database account.
Encryption
Select Non-encrypted.
After completing the settings, click Test Connectivity and Proceed.
Copy the DTS server IP addresses from the CIDR Blocks of DTS Servers dialog box and add them to the allowlist of the source database. Then, click Confirm authorization and test link.
WarningAdding the public IP address blocks of DTS servers, whether automatically or manually, may introduce security risks. Using this product, you acknowledge and accept these potential risks. You must implement basic security measures, such as using strong passwords, limiting open ports for each CIDR block, using authentication for internal API calls, and regularly checking and restricting unnecessary CIDR blocks. You can also connect using an internal network, such as a leased line, VPN Gateway, or Smart Access Gateway.
Configure the task objects.
On the Configure Objects page, configure the objects that you want to migrate.
Parameter
Description
Migration Types
If the
SYNCandPSYNCpermissions are not enabled, select full migration based on theSCANcommand. Incremental migration is not supported.If the
SYNCandPSYNCpermissions are enabled, select the full migration method based on thePSYNCcommand. This method supports incremental migration.
Processing Mode of Conflicting Tables
Precheck and Report Errors: Checks if the destination database contains collections with the same names. If a collection with a duplicate name is found, an error is reported during the precheck phase and the data synchronization task does not start. Otherwise, the precheck is successful.
NoteIf you cannot delete or rename the collection with the same name in the destination database, you can use the object name mapping feature to change the collection name in the destination database. For more information, see Set the name of a synchronization object in the destination instance.
Ignore Errors and Proceed: Skips checking for collections with the same name in the destination database.
WarningSelecting Ignore Errors and Proceed may cause data inconsistency and put your business at risk. For example:
If a record in the destination database has the same primary key or unique key value as a record in the source database, the record in the destination database is retained. The record from the source database is not synchronized to the destination database.
Data initialization may fail, only some data may be synchronized, or the synchronization may fail.
Source Objects
In the Source Objects box, click the objects, and then click
to move them to the Selected Objects box.Selected Objects
To set the name of a synchronization object in the destination instance, right-click the object in the Selected Objects box to modify it. For more information, see Database Table Column Name Mapping.
To remove a synchronization object, click it in the Selected Objects box, and then click
to move it to the Source Objects box.
NoteIf you use the object name mapping feature, the migration of other objects that depend on the mapped object may fail.
To set a WHERE condition to filter data, right-click the object to migrate in the Selected Objects section and set the filter conditions in the dialog box that appears. For more information, see Configure filter conditions.
Click Next: Advanced Settings to configure advanced parameters.
Parameter
Description
Retry Time for Failed Connections
After the migration task starts, if the connection to the source or destination database fails, DTS reports an error and immediately begins to retry the connection. The default retry duration is 720 minutes. You can customize the retry time to a value from 10 to 1440 minutes. We recommend that you set the duration to more than 30 minutes. If DTS reconnects to the source and destination databases within the specified duration, the migration task automatically resumes. Otherwise, the task fails.
Note-
For multiple DTS instances that share the same source or destination, the network retry time is determined by the setting of the last created task.
-
Because you are charged for the task during the connection retry period, we recommend that you customize the retry time based on your business needs, or release the DTS instance as soon as possible after the source and destination database instances are released.
Retry Time for Other Issues
After the migration task starts, if a non-connectivity issue, such as a DDL or DML execution exception, occurs in the source or destination database, DTS reports an error and immediately begins to retry the operation. The default retry duration is 10 minutes. You can customize the retry time to a value from 1 to 1440 minutes. We recommend that you set the duration to more than 10 minutes. If the related operations succeed within the specified retry duration, the migration task automatically resumes. Otherwise, the task fails.
ImportantThe value of Retry Time for Other Issues must be less than the value of Retry Time for Failed Connections.
Enable Throttling for Full Data Migration
During full migration, DTS consumes read and write resources on the source and destination databases, which may increase the database load. If required, you can enable throttling for the full migration task. You can set Queries per second (QPS) to the source database, RPS of Full Data Migration, and Data migration speed for full migration (MB/s) to reduce the load on the destination database.
Note-
This configuration item is available only if you select Full Data Migration for Migration Types.
-
You can also adjust the full migration speed after the migration instance is running.
Environment Tag
You can select an environment tag to identify the instance based on your business needs. This setting is optional for this example.
Configure ETL
Based on your business needs, select whether to configure the ETL feature to process data.
-
Yes: Configures the ETL feature. You must also enter data processing statements in the text box.
-
No: Does not configure the ETL feature.
Monitoring and Alerting
Select whether to set alerts and receive alert notifications based on your business needs.
-
No: Does not set an alert.
-
Yes: Configure alerts by setting an alert threshold and an alert contact. If a migration fails or the latency exceeds the threshold, the system sends an alert notification.
-
Click Data Verification to configure the data validation task. If you need to use the data validation feature, see Configure Data Validation.
ImportantIn the Full calibration reference configuration:
If the destination database already contains other data, select Source Database as the validation baseline.
If the destination database is empty (contains no other data), you can select the Default option.
-
Save the task and run a precheck.
-
To view the parameters for configuring this instance when you call the API operation, move the pointer over the Next: Save Task Settings and Precheck button and click Preview OpenAPI parameters in the bubble that appears.
-
If you do not need to view or have finished viewing the API parameters, click Next: Save Task Settings and Precheck at the bottom of the page.
Note-
Before the migration task starts, DTS performs a precheck. The task starts only after it passes the precheck.
-
If the precheck fails, click View Details next to the failed check item, fix the issue based on the prompt, and then run the precheck again.
-
If a warning is reported during the precheck:
-
For check items that cannot be ignored, click View Details next to the failed item, fix the issue based on the prompt, and then run the precheck again.
-
For check items that can be ignored, you can click Confirm Alert Details, Ignore, OK, and Precheck Again to skip the alert item and run the precheck again. If you choose to ignore a warning, it may cause issues such as data inconsistency and pose risks to your business.
-
-
-
When the Success Rate is 100%, click Next: Purchase Instance.
Purchase the DTS instance.
-
On the Purchase page, select the link specification for the data migration instance. For more information, see the following table.
Category
Parameter
Description
New Instance Class
Resource Group Settings
Select the resource group to which the instance belongs. The default value is default resource group. For more information, see What is Resource Management?
Instance Class
DTS provides migration specifications with different performance levels. The link specification affects the migration speed. You can select a specification based on your business scenario. For more information, see Data migration link specifications.
-
After the configuration is complete, read and select Data Transmission Service (Pay-as-you-go) Service Terms.
-
Click Buy and Start. In the OK dialog box that appears, click OK.
You can view the progress of the migration task on the Data Migration Tasks list page.
Note-
If the migration task does not include incremental migration, it stops automatically after the full migration is complete. After the task stops, its Status changes to Completed.
-
If the migration task includes incremental migration, it does not stop automatically. The incremental migration task continues to run. While the incremental migration task is running, the Status of the task is Running.
-
-
Monitor the task and perform the switchover
After the task starts, you will see the task in the Data Migration Tasks list.
Click the task ID to go to the details page. In the left navigation bar, click Task Management to view the task progress.
The task status progresses through the following stages: Full Data Migration -> Back Facing Module -> Full Data Verification.
The completion of the Full Data Verification indicates that the data in the source and destination databases is synchronized. At this point, you can schedule a service downtime window to switch the application connection to the ApsaraDB for Tair (Redis-compatible) instance.

Follow-up operations
Validate services: Verify that your business functions normally on the new ApsaraDB for Tair (Redis-compatible) instance.
Harden security: Change the passwords for the source and destination databases to ensure data security.
Clean up resources: If the public network resources created on Tencent Cloud for the migration are no longer needed, release them.