There are a few ways to migrate DynamoDB on the web if you go looking for it. One of the best sources is the AWS guide.
This guide can be used to
a. Migrate DynamoDB from one region to another.
b. Import external data into DynamoDB from sources like S3
c. Export DynamoDB to S3 as well
All these use cases, including migrating DynamoDB are mainly driven by two actions:
Amazon Documents provide a detailed description of how to leverage AWS Data Pipeline to do the above task. We decided to put TotalCloud to a test and recreate the Data Pipeline, activate it and perform any of the above actions used to migrate DynamoDB.
Here are the templates that you can view to understand what TotalCloud does to perform the same task you would have otherwise done manually.
First, we tried creating a Data pipeline using the interface. Here’s how we did it.
As usual, it starts with a trigger node. Urgh! Scratch that. We created a template for you to get started.
Before we go there, there are some pre-requisites to be taken care of.
Two IAM roles are required to make this work.
Role Name 1: DataPipelineDefaultRole
Policy: AWSDataPipelineRole
Role Name 2: DataPipelineDefaultResourceRole
Policy: AmazonEC2RoleforDataPipelineRole
Amazon has provided the required steps.
Create two buckets. One for the data to be exported/imported and one for the Data Pipeline logs. We’ll be using these buckets to work with the data pipeline.
Once you are set up, let’s create the workflow.
When you create a new workflow, you will see an option to “Select a workflow template” or “Create workflow from scratch”.
Select the template option and click on “Next”. You should view a number of templates available in a list. Go ahead and just select “AWS DynamoDB to S3 exporter”.
This should give you a preset that you can use to quickly configure your Data Pipeline.
You can just double click any node to configure it. You can start from:
Double click the trigger node to see the configurations for it and edit it as needed.
Select the AWS Account that you wish to use with the region in which you want to create the pipeline.
If you haven’t synced your AWS account, you can use the “Sync AWS Account” option and follow these instructions to do so.
Once done, click on “Save Node”.
Again, select the AWS account and region. Then just click on “Additional Parameters” to view the changes that are needed for this node. You can view the nodes a
Add appropriate values as mentioned in the pre-requisites.
Click on “Apply Query” and then “Save Node”.
Just add the email or slack channel you want to get notified on once the workflow is complete.
“Save Node” and click on “Run Now”. This should show you the result about the workflow, how it ran and what it did.
Next, Save the workflow to check if you have the permissions or not. Then, enable the workflow using the toggle switch.
Just click on “Run Now” to run the workflow and create the pipeline.
Then deactivate the workflow so that it doesn’t run again.
Click on “Pick the template” from the editor menu.
Select “Activate DynamoDB export pipeline”.
Pick “Activate DynamoDB export pipeline” from the list and you will see the following template setup for you.
You know the drill. Set it up as done earlier.
Select the same AWS account and region as done earlier.
This node filters out the data pipeline we created earlier. Leave it as it is.
Select the same AWS account and region as done earlier.
Set up an email or slack notification as done earlier.
Just add the email or slack channel you want to get notified on once the workflow is complete.
“Save Node” and click on “Run Now”. This should show you the result about the workflow, how it ran and what it did.
Next, Save the workflow to check if you have the permissions or not. Then, enable the workflow using the toggle switch.
Just click on “Run Now” to run the workflow and define the pipeline we created earlier.
Then deactivate the workflow so that it doesn’t run again.
Now go to the AWS console to see the progress. It takes around 7 minutes to get the EMR setup and then the transfer begins. Here’s some more information on the same provided by AWS.
There are templates available for the following use cases as mentioned below.
TotalCloud is workflow-based cloud management for AWS. We are modularizing cloud management to make it accessible to everyone.