All Products
Search
Document Center

Data Transmission Service:Migrate data from PolarDB-X 1.0 to Elasticsearch

Last Updated:Mar 28, 2026

Use Data Transmission Service (DTS) to migrate data from a PolarDB-X 1.0 instance to an Alibaba Cloud Elasticsearch cluster. DTS supports schema migration, full data migration, and incremental data migration, so you can migrate with zero or minimal downtime.

Prerequisites

Before you begin, make sure you have:

  • A PolarDB-X 1.0 instance (version 5.2 or later) that uses RDS for MySQL as the storage backend — either custom RDS instances or separately purchased RDS instances. PolarDB for MySQL is not supported.

  • A destination Alibaba Cloud Elasticsearch cluster (not a development or test specification). To create one, see Create an Alibaba Cloud Elasticsearch instance.

  • The destination Elasticsearch cluster has more storage space than the source PolarDB-X 1.0 instance.

Choose a migration strategy

Select the migration types that match your requirements:

GoalMigration types
One-time import with brief downtimeSchema migration + Full data migration
Smooth cutover with minimal downtimeSchema migration + Full data migration + Incremental data migration
Keep source writes running throughout migrationSchema migration + Full data migration + Incremental data migration

Schema migration copies schema definitions from the source to the destination Elasticsearch cluster.

Full data migration copies all existing data from the selected objects.

Incremental data migration replicates ongoing changes after the full migration completes, keeping source and destination in sync until you cut over.

If you run only full data migration, stop writes to the source instance during migration to avoid data inconsistency.

Billing

Migration typeInstance configuration feeInternet traffic fee
Schema migration and full data migrationFreeCharged only when the destination Access Method is Public IP Address. See Billing overview.
Incremental data migrationCharged. See Billing overview.

Understand the Elasticsearch data model

Elasticsearch uses a document-oriented model that differs from relational databases. Before migration, make sure your index structure is planned accordingly — unlike tables in a relational database, Elasticsearch indexes are not always one-to-one replacements.

DTS maps your relational structure to Elasticsearch as follows:

Relational databaseElasticsearch
DatabaseIndex
TableType
RowDocument
ColumnField
Database schemaMapping

During schema migration, DTS does not set the mapping parameter in dynamic. The behavior depends on your Elasticsearch instance settings. If your source data is in JSON format, make sure values for the same key share the same data type across all rows in a table — otherwise DTS may report synchronization errors. See dynamic in the Elasticsearch documentation.

Required database account permissions

DatabaseSchema migrationFull migrationIncremental migration
PolarDB-X 1.0 (source)SELECTSELECTRead and write on migration objects. See Account management.
Elasticsearch (destination)Read and writeRead and writeRead and write

The default Elasticsearch account is elastic.

Supported SQL operations for incremental migration

Operation typeSQL statements
DMLINSERT, UPDATE, DELETE
UPDATE operations that remove fields are not supported.

Limitations

Before you start

Review these limitations before configuring your migration task:

  • Tables to be migrated must have primary keys or UNIQUE constraints with unique field values. Otherwise, duplicate data may appear in the destination.

  • When migrating at the table level with column mapping, a single task supports a maximum of 1,000 tables. If you exceed this limit, split the tables into multiple batches and create a separate task for each batch, or configure the task to migrate an entire database.

  • PolarDB-X 1.0 read-only instances do not support data migration.

  • DTS does not support migrating INDEX, PARTITION, VIEW, PROCEDURE, FUNCTION, TRIGGER, or FK objects.

  • You cannot migrate data to an Elasticsearch index that has a parent-child relationship or a Join field type mapping. Attempting this may cause the task to fail or break data queries in the destination.

  • Timestamp fields with a value of 0 in the source become null in the destination.

For incremental migration, binary logs must meet these requirements:

  • Binary logging must be enabled, and binlog_row_image must be set to full. If not, the precheck fails and the task cannot start.

  • Binary log retention period: If the retention period is shorter than required, DTS may fail to retrieve binary logs. In extreme cases, this causes data inconsistency or data loss. Issues caused by insufficient log retention are not covered by the Service-Level Agreement (SLA).

    • Incremental migration only: at least 24 hours

    • Full migration + incremental migration: at least 7 days. After full migration completes, you can reduce this to 24 hours or more.

During migration

Avoid the following operations while the migration task is running:

  • On the source database: Do not perform scale-out, scale-in, hot spot table migration, shard key changes, or DDL operations. These cause the task to fail.

    During full migration, DTS queries the source database, which creates a metadata lock that may block DDL operations on the source.
  • On the source database: DTS temporarily disables foreign key constraint checks and cascade operations at the session level. If you run cascade update or delete operations during migration, data inconsistency may occur.

  • On the source database: If you change the network type of the PolarDB-X 1.0 instance during migration, update the network connectivity settings in the migration task as well.

  • Schema changes: To add columns to tables in the source database, first update the corresponding mapping in the Elasticsearch instance, then run the DDL statement in the source, then pause and restart the migration task.

