Help Center/ Server Migration Service/ FAQs/ Data Consistency/ How Do I Verify Data Consistency Between the Source and Target Servers?
Updated on 2025-03-05 GMT+08:00

How Do I Verify Data Consistency Between the Source and Target Servers?

SMS gives you the capability to verify data consistency before and after the migration. You can enable the verification option when you configure the target server or initiate an incremental synchronization.

Notes

  • Before enabling the verification option, you are advised to stop services (and databases if any) on the source server. If they are not stopped, data on the source server keeps changing, which will affect the consistency.

    It is normal for some directories on the source and target servers to have slight differences. For instance, there are directories on the source server where data is always changing, such as the directory where SMS-Agent was installed and the /var/log directory where stores system logs.

  • The time required for consistency verification depends on the number and size of files to be verified. If consistency verification takes a long time during the final incremental synchronization, the time required for service cutover will also increase. Evaluate the impacts on your services.
  • Consistency verification occupies significant source disk I/O resources. Evaluate the potential impacts on your source services.
  • You can specify which paths should be included in the verification. If a parent and its child paths are included, only the parent path and its contents will be verified. The system will not re-verify the child paths.

    For example, if you specify the following paths for consistency verification:

    /path,/path/test

    The system will verify all contents of /path and will not verify /path/test separately.

Constraints

  • Consistency verification is not recommended when you choose to resize disks or partitions for the target server. Since paths between the source and target servers may not align perfectly, the verification results may be inaccurate.
  • It is not applicable to verification of cross-file system files or shared folders.
  • To prevent your services on the source server from being affected, a maximum of 1 million files can be verified in a single directory.
  • To prevent excessive memory usage, only paths that are shorter than 1024 bytes are verified.
  • Windows paths with non-ASCII characters (like Chinese or Japanese) cannot be verified and will be skipped during the process.

Enabling Data Consistency Verification When You Configure the Target Server

If you enable consistency verification when you configure the target server, data consistency will be verified after the full replication is complete. For details, see Configuring a Target Server.

Enabling Data Consistency Verification When You Initiate an Incremental Synchronization

  1. Open the Sync Incremental Data page by referring to Synchronizing Incremental Data.
  2. Select Verify Data consistency. This is a quick verification, and only the file size and modification time will be compared.

    Figure 1 Enabling data consistency verification
    Configure the verification policy based on the following table and your actual requirements.

    Parameter

    Description

    Enable Hash Verification

    If this option is enabled, the system will generate and compare hash values for each file to be verified. Hash verification is recommended when individual files are large and important. Enabling this option will increase CPU and disk I/O overheads for the source server and extend the verification time.

    CAUTION:
    • Hash values cannot be calculated for files in use, so these files will be skipped during the verification.
    • Enabling this option requires you to specify the verification scope, and only files in the specified scope will be verified.

    Verification Scope

    • Under Exclude paths, enter the paths you want to exclude from the verification. A maximum of 30 paths can be entered. Use commas (,) to separate the paths. For example, /root/data,/var. Leaving it empty will initiate a full verification.
    • Under Include paths, enter the paths you want to verify.
    NOTICE:
    • If the entered paths are incorrect or empty, 0 will be displayed for them in the verification results.
    • The more data you need to verify, the longer the verification will take. It is wise to narrow the verification scope to only key paths.
    • The following paths will be excluded from consistency verification by default:
      • Linux: /bin, /boot, /dev, /home, /etc, /lib, /media, /proc, /sbin, /selinux, /sys, /usr, /var, /run, and /tmp
      • Windows: top-level directories of partitions, for example, C:\ and D:\

      If you want to verify some of the excluded paths, see Modifying the Default Excluded Paths.

    Verify Inconsistencies

    This option can only be enabled after at least one consistency verification is complete.

  3. Click OK to synchronize incremental data and verify consistency. After the synchronization and verification are complete, you can view the verification results by referring to Viewing Verification Results.

Modifying the Default Excluded Paths

  1. Log in to the source server.
  2. Open the g-property.cfg configuration file of the SMS-Agent.

    • Linux: .../SMS-Agent/agent/config/g-property.cfg
    • Windows: C:\SMS-Agent-Py*\config\g-property.cfg

  3. Modify the [consistency_check] configuration item to fit your requirements. Use commas (,) to separate paths and do not end with a comma. The following is an example:

    • Linux: list_dir_illegal_linux = /bin,/boot,/dev,/home,/etc,/lib,...
    • Windows: list_dir_illegal_windows = C:\SMS-Agent-Py3,C:\SMS-Agent-Py2,...

  4. Save the configuration file.

Skipping Consistency Verification

If you want to skip consistency verification after the incremental synchronization starts, perform the following steps:

  1. In the server list, click the server name. The task details show up on the right.
  2. On the Task Progress tab, locate the Verify data consistency subtask and click Skip Verification under the progress bar. In this displayed window, click OK.

    Figure 2 Skipping consistency verification

    Consistency verification can be skipped only when the progress is between 5% and 95%.

Viewing Verification Results

After the verification is complete, go to the task details page and click the Consistency Verification tab to view the verification results.
Figure 3 Viewing verification results

If 0 is displayed in the Files Verified column, it means the specified directory could not be found or is empty.

All files verified to be inconsistent are recorded in the log file sms_cmp_result.log in the SMS-Agent installation directory (*/SmsAgent/agent/Logs/ on Linux and C://SMS-Agent-Py*/Logs on Windows) on the source server.

Estimating Verification Time

The following table lists the verification time tested on servers where only the migration process runs but is for reference only.

OS

Specifications

Disk Performance

Verification Time (per 100 GB)

Windows

2 vCPUs and 4 GB of memory

5,000 IOPS/150 MB/s

About 17 minutes

Linux

2 vCPUs and 4 GB of memory

5,000 IOPS/150 MB/s

About 13 minutes