This section describes how to compare migration items to check if there are any differences between source and destination databases. By comparing migration objects, you can determine the proper time for service migration to minimize the service downtime.
You can compare migration objects with different dimensions:
When you check data consistency, compare the number of rows first. If the number of rows are inconsistent, you can then compare the data in the table to determine the inconsistent data.
You can follow the comparison process or select a comparison method based on your service scenario. The following operations describe how to compare migration items by following the recommended migration process.
Click Object-Level Comparison. On the Object-Level Comparison tab, view the comparison result of each comparison item.
Locate a comparison item you want to view and click View Details in the Operation column.
Only MySQL-to-MySQL migration tasks support data filtering and comparison. After enabling Filter Data, add filtering criteria for the table objects to be compared. In the Filtering Criteria area, enter the filtering criteria, and click Verify. After the verification is successful, click Generate Processing Rule. The rule is displayed. Click OK. To view the comparison details, locate the target comparison type and click View Results in the Operation column. On the displayed page, locate a pair of source and destination databases, and click View Details in the Operation column to view detailed comparison results.
to refresh the list and view the comparison result of the specified comparison type.

On the Data-Level Comparison page, click Create Comparison Task, select Sample for Comparison Type, set Sampling Ratio, Comparison Time, and Object, and click OK. In the preceding command, size is fixed to 1000. To perform MongoDB sampling comparison provided by DRS, the $sample command is executed for multiple times until the sampled data volume reaches the specified sampling ratio.
Click Double Check During Cutover. In the displayed Create Comparison Task dialog box, specify Comparison Type, Comparison Time, and Object. Then, click OK.
For details about how to view comparison details, see 2.c.
After the service system is successfully migrated to the destination database, stop the migration task to prevent operations in the source database from being synchronized to the destination database to overwrite the data. This operation only deletes the replication instance, and the migration task is still in the task list. You can view or delete the task.
Generally, stopping a task can ensure the integrity of special objects because triggers and events are migrated when a task is being stopped. Only in some cases, such as network disconnections, a task may fail to be stopped. If a task fails to be stopped multiple times, you can select Forcibly stop task to reduce the waiting time. If you forcibly stop a task, triggers and events may not be completely migrated and you need to manually migrate them.
Periodic comparison indicates that DRS periodically compares the number of rows or objects in the source database table with those in the destination database table and displays the comparison results.
To accelerate and simplify the migration process, DRS provides the quick comparison function. You can directly perform a comparison on the migration task list. This function can be used to compare all migration objects only when incremental migration tasks are in progress.
If there is inconsistent data in the static value comparison result, you can select the inconsistent tables on the comparison details page to repair the data. The data repair result includes repair SQL statements that can be executed in the destination database. After the repair, you can view the repair SQL details of the inconsistent rows on the repair progress details page. You can also export and download all the inconsistent SQL statements generated in this comparison, and manually execute the SQL statements in the destination database based on the site requirements. There are the following restrictions on data repair:
Database Type | Time Zone SQL |
|---|---|
MYSQL | SET session time_zone='+00:00'; |