Use Data Transmission Service (DTS) to stream incremental data changes from an ApsaraDB RDS for SQL Server instance into a DataHub project in real time. DTS uses change data capture (CDC) to read committed INSERT, UPDATE, and DELETE operations from the SQL Server transaction log and writes them to DataHub topics.
How it works
When you start a DTS migration task, DTS performs schema migration to replicate the structure of your selected objects to the destination DataHub project. After schema migration completes, DTS enables CDC on the source instance and begins capturing row-level changes. Each captured change is written to the corresponding DataHub topic. The task runs continuously — it stops only if you manually stop it or if an unrecoverable error occurs.
Full data migration is not supported for this migration path. Only schema migration and incremental data migration are available.
Supported configurations
The following table summarizes the hard limits for this migration path. Check these before you begin.
| Category | Supported values or limits |
|---|---|
| Migration types | Schema migration, incremental data migration (full data migration is not supported) |
| Databases per task | Up to 10 |
| Tables per task (when renaming tables or columns) | Up to 1,000 |
| SQL Server — Enterprise edition | 2008 or later |
| SQL Server — Standard edition | 2016 SP1 or later |
| Destination string size | Up to 2 MB per string value |
| CDC tables with field values > 64 KB | Run exec sp_configure 'max text repl size', -1; before starting the task |
| Transparent Data Encryption (TDE) | Must be disabled when incremental data migration is included |
Prerequisites
Before you begin:
-
The source ApsaraDB RDS for SQL Server instance runs a version supported by DTS. See Overview of data migration scenarios for supported versions.
-
DataHub is activated and a project is created to receive the migrated data. See Get started with DataHub and Manage projects.
-
If the source instance meets any of the following conditions, purchase multiple DTS instances and configure separate migration tasks:
-
The instance contains more than 10 databases
-
A single database backs up its transaction logs more frequently than once per hour
-
A single database executes more than 100 DDL statements per hour
-
Transaction logs are written at more than 20 MB/s for a single database
-
CDC needs to be enabled for more than 1,000 tables
-
Limitations
Source database
-
The source server must have enough outbound bandwidth. Insufficient bandwidth reduces migration speed.
-
Tables to be migrated must have PRIMARY KEY or UNIQUE constraints, with all fields unique. Tables without these constraints may produce duplicate records in the destination.
-
If you rename tables or columns in the destination, a single migration task supports up to 1,000 tables. Exceeding this limit causes a request error. In this case, split the tables across multiple tasks or migrate at the database level instead.
-
A single migration task supports up to 10 databases. Migrating more than 10 databases in one task may reduce performance and stability.
-
For incremental data migration:
-
Enable data logging on the source database. Set the backup mode to Full and perform a full physical backup.
-
If you run incremental data migration only, retain transaction logs for more than 24 hours. If you run both full and incremental data migration, retain logs for at least 7 days. DTS may fail to obtain logs if the retention period is too short, which can cause task failure, data inconsistency, or data loss. After full data migration completes, you can reduce the retention period to more than 24 hours. Retention periods that do not meet these requirements are outside the scope of the DTS Service Level Agreement (SLA).
-
-
For CDC to work correctly, the following conditions must be met. If they are not met, the precheck fails:
-
The value of the
srvnamefield in thesys.sysserversview must match the return value of theSERVERPROPERTYfunction. -
For self-managed SQL Server databases, the database owner must be the
sauser. For ApsaraDB RDS for SQL Server databases, the database owner must be thesqlsauser. -
Enterprise edition: SQL Server 2008 or later.
-
Standard edition: SQL Server 2016 SP1 or later.
-
If the source runs SQL Server 2017 (Standard or Enterprise edition), update to a later version before migration.
-
-
DTS uses the
fn_logfunction to read source database logs. Do not clear logs before the task completes — clearing logs can cause the task to fail. -
During schema migration and full data migration, do not execute DDL statements on the source database. Schema changes during migration cause the task to fail.
-
If you run incremental data migration only, do not write data to the source database during migration. To guarantee data consistency, run schema migration, full data migration, and incremental data migration together.
-
If the source is an Azure SQL Database, only one database can be migrated per task.
-
If the source is an ApsaraDB RDS for SQL Server instance and the task includes incremental data migration, disable Transparent Data Encryption (TDE) on the instance. See Configure TDE.
-
During full data migration, enable the
READ_COMMITTED_SNAPSHOTisolation level on the source database. Without it, shared locks may block writes, cause data inconsistency, or prevent the instance from running. These issues are outside the scope of the DTS SLA. -
In hybrid log-based parsing mode, do not add or remove columns more than once within a 10-minute window. For example, executing both of the following statements within 10 minutes causes a task error:
ALTER TABLE test_table DROP COLUMN Flag; ALTER TABLE test_table ADD Remark nvarchar(50) not null default('');
Destination DataHub project
-
A single string value cannot exceed 2 MB in length.
Objects and data types
DTS supports schema migration for: schemas, tables, views, functions, and stored procedures.
The following object types are not migrated:
-
Assemblies
-
Service brokers
-
Full-text indexes and full-text catalogs
-
Distributed schemas and distributed functions
-
Common language runtime (CLR) stored procedures, CLR scalar-valued functions, and CLR table-valued functions
-
Internal tables, system objects, and aggregate functions
-
Tables that contain computed columns
The following SQL Server data types are not migrated:
| Data type | Notes |
|---|---|
| CURSOR | Not supported |
| ROWVERSION | Not supported |
| SQL_VARIANT | Not supported |
| HIERARCHYID | Not supported |
| POLYGON | Not supported |
| GEOMETRY | Not supported |
| GEOGRAPHY | Not supported |
Incremental data migration
-
DML operations supported: INSERT, UPDATE, DELETE.
If an UPDATE operation modifies only large field values, DTS does not migrate that operation.
-
Reindexing operations are not allowed while incremental data migration is running. Reindexing can cause the task to fail and may result in data loss.
DTS cannot migrate DDL operations related to the primary key of a CDC-enabled table.
-
If the number of CDC-enabled tables in a single migration task exceeds the maximum supported by DTS, the precheck fails.
-
If CDC-enabled tables require field values larger than 64 KB, run the following command on the source database before starting the task:
exec sp_configure 'max text repl size', -1;By default, a CDC job can process data up to 64 KB per field.
-
DTS does not migrate foreign keys. Cascade and delete operations defined on the source database are not replicated to the destination.
Internal objects created by DTS
DTS creates the following objects in the source database to track migration progress:
| Mode | Objects created |
|---|---|
| Incremental synchronization based on source database logs | Trigger dts_cdc_sync_ddl, heartbeat table dts_sync_progress, DDL history table dts_cdc_ddl_history |
| Hybrid log-based parsing | Same as above, plus CDC enabled on the source database and specific tables |
For tables with CDC enabled, set the maximum ingestion rate to 1,000 records per second (RPS).
Other considerations
-
Migrate data during off-peak hours. Full data migration increases read and write load on both the source and destination.
-
Do not use tools other than DTS to write data to the destination DataHub project during migration. Doing so may cause data inconsistency.
-
Multiple DTS instances sharing the same source SQL Server database capture incremental data independently.
-
If a task fails, DTS technical support attempts to restore it within 8 hours. During restoration, the task may be restarted and task parameters (not database parameters) may be modified. For the parameters that may be modified, see Modify instance parameters.
-
Full data migration uses concurrent INSERT operations, which may cause table fragmentation in the destination. The destination tablespace size may be larger than the source after migration.
Special cases
If the source is an ApsaraDB RDS for SQL Server instance, DTS automatically creates an account named rdsdt_dtsacct on the instance. Do not delete this account or change its password while the migration task is running. See System accounts.
Billing
| Migration type | Task configuration fee | Data transfer cost |
|---|---|---|
| Schema migration | Free | Free (charges apply only when migrating over the Internet from Alibaba Cloud). See Billing overview. |
| Incremental data migration | Charged. See Billing overview. | — |
Required database account permissions
| Instance | Schema migration | Incremental data migration |
|---|---|---|
| Source ApsaraDB RDS for SQL Server | Read permissions on the objects to be migrated | Owner permissions on the objects to be migrated |
See Create a privileged account or a standard account and Modify the permissions of an account.
Create a migration task
Step 1: Open the Data Migration page
Use one of the following consoles:
DTS console
-
Log on to the DTS console.
-
In the left-side navigation pane, click Data Migration.
-
In the upper-left corner, select the region where the migration instance resides.
DMS console
The exact navigation path varies depending on the mode and layout of the DMS console. See Simple mode and Customize the layout and style of the DMS console.
-
Log on to the DMS console.
-
In the top navigation bar, go to Data + AI > DTS (DTS) > Data Migration.
-
From the drop-down list next to Data Migration Tasks, select the region where the migration instance resides.
Step 2: Configure the task
-
Click Create Task.
-
Configure the source and destination databases.
WarningAfter configuring the source and destination databases, read the Limits displayed at the top of the page before proceeding. Skipping this step may cause the task to fail or result in data inconsistency.
Source database
Parameter Description Task Name A name for the DTS task. DTS generates a name automatically. Specify a descriptive name to make the task easy to identify. The name does not need to be unique. Select Existing Connection If the source instance is registered with DTS, select it from the drop-down list. DTS populates the remaining parameters automatically. Otherwise, configure the parameters below. In the DMS console, select the instance from Select a DMS database instance. See Manage database connections. Database Type Select SQL Server. Access Method Select Alibaba Cloud Instance. Instance Region The region where the source ApsaraDB RDS for SQL Server instance resides. Replicate Data Across Alibaba Cloud Accounts Select No for same-account migration. RDS Instance ID The ID of the source ApsaraDB RDS for SQL Server instance. Database Account The database account for the source instance. See Required database account permissions. Database Password The password for the database account. Encryption Select Non-encrypted if SSL is disabled on the source database. Select SSL-encrypted if SSL is enabled. DTS trusts the server certificate by default. Destination database
Parameter Description Select Existing Connection If the destination instance is registered with DTS, select it from the drop-down list. DTS populates the remaining parameters automatically. Otherwise, configure the parameters below. See Manage database connections. Database Type Select DataHub. Access Method Select Alibaba Cloud Instance. Instance Region The region where the destination DataHub project resides. Project The name of the destination DataHub project. -
Click Test Connectivity and Proceed.
DTS server CIDR blocks must be added to the security settings of the source and destination databases. DTS can add these automatically, or you can add them manually. See Add the CIDR blocks of DTS servers. If the source or destination is a self-managed database not accessed through Alibaba Cloud Instance, click Test Connectivity in the CIDR Blocks of DTS Servers dialog box.
Step 3: Select objects to migrate
On the Configure Objects page, configure the following parameters:
| Parameter | Description |
|---|---|
| Migration Types | Select Schema Migration and Incremental Data Migration. Full Data Migration is not available for this migration path. If you do not select Incremental Data Migration, do not write data to the source database during migration to maintain data consistency. |
| Naming Rules of Additional Columns | When DTS migrates data to DataHub, it adds extra columns to the destination topic. If these column names conflict with existing columns in the topic, migration fails. Select New Rule or Previous Rule based on your needs. Check for naming conflicts before configuring this parameter. See Modify the naming rules for additional columns. |
| Processing Mode of Conflicting Tables | Precheck and Report Errors: fails the precheck if the destination contains tables with the same names as source tables. Use the object name mapping feature to resolve conflicts. See Database, table, and column name mapping. Ignore Errors and Proceed: skips the precheck for identical table names. During full migration, existing destination records with matching primary keys are kept. During incremental migration, they are overwritten. If schemas differ, only some columns are migrated, or the task may fail. |
| Capitalization of Object Names in Destination Instance | Controls the capitalization of database names, table names, and column names in the destination. The default is DTS default policy. See Specify the capitalization of object names in the destination instance. |
| Source Objects | Select objects from the Source Objects list, then click the right-arrow icon to add them to Selected Objects. You can select columns, tables, or databases. |
| Selected Objects | To rename a single object, right-click it. To rename multiple objects at once, click Edit in the upper-right corner. See Rename objects to be migrated and Rename multiple objects to be migrated at a time. Note: database names cannot be mapped — renaming a database may cause dependent objects to fail. To filter rows using WHERE conditions, right-click a table. See Specify filter conditions. |
Step 4: Configure advanced settings
Click Next: Advanced Settings and configure the following parameters:
| Parameter | Description |
|---|---|
| Dedicated Cluster for Task Scheduling | By default, DTS schedules tasks on the shared cluster. For greater stability, purchase a dedicated cluster. See What is a DTS dedicated cluster. |
| Retry Time for Failed Connections | The time range during which DTS retries failed connections. Valid values: 10–1,440 minutes. Default: 720 minutes. Set this to at least 30 minutes. DTS resumes the task if it reconnects within this window; otherwise, the task fails. Note: if multiple tasks share the same source or destination database, the most recently configured retry time takes precedence. DTS charges apply during connection retry periods. |
| Retry Time for Other Issues | The time range during which DTS retries failed DDL or DML operations. Valid values: 1–1,440 minutes. Default: 10 minutes. Set this to at least 10 minutes, and always less than the Retry Time for Failed Connections value. |
| Enable Throttling for Incremental Data Migration | Available only when Incremental Data Migration is selected. Configure RPS of Incremental Data Migration and Data migration speed for incremental migration (MB/s) to limit the load on the destination. |
| Environment Tag | An optional tag to identify the DTS instance. |
| Configure ETL | Select Yes to enable the extract, transform, and load (ETL) feature and enter data processing statements in the code editor. Select No to skip ETL. See What is ETL? and Configure ETL in a data migration or data synchronization task. |
| Monitoring and Alerting | Select Yes to receive notifications when the task fails or migration latency exceeds the threshold. Configure the alert threshold and notification settings. See Configure monitoring and alerting when you create a DTS task. |
Step 5: Run the precheck
Click Next: Save Task Settings and Precheck.
To preview the API parameters for this task configuration, hover over Next: Save Task Settings and Precheck and click Preview OpenAPI parameters.
DTS runs a precheck before starting the migration task. The task can only start after the precheck passes.
If the precheck fails:
-
Click View Details next to each failed item, analyze the cause, resolve the issue, and click Precheck Again.
If a precheck alert is triggered:
-
For alerts that cannot be ignored: click View Details, resolve the issue, and run the precheck again.
-
For alerts that can be ignored: click Confirm Alert Details > Ignore > OK, then click Precheck Again. Ignoring alerts may result in data inconsistency.
Step 6: Purchase a data migration instance
-
Wait until Success Rate reaches 100%, then click Next: Purchase Instance.
-
On the Purchase Instance page, configure the following:
Parameter Description Resource Group The resource group for the migration instance. Default: default resource group. See What is Resource Management? Instance Class The instance class determines migration speed. Select a class based on your workload. See Instance classes of data migration instances. -
Read and accept Data Transmission Service (Pay-as-you-go) Service Terms.
-
Click Buy and Start, then click OK in the confirmation dialog.
Verify the migration task
After the task starts, check its status on the Data Migration page:
-
Completed: The task included only schema migration (no incremental data migration). The task has stopped automatically.
-
Running: The task includes incremental data migration. The task runs continuously and does not stop automatically.