All Products
Search
Document Center

Data Transmission Service:Migrate data from a PolarDB for MySQL cluster to a self-managed Doris database

Last Updated:Dec 27, 2025

Data Transmission Service (DTS) lets you migrate data from a PolarDB for MySQL cluster to a Doris database for large-scale data analytics. This topic describes the procedure using a Doris database that is deployed on an ECS instance as the destination database.

Prerequisites

A destination Doris database is created. The available storage space of this database must be larger than the storage space used by the source PolarDB for MySQL cluster.

Note

For more information about the supported versions of the source and destination databases, see Overview of migration solutions.

Usage notes

Category

Description

Source database limits

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

  • 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 columns to the destination tables. For more information, see Additional column information.

  • If you migrate tables and need to edit them, such as mapping column names, a single data migration task can migrate a maximum of 1,000 tables. If you exceed this limit, an error is reported after you submit the task. In this case, split the tables into multiple migration tasks or configure a task to migrate the entire database.

  • For incremental migration:

    • Enable binary logging (Binlog) and set the loose_polar_log_bin parameter to on. Otherwise, an error is reported during the precheck and the data migration task cannot start. For more information about how to enable binary logging and modify parameters, see Enable binary logging and Modify parameters.

      Note

      Enabling binary logging for a PolarDB for MySQL cluster consumes storage space and incurs fees.

    • Retain the binary logs of the PolarDB for MySQL cluster for at least 3 days. We recommend that you retain them for 7 days. Otherwise, Data Transmission Service (DTS) may fail because it cannot obtain the binary logs. In extreme cases, this may cause data inconsistency or data loss. Issues caused by a binary log retention period that is shorter than the required period are not covered by the DTS Service-Level Agreement (SLA).

      Note

      For more information about how to set the retention period for binary logs of a PolarDB for MySQL cluster, see Modify the retention period.

  • Source database operation limits:

    • During schema migration and full data migration, do not perform data definition language (DDL) operations to change the schema of the database or tables. Otherwise, the data migration task fails.

    • If you perform only full data migration, do not write new data to the source instance. Otherwise, the data in the source and destination instances will be inconsistent. To ensure real-time data consistency, select schema migration, full data migration, and incremental data migration.

  • Data changes from operations that are not recorded in binary logs during the migration are not migrated to the destination database. Examples of such operations include data recovery using physical backup and cascade operations.

    Note

    If this occurs, you can perform a full data migration again when your business permits.

Other limits

  • Migration of read-only nodes from the source PolarDB for MySQL cluster is not supported.

  • Migration of OSS external tables from the source PolarDB for MySQL cluster is not supported.

  • DTS does not support primary/secondary failover of the database instance during full migration. If a failover occurs, reconfigure the migration task promptly.

  • You can migrate data only to tables that use the Unique Key or Duplicate Key model in a Doris database. If the destination table uses the Duplicate Key model, duplicate data may exist in the destination database in the following cases. You can deduplicate the data based on the additional columns (_is_deleted, _version, and _record_id).

    • A retry operation occurred in the data migration instance.

    • A restart operation was executed on the data migration instance.

    • Two or more DML operations were performed on the same row of data to be migrated after the data migration instance started.

      Note

      When the destination table uses the Duplicate Key model, DTS converts UPDATE or DELETE statements to 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 clusters in the destination Doris database. Otherwise, the data migration task fails. You can restart the migration instance to resume the failed task.

  • Doris databases support only database names and table names that start with letters. If the name of a database or table that you want to migrate does not start with a letter, you must use the object name mapping feature to rename the database or table.

  • If the name of the object that you want to migrate, such as a database, a table, or a column, contains Chinese characters, you must use the object name mapping feature to rename the object. For example, you can change the name from Chinese 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 restart the migration instance to resume 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 PolarDB for MySQL, M of the VARCHAR(M) data type represents the character length. In Doris, N of the VARCHAR(N) data type represents the byte length. If you do not use the schema migration feature provided by DTS, we recommend that you set the length of a VARCHAR field in Doris to four times the length of a VARCHAR field in MySQL.

  • If you use DMS or gh-ost to perform online DDL changes 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 the destination table may be locked.

    Note

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

  • 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. Before you migrate data, evaluate the impact of data migration on the performance of the source and destination databases. We recommend that you migrate data during off-peak hours, such as when the CPU load of the source and destination databases is less than 30%.

  • During full data migration, concurrent INSERT operations cause fragmentation in the tables of the destination database. After full data migration is complete, the size of used tablespace of the destination database is larger than that of the source database.

  • During data migration, do not use tools such as pt-online-schema-change to perform online DDL operations on the objects to be migrated from the source database. Otherwise, the data migration task fails.

  • Data inconsistency between the source and destination databases may occur if data from other sources is written to the destination database during data migration.

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

  • During incremental migration, DTS uses a batch synchronization policy to reduce the load on the destination. By default, DTS writes data to a single synchronization object at most every 5 seconds. Therefore, the DTS migration task may have a normal synchronization latency, which is usually within 10 seconds. To reduce the normal migration latency, modify the selectdb.reservoir.timeout.milliseconds parameter 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 smaller value 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 batch processing 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 or adjusting its parameters may be performed.

    Note

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

