All Products
Search
Document Center

Data Transmission Service:Migrate data from RDS MySQL to a self-managed Doris database

Last Updated:Dec 23, 2025

Data Transmission Service (DTS) supports migrating data from a MySQL database, such as a self-managed MySQL database or an RDS MySQL instance, to a Doris database for massive data analytics. This topic uses an RDS MySQL instance as the source database and a Doris database deployed on an ECS instance as the destination database to describe the procedure.

Preparations

Create a destination Doris database. Ensure that the storage space of the destination database is larger than the storage space used by the source RDS MySQL instance.

Note

For information about the supported versions of the source and destination databases, see Migration solutions overview.

Notes

Type

Note

Source database limits

  • Bandwidth requirements: The server that hosts the source database must have sufficient outbound bandwidth. Otherwise, the data migration speed is affected.

  • If you perform incremental migration, binary logs:

    • Must be enabled, with `binlog_format` set to `ROW` and `binlog_row_image` set to `FULL`. Otherwise, an error is reported during the precheck, and the data migration task cannot start.

      Important

      If the source self-managed MySQL database is a dual-primary cluster where each instance is the primary for the other, you must enable the `log_slave_updates` parameter. This ensures that DTS can obtain all binary logs.

    • Local binary logs for an RDS for MySQL instance must be retained for at least 3 days (7 days is recommended). Local binary logs for a self-managed MySQL database must be retained for at least 7 days. Otherwise, the DTS task may fail because it cannot obtain the binary logs. In extreme cases, this can lead to data inconsistency or data loss. Issues caused by setting a binary log retention period shorter than the DTS requirement are not covered by the DTS Service-level agreement (SLA).

      Note

      For information about how to set the Retention Period for local binary logs of an RDS for MySQL instance, see Delete local logs automatically.

  • Requirements for migration objects:

    • All tables to be migrated have primary keys or UNIQUE constraints:

      Ensure that the table fields are unique. Otherwise, duplicate data may exist in the destination database.

    • The migration objects include tables that have no primary keys or UNIQUE constraints:

      When you configure the instance, select Migration Types and then select Schema Migration. In the Configurations for Databases, Tables, and Columns step, set Engine to duplicate for these tables. Otherwise, the instance may fail or data may be lost.

      Note

      During schema migration, DTS adds fields to the destination table. For more information, see Additional column information.

  • If you migrate tables and need to edit them (for example, map column names), a single data migration task supports a maximum of 1,000 tables. If you exceed this limit, an error is reported when you submit the task. In this case, split the tables into multiple migration tasks or configure a task to migrate the entire database.

  • Source database operation limits:

    • During schema migration and full data migration, do not perform DDL operations that change the database or table schema. Otherwise, the data migration task fails.

    • If you perform only full data migration, do not write new data to the source instance. Otherwise, data inconsistency occurs between the source and destination databases. To maintain real-time data consistency, select schema migration, full data migration, and incremental data migration.

  • During the migration, data generated by operations that are not recorded in binary logs, such as data from physical backup restoration or cascade operations, is not migrated to the destination database.

    Note

    If this occurs, you can migrate the full data again when your business permits.

  • If the source database is MySQL 8.0.23 or later and the data to be migrated contains invisible columns, data loss may occur because the data in these columns cannot be obtained.

    Note
    • You can run the ALTER TABLE <table_name> ALTER COLUMN <column_name> SET VISIBLE; command to make the invisible column visible. For more information, see Invisible Columns.

    • Tables without a primary key automatically generate an invisible primary key. You must also make this invisible primary key visible. For more information, see Generated Invisible Primary Keys.

