Migrate Droplet from DO to AWS using AWS Migration Application Service (MGN)
Source: Dev.to
Preparation
Before you begin, make sure you have the following information and permissions:
- AWS Account – activated and authorized to create EC2, VPC, and MGN resources.
- DigitalOcean Account – root SSH access to the Droplet you want to migrate.
- AWS IAM User – an IAM user with the
AWSApplicationMigrationAgentInstallationPolicypermission. Use this user to obtain an Access Key ID and Secret Access Key.
Step 1: Initialize the VPC
- Open the AWS console and navigate to VPC → Create VPC.
- Configure the VPC with the desired CIDR block, name, and other settings.
- After creation, verify that the VPC appears in the VPC dashboard.
Step 2: Initialize AWS MGN
If this is your first time using MGN in the selected region:
- Log in to the AWS console.
- Search for AWS Application Migration Service and select it.
- Click Get started to initialize the service.
Replication Settings
-
On the Replication settings screen, click Edit.
-
Configure the template for the replication instance:
- Staging area subnet – select the subnet in the VPC that will receive temporary data.
- Replication Server instance type – choose an instance type comparable to your DigitalOcean Droplet.
- Leave the remaining options at their defaults.
-
Click Save template.
Launch Template
- Go to Launch template → Edit.
- Uncheck Activate instance type right‑sizing to customize the configuration.
- Select the desired security group (SG) and instance type, then save.
Step 3: Install the Replication Agent on the DigitalOcean Droplet
Note: Back up your Droplet before proceeding.
- SSH into the Droplet as
rootand, if needed, change the root password. - In the AWS MGN console, open Source servers and click Add server.
- Choose the operating system (e.g., Linux) and copy the two commands shown by AWS.
# Download the installer
sudo wget -O ./aws-replication-installer-init https://aws-application-migration-service-ap-southeast-1.s3.ap-southeast-1.amazonaws.com/latest/linux/aws-replication-installer-init
# Make it executable and run it (replace the region if needed)
sudo chmod +x aws-replication-installer-init
sudo ./aws-replication-installer-init --region ap-southeast-1
- When prompted, enter the Access Key ID and Secret Access Key you created earlier, and select the disk to sync.
- The installation takes ~5‑10 minutes; the replication agent will then begin replicating data to AWS.
Step 4: Configure Launch Settings (Target Server)
-
After the agent is installed, the Droplet appears in Source servers with an Initial Sync in progress.
-
Click the server name, then select the Launch settings tab.
-
In the EC2 Launch Template section, click Edit and adjust the following:
- Instance Type – e.g.,
t3.medium,c5.large, etc. - Subnet – choose the subnet where the EC2 instance will run.
- Instance Type – e.g.,
-
Save the launch template.
Step 5: Launch Test Instance
5.1 Launch Test Instance
- Wait until the replication status shows “Ready for testing” and Data replication is “Healthy.”
- Select the server → Test and cutover → Launch test instances.
- The lifecycle status changes to “Test in progress.”
5.2 Verify Test Instance
- After the test instance launches, MGN displays a notification.
- In the EC2 console, you’ll see an instance with a hostname similar to the source server.
- To view the launch log, go to MGN → Launch history.
5.3 Launch Cutover
- In MGN, select the server → Test and cutover → Mark as Ready for cutover (this deletes the test instance).
- When the lifecycle shows “Ready for cutover,” click Launch cutover instances.
5.4 Verify the Cutover Process
- The new EC2 instance is created from the snapshots replicated earlier and follows the configuration defined in the launch template.
- Confirm that the application and data are functioning as expected on the EC2 instance.
5.5 Finalize Cutover
- Once verification is complete, you can decommission the original DigitalOcean Droplet.
Further troubleshooting and lessons learned from the migration will be covered in a later article. Thank you for reading.