Migrating Data Using DRS

Data Replication Service (DRS) helps migrate your databases to DDS DB instances. During the database migration, the source remains operational even if a transfer is interrupted, thereby minimizing application downtime.

DRS supports the following source database types:

  • On-premises MongoDB databases
  • Self-built MongoDB database on the ECS
  • Databases on other clouds
  • HUAWEI CLOUD DDS DB instances

The following database versions are supported:

  • Cluster 3.4 and 4.0
  • Replica set 3.4 and 4.0
  • Single node 3.4 and 4.0

Data cannot be migrated from a later version database to an earlier version database.

Migrate Scenario

Scenario 1: Full Migration

This migration type is suitable for scenarios where service interruption is acceptable. All objects and data in non-system databases are migrated to the destination database at one time. The objects include tables, views, and stored procedures.

If you perform a full migration, you are advised to stop operations on the source database. Otherwise, data generated in the source database during the migration will not be synchronized to the destination database.

Currently, DRS supports full migration between the following types of DB instances:

  • Replica set -> Single node
  • Replica set -> Replica set
  • Replica set -> Cluster
  • Single node -> Single node
  • Single node -> Replica set
  • Single node -> Cluster
  • Cluster -> Cluster

Scenario 2: Full+Incremental Migration

This migration type allows you to migrate data without interrupting services. After a full migration initializes the destination database, an incremental migration initiates and parses logs to ensure data consistency between the source and destination databases.

If you select the Full+Incremental migration type, data generated during the full migration will be synchronized to the destination database with zero downtime, ensuring that both the source and destination databases remain accessible.

Currently, DRS supports combined full and incremental migration between the following types of DB instances:

  • Replica set -> Single node
  • Replica set -> Replica set
  • Replica set -> Cluster
  • Single node -> Single node
  • Single node -> Replica set
  • Single node -> Cluster
  • Cluster -> Cluster

Before You Start

To improve the stability and security of data migration ensure that your DB instances meet the migration requirements described in Migration Preparations.

Migration Operations

A complete real-time migration consists of creating a migration task, tracking task progress, analyzing migration logs, and comparing data consistency. By comparing multiple items and data, you can determine the proper time for service migration to minimize the service downtime.

The following flowchart shows the migration procedure.

Figure 1 Migration process

For details, see section MongoDB Database Migration in the Data Replication Service Best Practices.