Migrate from MongoDB to DocumentDB using DMS

Prerequisites : This lab requires Prerequisites to be completed before you can continue. If you are running this lab in your own AWS account then make sure you have CreateCluster and MigrationResources set to true. Please continue if you have already completed that.

AWS Database Migration Service (DMS) helps you migrate databases to AWS quickly and securely. The source database can remain fully operational during the migration, minimizing downtime to applications that rely on the database. The AWS Database Migration Service can migrate your data from a MongoDB source database to Amazon DocumentDB.

AWS Database Migration Service helps you migrate your MongoDB to Amazon DocumentDB with minimal downtime. Data changes to the source database can be continuously replicated to the target using a process called Change Data Capture (CDC). This allows the source database to be fully operational during the migration process. After the database migration is complete, the target database can remain synchronized with the source for as long as you choose, allowing you to switch your applications to DocumentDB at a convenient time.

In this lab, you will configure and use DMS to migrate from a MongoDB database to Amazon DocumentDB.

Online DMS

CloudFormation will be used to build the environment above, or complete the environment if you are continuing from the prior lab with a DocumentDB cluster already built. A MongoDB instance is provisioned on EC2. A Lambda function that regularly inserts documents is provided to simulate application updates. You will use the Amazon DocumentDB Index Tool to read the MongoDB source indexes, check for DocumentDB compatibility, and then restore the indexes to DocumentDB before using DMS to load data.

Some additional discussion and definition of terms for the services you will use in this lab are discussed below.

The AWS Database Migration Service consists of:

  • Replication instance, controls the replication, connected to the source and target.

  • Source Endpoint, connection to your source MongoDB, you will create this.

  • Target Endpoint, connection to your target Amazon DocumentDB, you will create this.

  • Migration Task, a set of schemas and tables to migrate and replicate online changes.

When you create a migration task with AWS Database Migration Services (DMS) from MongoDB to Amazon DocumentDB, DMS creates the collections and migrates the data. Use of the Amazon DocumentDB Index Tool is recommended to validate compatible indexes and migrate the indexes prior to starting the data migration.

Click here If you want to read more about MongoDB as a source database in a DMS task.

Click here If you want to read more about Amazon DocumentDB as a target database in a DMS task.