When a DTS instance includes events, the schema that an event depends on may be synchronized or migrated to the destination database before the source database updates. This can cause data inconsistency between source and destination. Use the procedures in this topic to configure DTS to handle events explicitly and prevent inconsistency.
Prerequisites
Before you begin, make sure all of the following conditions are met:
The source database type is MySQL or PolarDB for MySQL, and the destination database type is MySQL or PolarDB for MySQL.
The DTS instance includes both a schema task and an incremental data task:
Migration instances: Select Schema Migration and Incremental Data Migration for Migration Types.
Synchronization instances: Incremental Data Synchronization is selected by default. Also select Schema Synchronization.
Source Objects is set to an entire database when you configure the task.
Limitations
Each event is synchronized or migrated only once per task.
If Incremental Data Migration is not included in your migration instance but all other conditions are met, DTS automatically migrates events from the source to the destination.
For migration details, see the Task Details tab in the Schema Migration 2 module.
Configure an instance to migrate events
The steps for data synchronization and migration instances are similar. This procedure uses a data synchronization instance as an example.
Go to the Data Synchronization page.
DTS console
Log on to the DTS console.
In the left-side navigation pane, click Data Synchronization.
In the upper-left corner of the page, select the region in which the data synchronization instance resides.
DMS console
NoteOperations 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.
Log on to the DMS console.
In the top navigation bar, move the pointer over Data + AI and choose .
From the drop-down list to the right of Data Synchronization Tasks, select the region in which the data synchronization instance resides.
Click Create Task.
(Optional) Click New Configuration Page in the upper-right corner.
Skip this step if Back to Previous Version is displayed instead. Specific parameters in the new and previous versions of the configuration page may be different. We recommend that you use the new configuration page when available.
Configure the source and destination databases. For details, see Overview of data synchronization scenarios or Overview of data migration scenarios.
Click Test Connectivity and Proceed.
Make sure the CIDR blocks of DTS servers are added to the security settings of both databases. For details, see Add the CIDR blocks of DTS servers. If the source or destination is a self-managed database and Access Method is not Alibaba Cloud Instance, click Test Connectivity in the CIDR Blocks of DTS Servers dialog box.
Set Whether to migrate Event to Yes, then complete the remaining configuration. For details, see Overview of data synchronization scenarios or Overview of data migration scenarios.
Synchronize events
Go to the Data Synchronization page.
DTS console
Log on to the DTS console.
In the left-side navigation pane, click Data Synchronization.
In the upper-left corner of the page, select the region in which the data synchronization instance resides.
DMS console
NoteOperations 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.
Log on to the DMS console.
In the top navigation bar, move the pointer over Data + AI and choose .
From the drop-down list to the right of Data Synchronization Tasks, select the region in which the data synchronization instance resides.
Find the destination instance and click its ID.
(Optional) Click Task Management in the left-side navigation pane.
In the Progress area, click the Basic Information tab of the Incremental Write module.
On the right side of Actions, click Migrate Event.

In the Confirm dialog box, click OK.
View the event synchronization task details:
On the right side of Progress, uncheck Hide Completed Modules.
Click the Schema Migration 3 module.
View the details in the Task Details tab.