Other limits

  • Data can be migrated only to tables that use the Unique or Duplicate engine in the Doris database. If the destination table uses the Duplicate engine, duplicate data may exist in the destination database in the following cases. You can remove duplicates based on the additional columns: _is_deleted, _version, and _record_id.

    • The migration instance has been retried.

    • The migration instance has been restarted.

    • After the migration instance starts, two or more DML operations are performed on the same data record to be migrated.

      Note

      If the destination table uses the Duplicate engine, DTS converts UPDATE or DELETE statements into INSERT statements.

  • When you configure parameters in the Selected Objects box, you can set only the bucket_count (number of buckets) parameter.

    Note

    The value of the bucket_count parameter must be a positive integer. The default value is auto.

  • During data migration, do not create a new cluster in the destination Doris database. Otherwise, the task fails. You can try to restart the migration instance to recover the failed task.

  • Doris databases support only database and table names that start with a letter. If the name of a database or table to be migrated does not start with a letter, use the object name mapping feature to change the name.

  • If the name of an object to be migrated, such as a database, table, or column, contains Chinese characters, use the object name mapping feature to change the name. For example, change the name to English. Otherwise, the task may fail.

  • You cannot perform DDL operations that modify multiple columns at a time or that modify the same table in succession.

  • During data migration, do not add Backend (BE) nodes to the Doris database. Otherwise, the task fails. You can try to restart the migration instance to recover the failed task.

  • In a multi-table merge scenario, where data from multiple source tables is migrated to a single destination table, ensure that the schemas of the source tables are consistent. Otherwise, data inconsistency or task failure may occur.

  • In MySQL, M in VARCHAR(M) indicates the character length. In a Doris database, N in VARCHAR(N) indicates the byte length. If you do not use the schema migration feature of DTS, set the length of VARCHAR fields in the Doris database to four times the length of the VARCHAR fields in MySQL.

  • When you use Data Management (DMS) or gh-ost to perform online DDL operations on the source, DTS migrates only the original DDL statements to the destination. In this scenario, DTS does not need to migrate a large amount of temporary table data, but this may cause table locking at the destination.

    Note

    DTS does not support migrating online DDL changes made using tools such as pt-online-schema-change on the source. If such changes are made at the source, data loss may occur at the destination or the migration instance may fail.

  • During full data migration, DTS consumes some read and write resources of the source and destination databases, which may increase the database load. Before you perform data migration, evaluate the performance of the source and destination databases. Perform data migration during off-peak hours. For example, perform the migration when the CPU load of the source and destination databases is below 30%.

  • Full data migration involves concurrent INSERT operations, which cause table fragmentation in the destination database. After full migration is complete, the storage space used by the tables in the destination database is larger than that in the source instance.

  • During data migration, do not use tools such as pt-online-schema-change to perform online DDL changes on the migration objects in the source database. Otherwise, the migration fails.

  • If data is written to the destination database by a source other than DTS during data migration, data inconsistency may occur between the source and destination databases.

  • If the always-confidential feature is enabled for the RDS for MySQL instance, full data migration is not supported.

    Note

    RDS for MySQL instances with Transparent Data Encryption (TDE) enabled support schema migration, full data migration, and incremental data migration.

  • During incremental migration, DTS uses a batch synchronization policy to reduce the load on the destination. By default, for a single synchronization object, DTS performs a write operation at most every 5 seconds. Therefore, a normal synchronization latency, usually within 10 seconds, may occur for the DTS task. To reduce this normal migration latency, modify the selectdb.reservoir.timeout.milliseconds parameter for the DTS instance in the console to adjust the batch processing time. The valid range is [1000, 10000] milliseconds.

    Note

    When you adjust the batch processing time, a shorter time increases the write frequency of DTS. This may increase the load and response time (RT) of the destination, which in turn increases the synchronization latency of DTS. Adjust the time based on the load of the destination.

  • If an instance fails, DTS helpdesk will try to recover the instance within 8 hours. During the recovery process, operations such as restarting the instance and adjusting parameters may be performed.

    Note

    When parameters are adjusted, only the parameters of the DTS instance are modified. The parameters of the database are not modified. The parameters that may be modified include but are not limited to those described in Modify instance parameters.

Special cases

  • If the source is a self-managed MySQL database:

    • A primary/secondary failover on the source database during migration causes the migration task to fail.

    • The latency in DTS is calculated by comparing the UNIX timestamp of the last migrated data record with the current UNIX timestamp. If no DML operations are performed on the source database for a long time, the latency information may be inaccurate. If the displayed latency is too high, you can perform a DML operation on the source database to update the latency information.

      Note

      If you migrate an entire database, you can also create a heartbeat table that is updated or written to every second.

    • DTS periodically runs the CREATE DATABASE IF NOT EXISTS `test` command on the source database to advance the binary log offset.

    • If the source database is an Amazon Aurora MySQL instance or another clustered MySQL instance, ensure that the domain name or IP address configured for the task and its resolution result always point to the read/write (RW) node. Otherwise, the migration task may not run as expected.

  • If the source is an RDS for MySQL instance:

    • To migrate incremental data, RDS for MySQL instances that do not record transaction logs, such as read-only instances of RDS for MySQL 5.6, cannot be used as the source.

    • DTS periodically runs the CREATE DATABASE IF NOT EXISTS `test` command on the source database to advance the binary log offset.

