Synchronize or migrate events

更新时间:
复制 MD 格式

If you include events during data synchronization or migration, data inconsistencies can occur between the source and destination databases. This happens if an event that updates a table is synchronized or migrated to the destination database and executes before the corresponding data is fully transferred. This topic describes how to use Data Transmission Service (DTS) to synchronize or migrate events and prevent such data inconsistencies.

Prerequisites

The data synchronization or migration instance must meet the following requirements:

  • The Database Type of the source database is MySQL or PolarDB for MySQL, and the Database Type of the destination database is MySQL or PolarDB for MySQL.

  • The instance must include both schema and incremental data tasks.

    • For a migration instance, you must select both Schema Migration and Incremental Data Migration under Migration Types.

    • For a synchronization instance, Incremental Data Synchronization is selected by default under Synchronization Types. You must also select Schema Synchronization.

  • When you configure the instance, you must select the entire database for Source Objects.

Usage notes

  • You can synchronize or migrate events for an instance only once.

  • If your migration instance does not include an incremental migration task (Incremental Data Migration) but meets all other requirements, DTS automatically migrates events from the source database to the destination database.

    Note

    You can view the details on the Task Details tab in the Schema Migration 2 module.

Procedure

Note

The procedures for data synchronization and migration instances are similar. This topic uses a data synchronization instance as an example.

Configure an instance

  1. Go to the data synchronization task list page in the destination region. You can do this in one of two ways.

    DTS console

    1. Log on to the DTS console.

    2. In the navigation pane on the left, click Data Synchronization.

    3. In the upper-left corner of the page, select the region where the synchronization instance is located.

    DMS console

    Note

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

    1. Log on to the DMS console.

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

    3. To the right of Data Synchronization Tasks, select the region of the synchronization instance.

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

  3. Configure the source and destination databases.

    For more information, see the relevant configuration topics in Data synchronization scenarios or Data migration scenarios.

  4. After completing the configuration, click Test Connectivity and Proceed at the bottom of the page.

    Note
    • Ensure that you add the CIDR blocks of the DTS servers (either automatically or manually) to the security settings of both the source and destination databases to allow access. For more information, see Add the IP address whitelist of DTS servers.

    • If the source or destination is a self-managed database (i.e., the Access Method is not Alibaba Cloud Instance), you must also click Test Connectivity in the CIDR Blocks of DTS Servers dialog box.

  5. Set Whether to migrate Event to Yes, and then complete the remaining steps.

    For more information, see the relevant configuration topics in Data synchronization scenarios or Data migration scenarios.

Synchronize events

  1. Go to the data synchronization task list page in the destination region. You can do this in one of two ways.

    DTS console

    1. Log on to the DTS console.

    2. In the navigation pane on the left, click Data Synchronization.

    3. In the upper-left corner of the page, select the region where the synchronization instance is located.

    DMS console

    Note

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

    1. Log on to the DMS console.

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

    3. To the right of Data Synchronization Tasks, select the region of the synchronization instance.

  2. Click the ID of the target instance.

  3. Optional: In the left-side navigation pane, click Task Management.

  4. In the Progress section, click the Basic Information tab in the Incremental Write module.

  5. In the Actions column, click Migrate event.

  6. In the Confirm dialog box that appears, click OK.

  7. View the details of the event synchronization task.

    1. To the right of Progress, deselect the Hide Completed Modules checkbox.

    2. Click the Schema Migration 3 module.

    3. On the Task Details tab, view the details.

      The progress bar at the top of the page shows the migration phases: Precheck, Incremental data capture, Schema Migration 1, Full migration, Schema Migration 2, Incremental write, and Schema Migration 3. On the Event tab, a table lists details for each migration object, including its name, status, source database, destination database, and available actions, such as schema correction and view creation syntax.