Comparing Migration Items
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.
DRS supports object-level, account-level, and data-level comparisons.
- Object-level comparison: compares databases, events, indexes, tables, views, stored procedures, functions, and triggers.
- Data-level comparison: compares rows and values of tables or collections.
Full migration tasks do not support data-level comparisons.
- Account-level comparison: compares the account names and permissions of the source and destination databases. Currently, only the MySQL database supports account-level comparison.
Prerequisites
- You have logged in to the DRS console.
- A migration task has been started.
Procedure
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.
- On the Online Migration Management page, click the target migration task name in the Task Name/ID column.
- On the Migration Comparison tab, compare the source and destination databases.
You can also select the migration task on the Online Migration Management page and click View to go to the Migration Comparison page.
- Check the integrity of the database object. Click Validate Objects. On the Object-Level Comparison tab, click Compare. Wait for a while and click
, and view the comparison result of each comparison item. Figure 2 Comparing objects
Locate a comparison item you want to view and click View Details in the Operation column.
- After the check is complete, compare the number of rows and values. If you only need to compare the number of rows of all migration objects, you can select a specified migration task on the Online Migration Management page and click Compare in the Operation column to create a comparison task.
- In the Before You Start pane, click Validate All Rows/Values.
- In the displayed Create Comparison Task dialog box, specify Comparison Type, Compute Resource, Comparison Time, and Object. Then, click OK. Figure 3 Creating a comparison task
- Comparison Type: compares rows and values.
- Compute Resource: This function affects the resources used by value comparison on the source database. Compute resources are classified into DRS compute resources and database compute resources.
- On DRS: DRS reads data from both the source and destination databases first and then compares the data, which increases the I/O read load on the source database but does not affect the performance of source CPU and memory. This option is suitable for value comparison of cold data in static tables during service running.
- On databases: DRS directly compares data on the source and destination databases using their own CPU, memory, and I/O resources. This option is suitable for value comparison in non-service window when no data changes occur. The comparison on database is faster than the comparison on DRS.
- Comparison Time: You can select Start upon task creation or Start at a specified time. There is a slight difference in time between the source and destination databases during synchronization. Data consistency may occur. You are advised to compare migration items during off-peak hours for more accurate results.
- Object: You can select objects to be compared based on the scenarios.
- Currently, only the MySQL DB engine supports value comparison. Before the value comparison, the system will help you evaluate the time required for value comparison.
- Currently, only the MySQL engine supports compute resource selection.
- When you select an object, the spaces before and after the object name are not displayed. If there are multiple spaces in the middle of the object name, only one space is displayed.
After the comparison creation task is submitted, the Data-Level Comparison tab is displayed. Click
to refresh the list and view the comparison result of the specified comparison type.Figure 4 Viewing the data-level comparison result
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.
Figure 5 Viewing comparison details
You can cancel a running task at any time and view the comparison report of a canceled comparison task.
Compare database accounts and permissions. Click the Account-Level Comparison tab to view the comparison results of database accounts and permissions.Figure 6 Account-level comparison
- Full migration tasks do not support account-level comparisons.
- Currently, only MySQL supports account-level comparison.
- Review the cutover before service cutover.
In the Before You Start pane, 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.b.
- Stop the migration task.
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 choose whether or not to delete the task. DRS will not charge for this task after you stop it.
Generally, ending a task can ensure the integrity of special objects (triggers and events are migrated in the final migration phase). In rare cases (for example, network exceptions), a task may fail to be ended. If a task fails to be stopped for multiple times, you can select Forcibly stop task to reduce the waiting time. If you forcibly stop a task, the migration task will be stopped first. Triggers and events may not be completely migrated in some cases and you need to manually migrate them.
- Check the integrity of the database object.
Last Article: Viewing Migration Logs
Next Article: Backup Migration
Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.