Billing

Migration type

Link configuration fee

Data transfer cost

Schema migration and full data migration

Free of charge.

This example is free of charge.

Note

Data transfer costs are incurred if you set Access Method for the destination database to Public IP Address. For more information, see Billing overview.

Incremental data migration

Charged. For more information, see Billing overview.

SQL operations supported for incremental migration

Operation type

SQL operations

DML

INSERT, UPDATE, DELETE

DDL

  • ADD COLUMN

  • MODIFY COLUMN

  • CHANGE COLUMN

  • DROP COLUMN, DROP TABLE

  • TRUNCATE TABLE

  • RENAME TABLE

    Important

    RENAME TABLE operations may cause data inconsistency between the source and destination databases. For example, if you select a table as the object to be migrated and rename the table during data migration, the data of this table is not migrated to the destination database. To prevent this situation, you can select the database to which this table belongs as the object to be migrated when you configure the data migration task. Make sure that the databases to which the table belongs before and after the RENAME TABLE operation are added to the objects to be migrated.

Permissions required for database accounts

Database

Schema migration

Full migration

Incremental migration

Source RDS MySQL instance

SELECT permission

SELECT permission

Read and write

Destination Doris database

Access permissions (Usage_priv) and read and write permissions (Select_priv, Load_priv, Alter_priv, Create_priv, and Drop_priv) on the database

To create and grant permissions to a database account:

Note

If the source database account is not created and granted permissions in the RDS MySQL console, make sure that the account has the REPLICATION CLIENT, REPLICATION SLAVE, SHOW VIEW, and SELECT permissions.

