Skip to main content

MySQL to TiDB Migration and Synchronization | NineData

Teams often move from MySQL to TiDB when they need more horizontal scalability, higher availability, or a distributed database architecture that remains compatible with the MySQL ecosystem. NineData Data Replication helps run the migration through full data loading, incremental synchronization, data validation, and controlled cutover.

When to use this workflow

Use this workflow when you need to:

  • Move MySQL workloads to TiDB for capacity or availability reasons.
  • Keep the MySQL source online during migration.
  • Synchronize new MySQL changes to TiDB before cutover.
  • Validate target data before switching application traffic.
  • Monitor migration progress and replication delay during the cutover window.

For detailed prerequisites, permissions, and task settings, see MySQL to TiDB.

Before you begin

Prepare the following items:

  • Access to the NineData console.
  • Connection information and accounts for the MySQL source and TiDB target.
  • Binlog enabled on the MySQL source when incremental synchronization is required.
  • Required permissions on both systems.
  • Network connectivity from NineData to both systems.
  • A cutover plan that defines the validation window and rollback criteria.

Step 1: Add the source and target data sources

  1. In the NineData console, click Data Source Management > Data Sources, and then click Create Data Source.

    Create a data source in NineData

  2. Follow the page prompts, test the connection, and click Create Data Source.

    Complete data source configuration

  3. Repeat the process for the MySQL source and the TiDB target.

Step 2: Create the migration task

  1. In the NineData console, click Data Replication > Data Replication, and then click Create Replication.

    Create a replication task

  2. Configure the MySQL source and TiDB target.

  3. Select the replication types required for migration. For a low-downtime migration, use full migration and incremental synchronization.

    Configure MySQL to TiDB replication

  4. Select source objects, configure mapping if needed, run the precheck, and start the task after the precheck passes.

  5. Monitor the task until the full migration finishes and incremental delay reaches your cutover threshold.

Step 3: Validate target data

Use data comparison before cutover when you need consistency validation.

  1. Open the replication task created in Step 2.

    Open task details

  2. Click the Data Comparison tab. If comparison was not enabled during task creation, click Enable Data Comparison.

    Review comparison results

  3. Click Re-compare when you need to validate the latest synchronized data.

    Run comparison again

Step 4: Configure alerts

Configure alerts so operators are notified when the task fails or replication delay exceeds your threshold.

  1. Open the replication task details page.

    Open task details

  2. Click Configure Alerts.

    Configure task alerts

  3. Enter a Policy Name, review the alert rules, and click Save Configuration.

    Save alert policy

Result

After full migration completes, incremental synchronization keeps TiDB updated with new MySQL changes. When application validation passes and replication delay is within your cutover threshold, switch traffic to TiDB during the planned cutover window.