Skip to main content

Managing DynamoDB Data Migration with DMS

Hands-On Lab

 

Photo of John Hanna

John Hanna

AWS Training Architect II

Length

01:00:00

Difficulty

Intermediate

In this lab, we will create a Database Migration Service endpoint for DynamoDB targets. We will then create a Database Migration Service task, as well as the required selection and object-mapping rules to migrate data from a MariaDB server to the pinehead_records_s2 table that has been created in the lab environment.

What are Hands-On Labs?

Hands-On Labs are scenario-based learning environments where learners can practice without consequences. Don't compromise a system or waste money on expensive downloads. Practice real-world skills without the real-world risk, no assembly required.

Managing DynamoDB Data Migration with DMS

Introduction

In this lab, we will create a Database Migration Service endpoint for DynamoDB targets. We will then create a Database Migration Service task, as well as the required selection and object-mapping rules to migrate data from a MariaDB server to the pinehead_records_s2 table that has been created in the lab environment.

Solution

Log in to the live AWS environment using the credentials provided. Make sure you're in the N. Virginia (us-east-1) region throughout the lab.

Note: It will take about 30 minutes for the DMS task to complete. We've allowed the proper amount of time for the lab in order to accommodate this time.

Create DynamoDB Target Endpoint for Database Migration Service

  1. Navigate to IAM.
  2. Click Roles in the left-hand menu.
  3. Click the listed use-me-for-dms-lab role.
  4. Copy its role ARN.
  5. Navigate to Database Migration Service.
  6. Click Endpoints in the left-hand menu.
  7. Click Create endpoint.
  8. Set the following values:
    • Endpoint type: Target endpoint
    • Endpoint identifier: pineheadrecords-ddb-target
    • Target engine: dynamodb
    • Service access role ARN: Paste in the IAM role ARN
  9. Expand Test endpoint connection, and click Run test.
  10. Click Create endpoint.

Create Database Migration Service Task to Migrate Data from MariaDB to DynamoDB

  1. Click Database migration tasks in the left-hand menu.
  2. Click Create task.
  3. Set the following values:
    • Task identifier: pineheadrecords-migration-schema2
    • Replication instance: Select the one listed
    • Source database endpoint: Select the one listed
    • Target database endpoint: pineheadrecords-ddb-target
    • Migration type: Migrate existing data
    • Start task on create: Make sure it's checked
    • Target table preparation mode: Do nothing
    • Include LOB columns in replication: Don't include LOB columns
    • Enable CloudWatch logs: Check
  4. Expand Table mappings, and select JSON editor.
  5. Copy the rules.json code found on GitHub and paste it into the JSON editor box.
  6. Click Create task. It will take about 30 minutes for the task to complete.

Verify Successful Migration of Data from MariaDB to DynamoDB

  1. Once the task is complete, navigate to DynamoDB.
  2. Click the pinehead_records_s2 table.
  3. Click the Items tab to verify that data has been correctly migrated.

Conclusion

Congratulations on successfully completing this hands-on lab!