Procedure

  1. Use one of the following methods to go to the Data Migration page and select the region in which the data migration instance resides.

    DTS console

    1. Log on to the DTS console.

    2. In the left-side navigation pane, click Data Migration.

    3. In the upper-left corner of the page, select the region in which the data migration instance resides.

    DMS console

    Note

    The actual operation may vary based on the mode and layout of the DMS console. For more information, see Simple mode and Customize the layout and style of the DMS console.

    1. Log on to the DMS console.

    2. In the top navigation bar, move the pointer over Data + AI > DTS (DTS) > Data Migration.

    3. From the drop-down list to the right of Data Migration Tasks, select the region in which the data synchronization instance resides.

  2. Click Create Task to go to the task configuration page.

  3. Configure the source and destination databases. The following table describes the parameters.

    Category

    Configuration

    Note

    None

    Task Name

    The name of the DTS task. DTS automatically generates a task name. We recommend that you specify an informative name that makes it easy to identify the task. You do not need to specify a unique task name.

    Source Database

    Select Existing Connection

    • If you use a database instance that is registered with DTS, select the instance from the drop-down list. DTS automatically populates the following database parameters for the instance. For more information, see Manage database connections.

      Note

      In the DMS console, you can select the database instance from the Select a DMS database instance drop-down list.

    • If you fail to register the instance with DTS, or you do not need to use the instance that is registered with DTS, you must configure the following database information.

    Database Type

    Select MySQL.

    Access Method

    Select Alibaba Cloud Instance.

    Instance Region

    Select the region where the source RDS MySQL instance resides.

    Replicate Data Across Alibaba Cloud Accounts

    In this example, a database instance of the current Alibaba Cloud account is used. Select No.

    RDS Instance ID

    Select the ID of the source RDS MySQL instance.

    Database Account

    Enter the database account of the source RDS MySQL instance. For information about the required permissions, see Permissions required for database accounts.

    Database Password

    The password that is used to access the database instance.

    Encryption

    Specifies whether to encrypt the connection to the database. You can select Non-encrypted or SSL-encrypted based on your business requirements. If you want to set this parameter to SSL-encrypted, you must enable SSL encryption for the ApsaraDB RDS for MySQL instance before you configure the DTS task. For more information, see Use a cloud certificate to enable SSL encryption.

    Destination Database

    Select Existing Connection

    • If you use a database instance that is registered with DTS, select the instance from the drop-down list. DTS automatically populates the following database parameters for the instance. For more information, see Manage database connections.

      Note

      In the DMS console, you can select the database instance from the Select a DMS database instance drop-down list.

    • If you fail to register the instance with DTS, or you do not need to use the instance that is registered with DTS, you must configure the following database information.

    Database Type

    Select Doris.

    Access Method

    Select a connection type based on the deployment location of the destination database. This example uses Self-managed Database on ECS.

    Note

    If you connect a self-managed database to DTS in other ways, you must also perform the required preparations. For more information, see Preparations.

    Instance Region

    Select the region where the destination Doris database resides.

    ECS Instance ID

    Select the ID of the ECS instance that hosts the destination Doris database.

    Note

    If the destination Doris database is deployed on multiple ECS instances (for example, BE or FE nodes are deployed on other ECS instances), you must manually add the CIDR blocks of DTS servers to the security rules of each ECS instance where the nodes are deployed.

    Port Number

    Enter the service port of the destination Doris database. The default port is 9030.

    Database Account

    Enter the database account of the destination Doris database. For information about the required permissions, see Permissions required for database accounts.

    Database Password

    The password that is used to access the database instance.

  4. In the lower part of the page, click Test Connectivity and Proceed, and then click Test Connectivity in the CIDR Blocks of DTS Servers dialog box that appears.

    Note

    Make sure that the CIDR blocks of DTS servers can be automatically or manually added to the security settings of the source and destination databases to allow access from DTS servers. For more information, see Add DTS server IP addresses to a whitelist.

  5. Configure the objects to be migrated.

    1. On the Configure Objects page, configure the objects that you want to migrate.

      Configuration

      Description

      Migration Types

      • To perform only full data migration, select both Schema Migration and Full Data Migration.

      • To perform migration without service interruption, select Schema Migration, Full Data Migration, and Incremental Data Migration.

      Important
      • Data migration from MySQL to Doris involves data type conversion. If you do not select Schema Migration, you must create Unique or Duplicate model tables with the corresponding structures in the destination Doris instance in advance. For more information, see Data Type Mapping, Additional Column Information, and Primary Key Model.

      • If you do not select Incremental Data Migration, do not write new data to the source instance during data migration to ensure data consistency.

      Processing Mode of Conflicting Tables

      • Precheck and Report Errors: DTS checks whether tables with the same name exist in the destination database. If no tables with the same name exist, the task passes this check. If tables with the same name exist, the precheck fails and the data migration task does not start.

        Note

        If you cannot delete or rename the table in the destination database, you can map the table to a different name. For more information, see Map object names.

      • Ignore Errors and Proceed: DTS skips the check for tables with the same name in the destination database.

        Warning

        If you select Ignore Errors and Proceed, data inconsistency may occur and pose risks to your business. For example:

        • If the table schemas are consistent and a record in the destination database has the same primary key value as a record in the source database, the record from the source database overwrites the record in the destination database.

        • If the table schemas are inconsistent, only some columns of data may be migrated or the migration may fail. Use this option with caution.

      Capitalization of Object Names in Destination Instance

      The capitalization of database names, table names, and column names in the destination instance. By default, DTS default policy is selected. You can select other options to make sure that the capitalization of object names is consistent with that of the source or destination database. For more information, see Specify the capitalization of object names in the destination instance.

      Source Objects

      Select one or more objects from the Source Objects section. Click the 向右小箭头 icon to add the objects to the Selected Objects section.

      Note

      You can select objects to migrate at the database or table level.

      Selected Objects

      • To change the name of a migration object in the destination instance, right-click the migration object in the Selected Objects box. For more information, see Map object names.

      • If you select Schema Migration for Migration Types, select tables as the migration objects, and need to set the number of buckets (bucket_count parameter), right-click a table to be migrated in the Selected Objects box. In the Parameter Settings section, set Enable Parameter Settings to Yes, set Value as needed, and then click OK.

      Note
      • To select the incremental SQL operations to be migrated at the database or table level, right-click the migration object in the Selected Objects box and select the desired SQL operations in the dialog box that appears.

      • To set WHERE conditions to filter data, right-click the table to be migrated in the Selected Objects box and set the filter conditions in the dialog box that appears. For more information, see Set filter conditions.

      • If you use the object name mapping feature, other objects that depend on the mapped object may fail to be migrated.

    2. Click Next: Advanced Settings to configure advanced settings.

      Configuration

      Note

      Dedicated Cluster for Task Scheduling

      By default, DTS schedules the data migration task to the shared cluster if you do not specify a dedicated cluster. If you want to improve the stability of data migration tasks, purchase a dedicated cluster. For more information, see What is a DTS dedicated cluster.

      Retry Time for Failed Connections

      The retry time range for failed connections. If the source or destination database fails to be connected after the data migration task is started, DTS immediately retries a connection within the retry time range. Valid values: 10 to 1,440. Unit: minutes. Default value: 720. We recommend that you set the parameter to a value greater than 30. If DTS is reconnected to the source and destination databases within the specified retry time range, DTS resumes the data migration task. Otherwise, the data migration task fails.

      Note
      • If you specify different retry time ranges for multiple data migration tasks that share the same source or destination database, the value that is specified later takes precedence.

      • When DTS retries a connection, you are charged for the DTS instance. We recommend that you specify the retry time range based on your business requirements. You can also release the DTS instance at the earliest opportunity after the source database and destination instance are released.

      Retry Time for Other Issues

      The retry time range for other issues. For example, if DDL or DML operations fail to be performed after the data migration task is started, DTS immediately retries the operations within the retry time range. Valid values: 1 to 1440. Unit: minutes. Default value: 10. We recommend that you set the parameter to a value greater than 10. If the failed operations are successfully performed within the specified retry time range, DTS resumes the data migration task. Otherwise, the data migration task fails.

      Important

      The value of the Retry Time for Other Issues parameter must be smaller than the value of the Retry Time for Failed Connections parameter.

      Enable Throttling for Full Data Migration

      Specifies whether to enable throttling for full data migration. During full data migration, DTS uses the read and write resources of the source and destination databases. This may increase the loads of the database servers. You can enable throttling for full data migration based on your business requirements. To configure throttling, you must configure the Queries per second (QPS) to the source database, RPS of Full Data Migration, and Data migration speed for full migration (MB/s) parameters. This reduces the loads of the destination database server.

      Note

      You can configure this parameter only if you select Full Data Migration for the Migration Types parameter.

      Enable Throttling for Incremental Data Migration

      Specifies whether to enable throttling for incremental data migration. To configure throttling, you must configure the RPS of Incremental Data Migration and Data migration speed for incremental migration (MB/s) parameters. This reduces the loads of the destination database server.

      Note

      You can configure this parameter only if you select Incremental Data Migration for the Migration Types parameter.

      Whether to delete SQL operations on heartbeat tables of forward and reverse tasks

      Specifies whether to write SQL operations on heartbeat tables to the source database while the DTS instance is running. Valid values:

      • Yes: does not write SQL operations on heartbeat tables. In this case, a latency of the DTS instance may be displayed.

      • No: writes SQL operations on heartbeat tables. In this case, features such as physical backup and cloning of the source database may be affected.

      Environment Tag

      You can select an environment tag to identify the instance as needed. This example does not require a tag.

      Configure ETL

      Specifies whether to enable the extract, transform, and load (ETL) feature. For more information, see What is ETL? Valid values:

      Monitoring and Alerting

      Specifies whether to configure alerting for the data migration task. If the task fails or the migration latency exceeds the specified threshold, the alert contacts receive notifications. Valid values:

    3. Optional: After you complete the preceding configuration, click Next: Configure Database and Table Fields to set the Primary Key Column, Distribution Key, and Engine for the destination tables.

      Note
      • This step is available only if you select Schema Migration for Migration Types when you configure the migration objects. You can set Definition Status to All and then modify the settings.

      • You can select multiple columns to form a composite primary key for Primary Key Column. You must select one or more columns from the Primary Key Column as the Distribution Key.

      • For tables that have no primary keys or UNIQUE constraints, you must set Engine to duplicate. Otherwise, the migration may fail or data may be lost.

  6. Save the task settings and run a precheck.

    • To view the parameters to be specified when you call the relevant API operation to configure the DTS task, move the pointer over Next: Save Task Settings and Precheck and click Preview OpenAPI parameters.

    • If you do not need to view or have viewed the parameters, click Next: Save Task Settings and Precheck in the lower part of the page.

    Note
    • Before you can start the data migration task, DTS performs a precheck. You can start the data migration task only after the task passes the precheck.

    • If the task fails to pass the precheck, click View Details next to each failed item. After you analyze the causes based on the check results, troubleshoot the issues. Then, run a precheck again.

    • If an alert is triggered for an item during the precheck:

      • If an alert item cannot be ignored, click View Details next to the failed item and troubleshoot the issues. Then, run a precheck again.

      • If the alert item can be ignored, click Confirm Alert Details. In the View Details dialog box, click Ignore. In the message that appears, click OK. Then, click Precheck Again to run a precheck again. If you ignore the alert item, data inconsistency may occur, and your business may be exposed to potential risks.

  7. Purchase the instance.

    1. Wait until Success Rate becomes 100%. Then, click Next: Purchase Instance.

    2. On the Purchase Instance page, configure the Instance Class parameter for the data migration instance. The following table describes the parameters.

      Section

      Parameter

      Description

      New Instance Class

      Resource Group

      The resource group to which the data migration instance belongs. Default value: default resource group. For more information, see What is Resource Management?

      Instance Class

      DTS provides instance classes that vary in the migration speed. You can select an instance class based on your business scenario. For more information, see Instance classes of data migration instances.

    3. Read and agree to Data Transmission Service (Pay-as-you-go) Service Terms by selecting the check box.

    4. Click Buy and Start. In the message that appears, click OK.

      You can view the progress of the task on the Data Migration page.

      Note
      • If a data migration task cannot be used to migrate incremental data, the task automatically stops. The Completed is displayed in the Status section.

      • If a data migration task can be used to migrate incremental data, the task does not automatically stop. The incremental data migration task never stops or completes. The Running is displayed in the Status section.