XA transaction consistency: DTS ensures data consistency for incremental migration based on the continuity of XA transactions in PolarDB-X 1.0. If XA transaction continuity is interrupted — for example, during a disaster recovery event for the incremental data collection module — uncommitted XA transactions may be lost.

After migration

  • Before switching production traffic to the destination, end or release the migration task. Alternatively, revoke write permissions for the DTS account on the destination using the REVOKE command. This prevents automatic task recovery from overwriting destination data with source data.

  • DTS attempts to auto-recover failed tasks for up to 7 days. DTS support staff will attempt to restore failed tasks within 8 hours. During restoration, they may restart the task or adjust task parameters (not database parameters). Parameters that may be adjusted are listed in Modify instance parameters.

Other notes

DTS periodically updates the dts_health_check.ha_health_check table in the source database to advance the binary log offset.

Configure a migration task

Step 1: Open the migration task list

Navigate to the Data Migration task list using one of the following methods.

From the DTS console

  1. Log on to the Data Transmission Service (DTS) console.Data Transmission Service (DTS) console

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

  3. In the upper-left corner, select the region where the migration instance is located.

From the DMS console

Steps may vary based on the mode and layout of the DMS console. See Simple mode console and Customize the layout and style of the DMS console.

  1. Log on to the Data Management (DMS) console.Data Management (DMS) console

  2. In the top menu bar, choose Data + AI > Data Transmission (DTS) > Data Migration.

  3. To the right of Data Migration Tasks, select the region where the migration instance is located.

Step 2: Create a task and configure connections

  1. Click Create Task.

  2. Configure the source database (PolarDB-X 1.0):

    ParameterDescription
    Task NameDTS generates a name automatically. Specify a descriptive name for easy identification. The name does not need to be unique.
    Select Existing ConnectionSelect a previously added database instance from the drop-down list to auto-fill the connection details. If no saved instance exists, configure the parameters below manually.
    Database TypeSelect PolarDB-X 1.0.
    Connection TypeSelect Cloud instance.
    Instance RegionSelect the region where the source instance resides.
    Cross Alibaba Cloud account?Select Not cross-account if the source and destination are under the same Alibaba Cloud account.
    RDS instance IDSelect the source PolarDB-X 1.0 instance ID.
    Database AccountEnter the database account. See Required database account permissions.
    Database PasswordEnter the password for the database account.
  3. Configure the destination database (Elasticsearch):

    ParameterDescription
    Select Existing ConnectionSelect a previously added database instance from the drop-down list to auto-fill the connection details. If no saved instance exists, configure the parameters below manually.
    Database TypeSelect Elasticsearch.
    Connection TypeSelect Cloud instance.
    Instance RegionSelect the region where the destination instance resides.
    TypeSelect Cluster or Serverless.
    Instance IDSelect the destination Elasticsearch instance ID.
    Database AccountEnter the logon name specified when creating the Elasticsearch instance. The default is elastic.
    Database PasswordEnter the password for the database account.
    EncryptionSelect HTTP or HTTPS.
  4. Click Test Connectivity and Proceed.

    Make sure DTS server IP addresses are added to the security settings (whitelist) of both the source and destination databases. See Add DTS server IP addresses to a whitelist. If the source or destination uses a public IP address (that is, Access Method is not Alibaba Cloud Instance), also click Test Connectivity in the CIDR Blocks of DTS Servers dialog.

Step 3: Select migration objects

On the Configure Objects page:

  1. Set the migration options:

    ParameterDescription
    Synchronization TypeSelect Schema Migration and Full Data Migration for a one-time migration. Add Incremental Data Migration to keep source and destination in sync during the migration period. See Choose a migration strategy.
    Important

    If you do not select Schema Migration, you must ensure that a database and tables to receive the data already exist in the destination database.

    Processing Mode for Existing Destination TablesPrecheck and Report Errors: Checks for same-name tables in the destination before starting. The task fails the precheck if conflicts exist. To resolve conflicts, rename tables in the destination — see Object name mapping. Ignore Errors and Proceed: Skips the check.
    Warning

    This may cause data inconsistency. During full migration, DTS keeps records already in the destination. During incremental migration, source records overwrite destination records with the same primary key.

    Index nameTable name: Uses the table name as the Elasticsearch index name. Database name_Table name: Creates an index name by concatenating the database name, an underscore (_), and the table name. The chosen format applies to all migrated tables.
    Case Policy for Destination Object NamesSet the case sensitivity policy for object names in the destination. The default is DTS default policy. See Case sensitivity policy for destination database object names.
  2. In the Source Objects box, click the objects to migrate, then click the right arrow to move them to the Selected Objects box.

    Select individual tables rather than entire databases. Database-level selection does not capture future table additions or deletions.
  3. In the Selected Objects box, optionally:

    Only underscores (_) are allowed as special characters in index and type names. Using object name mapping may cause migration failures for dependent objects.

