Use Data Transmission Service (DTS) to migrate a Tair (Redis OSS-compatible) instance from one Alibaba Cloud account to another, with support for both full and incremental migration to keep your services running throughout.
Prerequisites
Before you begin, make sure that:
-
A destination Tair (Redis OSS-compatible) instance exists. Its available storage space must exceed the used storage space on the source instance.
-
The source and destination instances run compatible Redis versions. Migration from a lower version to a higher version is supported. Migrating from a higher version to a lower version may cause compatibility issues.
-
For supported version combinations, see Overview of data migration scenarios.
How it works
Cross-account migration requires actions from two Alibaba Cloud accounts:
-
Source account owner: Log on to the Alibaba Cloud Management Console, create a RAM role, and grant the destination account permission to access the source Redis instance. See Configure RAM authorization for a cross-account task.
-
Destination account owner: Log on to the Alibaba Cloud Management Console and configure the DTS migration task (covered in the Procedure section below).
Billing
| Migration type | Instance configuration fee | Internet traffic fee |
|---|---|---|
| Full data migration | Free | Charged when the destination Access Method is Public IP Address. See Billing overview. |
| Incremental data migration | Charged. See Billing overview. |
Migration types
| Migration type | Description |
|---|---|
| Full migration | DTS copies all existing data from the source to the destination. |
| Incremental migration | After full migration completes, DTS continuously replicates new writes from the source to the destination. Use this to migrate without interrupting your applications. |
Run both together when possible. If the DTS account lacks SYNC/PSYNC permission on the source, run full migration only.
Usage notes
Review these constraints before starting migration.
Source database limits
-
Bandwidth requirement: The server hosting the source database must have sufficient outbound bandwidth. Otherwise, data migration speed will be affected.
-
Version 2.8 of Tair (Redis OSS-compatible) is not supported as a source.
-
If running full migration only (without incremental), stop writing to the source during migration to prevent data inconsistency.
-
When migrating from a Basic Edition source to a cluster-architecture destination, use only single-key operations. Multi-key commands that span slots return:
CROSSSLOT Keys in request don't hash to the same slot -
DTS inserts a key with the prefix
DTS_REDIS_TIMESTAMP_HEARTBEATinto the source to track update timestamps. If the source uses a cluster architecture, this key is inserted into every shard. The key is filtered during migration and expires after the task ends. -
If the source is a read-only instance or the DTS account lacks SETEX permission, reported latency may be inaccurate.
-
To improve migration stability, increase the
repl-backlog-sizeparameter inredis.conf. -
If the source is a Tair Enterprise Edition instance with Storage Medium set to Persistent Memory, set the
appendonlyparameter toyes. For details, see Procedure. -
If the source is a child instance of a Global Distributed Cache, DTS migrates only that child instance. Other child instances are not supported.
Other limits
-
Neither source nor destination supports Tair (Redis OSS-compatible) Enterprise Edition capacity storage instances.
-
If transparent data encryption (TDE) is enabled on either instance, DTS cannot perform the migration.
-
If the destination runs out of memory, the default eviction policy (
maxmemory-policy) isvolatile-lru, which can cause data inconsistency. To prevent silent data loss, set the destination eviction policy tonoeviction. Withnoeviction, write operations fail when memory is full and the task stops, but no data is silently removed. For policy details, see Introduction to Redis data eviction policies. -
If the destination instance uses a cluster architecture and any shard reaches its memory limit, or if the instance runs out of storage space, the DTS task fails with an out-of-memory (OOM) error.
-
Scaling operations (adding or removing shards), specification changes, or endpoint or port modifications on either instance during migration will interrupt the task. If this happens, clear all synchronized data from the destination and reconfigure the task.
-
After a failover event (including master/standby switchover) on the destination, data may be written only to memory without replication to the secondary, causing data loss.
-
If a migration instance includes both full and incremental tasks, restarting the instance may cause DTS to re-execute both tasks.
-
Restarting a migration instance may cause non-idempotent commands (such as
INCRBYorLPUSH) to execute repeatedly, leading to data inconsistency. -
For Lua scripts invoked via
EVALorEVALSHA, DTS cannot confirm successful execution during incremental migration. -
For List data structures, DTS does not flush existing destination data when using
psyncorsync, which may result in duplicate entries. -
If keys in the source have expiration policies, the key count visible in the destination (for example, via
INFO) may be lower than the source. Keys without expiration policies or unexpired keys are consistent between source and destination. -
When the Access Method is Public IP Address, Instance Mode does not support Cluster.
-
Run migration during off-peak hours. Full migration consumes read and write resources on both instances.
-
After full migration, destination storage space will be larger than the source due to concurrent INSERT operations.
-
DTS attempts to auto-recover failed tasks for up to seven days. Before switching traffic to the destination, stop or release the task, or revoke the DTS account's write permission using
REVOKEto prevent recovered tasks from overwriting destination data. -
If a TLS-encrypted Tair (Redis OSS-compatible) instance is involved, connect to DTS using SSL-encrypted (TLSv1.3 is not supported). Connecting with SSL-encrypted to an Alibaba Cloud Instance source is not currently supported.
-
If a task fails, DTS support staff will attempt to restore it within eight hours. Restoration may involve restarting the task or adjusting task parameters. Only DTS task parameters are modified—not database parameters. For adjustable parameters, see Modify instance parameters.
Special cases for self-managed Redis sources
When the source Access Method is not Alibaba Cloud Instance:
-
Master/standby switchover on the source causes task failure.
-
DTS calculates latency by comparing the last migrated record's timestamp with the current time. If the source has no DML activity for an extended period, the displayed latency may be inaccurate. Run a DML operation on the source to refresh latency. If migrating an entire database, use a heartbeat table that writes data every second.
-
Changes to the Redis endpoint during migration (for example, due to instance migration or master/standby switchover) may cause retries, delays, failures, or data inconsistency. Monitor the task status and reconfigure if abnormal behavior appears.
Commands supported for incremental migration
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
Preparations
Log on to the Alibaba Cloud Management Console using the source account. Create a RAM role and grant the destination account permission to access the source Redis instance. For instructions, see Configure RAM authorization for a cross-account task.
Complete this step before configuring the migration task below.
Procedure
The following steps use the destination account to configure the DTS migration task.
For a complete walkthrough of cross-account RAM setup, see Configure RAM authorization for a cross-account task.
Step 1: Open the migration task list
Log on using the destination account and navigate to the data migration task list using one of these methods:
From the DTS console
-
Log on to the Data Transmission Service (DTS) console.Data Transmission Service (DTS) console
-
In the left navigation pane, click Data Migration.
-
In the upper-left corner, select the region where the migration instance will be located.
From the DMS console
Steps may vary based on your DMS console mode and layout. For details, see Simple mode console and Customize the layout and style of the DMS console.
-
Log on to the Data Management (DMS) console.Data Management (DMS) console
-
In the top menu bar, choose .
-
To the right of Data Migration Tasks, select the region where the migration instance will be located.
Step 2: Create the task
Click Create Task to open the task configuration page.
Step 3: Configure source and destination databases
Read the limits displayed at the top of the configuration page carefully before selecting instances. Skipping this step may cause task failure or data inconsistency.
Configure parameters for both the source and destination databases:
Task name
| Parameter | Description |
|---|---|
| Task Name | DTS generates a name automatically. Specify a descriptive name for easy identification. The name does not need to be unique. |
Source database
| Parameter | Description |
|---|---|
| Select Existing Connection | Select a previously registered database instance from the list, or leave blank to configure manually. In the DMS console, this parameter is named Select a DMS database instance. |
| Database Type | Select Tair/Redis. |
| Access Method | Select Alibaba Cloud Instance. |
| Instance Region | Select the region where the source instance resides. |
| Replicate Data Across Alibaba Cloud Accounts | Select Yes. This enables the cross-account fields below. |
| Alibaba Cloud Account | Enter the ID of the Alibaba Cloud account that owns the source Tair (Redis OSS-compatible) instance. To get this ID, see Obtain the ID of the Alibaba Cloud account that owns the source database. |
| RAM Role Name | Enter the name of the RAM role you created in the source account, for example, ram-for-dts. To create this role, see Step 1: Create a RAM role. |
| Instance ID | Select the source instance ID. |
| Authentication Method | Select the authentication method. This example uses Password Login. Account + Password Login is available only for Redis 6.0 or later. For Secret-free login, enable password-free access first—see Enable password-free access over a VPC. |
| Database Password | Enter the source instance password. The account must have read permission. For custom accounts, use the format <account>:<password>, for example, testaccount:Test1234. Leave blank if no password is set. To reset a forgotten password, see Change or reset the password. |
| Encryption | Select Non-encrypted or SSL-encrypted. For self-managed Redis with SSL, also upload a CA Certificate and enter a CA Key. |
Destination database
| Parameter | Description |
|---|---|
| Select Existing Connection | Select a previously registered database instance from the list, or leave blank to configure manually. In the DMS console, this parameter is named Select a DMS database instance. |
| Database Type | Select Tair/Redis. |
| Access Method | Select Alibaba Cloud Instance. |
| Instance Region | Select the region where the destination instance resides. |
| Replicate Data Across Alibaba Cloud Accounts | Select No. The destination instance belongs to the current account. |
| Instance ID | Select the destination instance ID. |
| Authentication Method | Select the authentication method. This example uses Password Login. Account + Password Login is available only for Redis 6.0 or later. For Secret-free login, enable password-free access first—see Enable password-free access over a VPC. |
| Database Password | Enter the destination instance password. The account must have read and write permission. For custom accounts, use the format <account>:<password>, for example, testaccount:Test1234. To reset a forgotten password, see Change or reset the password. |
| Encryption | Select Non-encrypted or SSL-encrypted. For self-managed Redis with SSL, also upload a CA Certificate and enter a CA Key. |
Step 4: Test connectivity
Click Test Connectivity and Proceed at the bottom of the page.
Make sure the DTS service IP ranges are added to the security settings of both instances. See Add DTS server IP addresses to a whitelist.
If either instance is self-managed (Access Method is not Alibaba Cloud Instance), click Test Connectivity in the CIDR Blocks of DTS Servers dialog.
Step 5: Configure migration objects
On the Configure Objects page, set the following parameters:
| Parameter | Description |
|---|---|
| Migration Types | Select both Full Data Migration and Incremental Data Migration for zero-downtime migration. Select Full Data Migration only if the DTS account lacks SYNC/PSYNC permission on the source. |
| Processing Mode of Conflicting Tables | Precheck and Report Errors: The precheck verifies that the destination is empty. If not, the task does not start. Ignore Errors and Proceed: Skips the empty-destination check. If a key in the destination has the same name as a source key, the source data overwrites the destination. This may cause data loss—proceed with caution. |
| Source Objects | Click objects in the Source Objects box, then click |
| Selected Objects | To map databases (DB 0–255) or filter by key prefix, right-click a database in Selected Objects and configure in the Edit Schema dialog. See Schema mapping and Set filter conditions. |
Click Next Advanced Settings and configure the following:
| Parameter | Description |
|---|---|
| Dedicated Cluster for Task Scheduling | DTS uses a shared cluster by default. Purchase a dedicated cluster for more stable task execution. |
| Retry Time for Failed Connections | Default: 720 minutes. Range: 10–1,440 minutes. Set to at least 30 minutes. If DTS reconnects within this window, the task resumes automatically; otherwise the task fails. Note: You are charged during the retry period. |
| Retry Time for Other Issues | Default: 10 minutes. Range: 1–1,440 minutes. Set to at least 10 minutes. This value must be less than Retry Time for Failed Connections. |
| Enable Throttling for Full Data Migration | Limit read and write load during full migration by setting Queries per second (QPS) to the source database, RPS of Full Data Migration, and Data migration speed for full migration (MB/s). Available only when Full Data Migration is selected. |
| Enable Throttling for Incremental Data Migration | Limit load during incremental migration by setting RPS of Incremental Data Migration and Data migration speed for incremental migration (MB/s). Available only when Incremental Data Migration is selected. |
| Extend Expiration Time of Destination Database Key | Add extra expiration time to migrated keys. Useful when your application relies on key expiration, such as distributed locks. Applies to: expire, pexpire, expireat, pexpireat. |
| Environment Tag | Optional. Tag the instance to identify its environment. |
| Configure ETL | Enable or disable the extract, transform, and load (ETL) feature. See What is ETL? and Configure ETL in a data migration or data synchronization task. |
| Monitoring and Alerting | Configure alerts to receive notifications if migration fails or latency exceeds a threshold. See alert thresholdalert notifications. |
Click Next Data Verification to configure data verification. For details, see Configure a data verification task.
Step 6: Run the precheck
Click Next: Save Task Settings and Precheck.
To preview the API parameters for this configuration, hover over the button and click Preview OpenAPI parameters.
DTS runs a precheck before starting migration. The task starts only after the precheck passes.
If the precheck fails, click View Details next to the failed item, fix the issue, and run the precheck again.
If a warning appears: for items that cannot be skipped, fix the issue and rerun. For items that can be skipped, click Confirm Alert Details > Ignore > OK > Precheck Again. Ignoring warnings may cause data inconsistency.
Step 7: Purchase and start
-
When Success Rate reaches 100%, click Next: Purchase Instance.
-
On the Purchase page, select the instance class:
Parameter Description Resource Group Settings Select the resource group for this instance. Default: default resource group. See What is Resource Management?. Instance Class Select a specification based on your migration volume and speed requirements. See Data migration link specifications. -
Read and accept Data Transmission Service (Pay-as-you-go) Service Terms.
-
Click Buy and Start, then click OK in the confirmation dialog.
Monitor migration progress on the data migration page.
If the task includes both full and incremental migration, it is displayed as Incremental Data Migration on the migration task list page.
What's next
-
To verify data consistency after migration, see Configure a data verification task.
-
Before switching application traffic to the destination instance, stop or release the DTS task to prevent auto-recovered tasks from overwriting destination data.
-
For other migration scenarios, see Overview of data migration scenarios.
After the migration
The destination instance is a separate, new instance with a connection endpoint different from that of the source instance. After you verify that the data is correct, switch your application's connection configuration to the destination instance's endpoint, and add the IP address of the new client (for example, the migrated server) to the whitelist of the destination instance. Otherwise, writes from your business will still go to the source instance.