Data type mappings

Category

MySQL data types

Doris data types

Numeric

TINYINT

TINYINT

TINYINT UNSIGNED

SMALLINT

SMALLINT

SMALLINT

SMALLINT UNSIGNED

INT

MEDIUMINT

INT

MEDIUMINT UNSIGNED

BIGINT

INT

INT

INT UNSIGNED

BIGINT

BIGINT

BIGINT

BIGINT UNSIGNED

LARGEINT

BIT(M)

INT

Decimal

Decimal

Note

The zerofill attribute is not supported.

Numeric

Decimal

Float

Float

Double

DOUBLE

  • BOOL

  • BOOLEAN

BOOLEAN

DATE and TIME

DATE

DATEV2

DATETIME[(fsp)]

DATETIMEV2

Timestamp[(fsp)]

DATETIMEV2

Time[(fsp)]

VARCHAR

YEAR[(4)]

INT

STRING

  • CHAR

  • VARCHAR

VARCHAR

Important

To prevent data loss, data of the CHAR and VARCHAR(n) types is converted to VARCHAR(4*n) after being migrated to Doris.

  • If no data length is specified, the default value VARCHAR(65533) of Doris is used.

  • If the data length exceeds 65533, the data is converted to STRING after being migrated to Doris.

  • BINARY

  • VARBINARY

STRING

  • TINYTEXT

  • TEXT

  • MEDIUMTEXT

  • LONGTEXT

STRING

  • TINYBLOB

  • BLOB

  • MEDIUMBOLB

  • LONGBLOB

STRING

ENUM

STRING

SET

STRING

JSON

STRING

Additional column information

Note

The following table describes the additional columns that DTS automatically adds or that you need to manually add to the destination tables that use the Duplicate model.

Name

Data type

Default value

Description

_is_deleted

Int

0

Indicates whether the data is deleted.

  • Insert: The value is 0.

  • Update: The value is 0.

  • Delete: The value is 1.

_version

Bigint

0

  • For full data migration, the value is 0.

  • For incremental data migration, the value is the timestamp in seconds from the source binary log.

_record_id

Bigint

0

  • For full data migration, the value is 0.

  • For incremental data migration, the value is the record ID of the incremental log entry. This ID uniquely identifies the log entry.

    Note

    The ID is unique and auto-incrementing.