Step 4: Configure advanced settings

Click Next: Advanced Settings and configure the following parameters:

ParameterDescription
Dedicated Cluster for Task SchedulingBy default, DTS schedules tasks on a shared cluster. To run tasks on a dedicated cluster for better stability, purchase a dedicated cluster first.
Retry Time for Failed ConnectionsHow long DTS retries after a connection failure. Default: 720 minutes. Range: 10–1440 minutes. Set to more than 30 minutes. The task auto-resumes if reconnected within this period; otherwise it fails.
Note

For multiple DTS instances sharing the same source or destination, the retry time is determined by the most recently created task. Charges accrue during retry — set a value that matches your business tolerance.

Retry Time for Other IssuesHow long DTS retries after non-connectivity issues (such as DDL or DML execution errors). Default: 10 minutes. Range: 1–1440 minutes. Set to more than 10 minutes. Must be less than Retry Time for Failed Connections.
Enable Throttling for Full Data MigrationLimits DTS read/write rate to reduce load on source and destination during full migration. Set Queries per second (QPS) to the source database, RPS of Full Data Migration, and Data migration speed for full migration (MB/s). You can also adjust speed after the task starts. Available only when Full Data Migration is selected.
Enable Throttling for Incremental Data MigrationLimits DTS rate during incremental migration. Set RPS of Incremental Data Migration and Data migration speed for incremental migration (MB/s). You can also adjust speed after the task starts. Available only when Incremental Data Migration is selected.
Environment TagAssign an environment label to identify the instance (for example, production or staging). Optional.
Shard configurationSet the number of primary shards and replica shards for the destination index, based on the maximum shard configuration of the index in the Elasticsearch instance.
String indexHow DTS indexes string fields in Elasticsearch: analyzed — tokenize then index (also select an analyzer; see Analyzers). Use this for full-text search fields. not analyzed — index the raw value as-is. Use this for exact-match fields like IDs or tags. no — do not index the field.
Time zoneTime zone DTS uses when migrating DATETIME or TIMESTAMP data. If time-type data in the destination should not include time zones, pre-configure the document type in the destination instance.
DOCIDThe column DTS uses as the Elasticsearch document ID (_id). Defaults to the table's primary key. If the table has no primary key, Elasticsearch generates an ID automatically.
Configure ETLSelect Yes to configure the ETL feature and enter data processing statements. Select No to skip ETL.
Monitoring and AlertingSelect Yes to configure an alert thresholdalert notifications and notification settings. DTS sends alerts if a migration fails or latency exceeds the threshold.

Step 5: Configure routing and document ID

Click Next: Configure database and table fields and set the routing and document ID for each table:

ParameterDescription
Configure _routing?Yes: Route documents to specific shards using a custom column. No: Route using _id. Select No if the destination Elasticsearch instance is version 7.x.
_routing columnThe column to use for routing. Required only when Configure _routing? is set to Yes.
_id valueThe column to use as the document ID.

Step 6: Save the task and run a precheck

  1. Click Next: Save Task Settings and Precheck. To preview the API parameters for this task, hover over the button and click Preview OpenAPI parameters.

  2. Wait for the precheck to complete.

    DTS runs a precheck before starting the migration. The task starts only after it passes the precheck. If the precheck fails, click View Details next to the failed item, fix the issue, and rerun the precheck. For warnings on items that can be ignored, click Confirm Alert Details > Ignore > OK > Precheck Again to proceed. Ignoring warnings may cause data inconsistency.

Step 7: Purchase the migration instance

  1. After the Success Rate reaches 100%, click Next: Purchase Instance.

  2. On the Purchase page, select the instance class:

    ParameterDescription
    Resource Group SettingsSelect the resource group. The default is the default resource group. See What is Resource Management?
    Instance ClassThe link specification determines migration speed. Select a class based on your data volume and performance requirements. See Data migration link specifications.
  3. Read and accept the Data Transmission Service (Pay-as-you-go) Service Terms.

  4. Click Buy and Start, then click OK in the confirmation dialog.

Monitor migration progress

After the task starts, view its progress on the Data Migration Tasks list page.

  • Full migration only: The task stops automatically after full migration completes. The Status changes to Completed.

  • Full migration + incremental migration: The task continues running. The Status shows Running. Incremental migration keeps running until you manually stop the task.

Before switching production traffic to the destination, end or release the task to prevent automatic recovery from overwriting destination data.