Billing

Migration type

Link Configuration Fees

Data transfer cost

Schema migration and full data migration

Free of charge.

This example is free of charge.

Note

When Access Method of the destination database is set to Public IP Address, you are charged for data transfer. For more information, see Billing overview.

Incremental data migration

Charged. For more information, see Billing overview.

SQL operations that support incremental migration

Operation type

SQL statement

DML

INSERT, UPDATE, and DELETE

DDL

  • ADD COLUMN

  • MODIFY COLUMN

  • CHANGE COLUMN

  • DROP COLUMN and 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 PolarDB for MySQL cluster

SELECT permission

SELECT permission

Read and write permissions

Destination Doris database

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

Create and authorize database accounts:

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

    Description

    N/A

    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 PolarDB for MySQL.

    Access Method

    Select Alibaba Cloud Instance.

    Instance Region

    Select the region where the source PolarDB for MySQL cluster resides.

    Replicate Data Across Alibaba Cloud Accounts

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

    PolarDB Cluster ID

    Select the ID of the source PolarDB for MySQL cluster.

    Database Account

    Enter the database account of the source PolarDB for MySQL cluster. For more information about the required permissions, see Permissions required for database accounts.

    Database Password

    The password that is used to access the database instance.

    Encryption

    Select a connection method as needed. For more information about SSL encryption, see Set 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. In this example, select Self-managed Database on ECS.

    Note

    If you connect to a self-managed database using other connection types, you must also perform 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 where the destination Doris database is deployed.

    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 value is 9030.

    Database Account

    Enter the database account of the destination Doris database. For more 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 ensure service continuity during data migration, select Schema Migration, Full Data Migration, and Incremental Data Migration.

      Important
      • After you migrate data from a PolarDB for MySQL cluster to a Doris database, the data types are converted. If you do not select Schema Migration, you must create tables that use the Unique Key model or Duplicate Key model in the destination Doris database before data migration. For more information, see the Data type mappings and Additional column information sections of this topic and Unique Key Model.

      • To ensure data consistency, do not write data to the source instance during data migration if Incremental Data Migration is not selected.

      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 databases or tables as the objects to be migrated.

      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

      Description

      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. In this example, you do not need to select 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 an 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

Data type in PolarDB for MySQL

Data type in Doris

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

ZEROFILL 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 avoid data loss, data of the CHAR and VARCHAR(n) types is converted to VARCHAR(4*n) after the data is migrated to the destination Doris database.

  • If you do not specify the length of data, the default value VARCHAR(65533) is used.

  • Data with a length of more than 65,533 characters is converted to the STRING type after it is migrated to the destination Doris database.

  • 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.