Create a Migration Task

Migration Module (2.3.4) - Migrate from MongoDB to Amazon DocumentDB using Database Migration Service (DMS)

AWS Database Migration Service (DMS) task is where we configure the databases and collections we want to migrate.

You specify which collections (tables) and database (schemas) to be migrated, and any additional processing, such as logging requirements, control table data, and error handling.

At the AWS DMS console–>Database migration tasks screen, click on Create task. migtask

Create database migration task:

  • Task identifier: mongo-to-docdb
  • Replication instance: dmsfordocumentdb-<yourhash>-vpc-<hash>
  • Source database endpoint: mongodbsource
  • Target database endpoint: docdbtarget
  • Migration type: Migrate existing data and replicate ongoing changes. Here you can choose between three methods: - full load (Migrate existing data), - CDC only (Replicate data changes only) and - full load + CDC (Migrate existing data and replicate ongoing changes)

taskparm1

  • Target table preparation mode: Do nothing - so we preserve the indexes already created and collections metadata.
  • Stop task after full load completes: Don't stop
  • Include LOB columns in replication: Limited LOB mode
  • Maximum LOB size (KB): 32
  • Enable validation: unchecked
  • Enable CloudWatch logs: checked

Leave log levels at the defaults.

taskparm2

Table mappings -> Add new selection rule

Select labdb schema which is our database to migrate

  • Table name: % - it means all collections from the selected labdb database (schema).

selectschema

Leave Premigration assessment unchecked.

Migration task startup configuration: Automatically on create

Do not change Advanced task settings.

Do not need to include Tags.

Click on Create task.

createtask

In a minute or so, your task Identifier status will change from Creating, to Ready and then Starting.

taskcreated

After another minute you should see your task running in state Load complete, replication ongoing.

running

If your task did not start and shows a Ready status, you may Start it manually.

start

Click on your migration task Identifier taskcreated

Then go to Table statistics tab to check the progress of data migration.

tablestats

Click on the refresh button to update until you see the Load State as Table completed. Then you will start to see new records inserted from time to time coming from the Lambda function.

Full load record count may vary from hundreds to thousands of records, depending on how long the Lambda ingestion application has been running.

The Load state Table completed means that the full load is over and incremental changes will now be replicated .