Ace Cloud Interviews
Home/AWS Tutorial/Application Migration Service
🚚

AWS Migration & Transfer

Application Migration Service

Lift-and-shift physical, virtual, and cloud servers to AWS automatically

AWS Application Migration Service (MGN) automates lift-and-shift migrations of physical servers, virtual machines, and cloud instances to AWS by continuously replicating block-level data using a lightweight agent. It replaces the older CloudEndure Migration service and is the recommended path for rehosting workloads without modification. For cloud engineers, MGN dramatically reduces the risk of server migrations by allowing unlimited test launches before cutover.

How MGN Replicates Servers

MGN installs a replication agent on each source server. The agent continuously replicates block-level changes to a staging area in your AWS account. When you are ready to cut over, MGN converts the replicated data to a native EC2 instance.

StageWhat HappensImpact on Source
Initial SyncFull disk snapshot replicated to staging EBS volumes in AWSCPU and I/O spike during initial sync (typically 1-4 hours)
Continuous ReplicationBlock-level changes streamed via TCP 1500 to AWS replication serversMinimal - agent uses ~1% CPU at steady state
Test LaunchMGN boots a test EC2 instance from replicated data - source keeps runningNone - source is untouched
CutoverStop source workload, final sync, MGN converts and launches production EC2Source goes offline
💡

You can perform unlimited test launches before committing to cutover. Test launches spin up in minutes and are billed as normal EC2. Use this to validate application compatibility, networking, and performance before your maintenance window.

Agent Installation and Source Server Requirements

The MGN agent runs on Linux and Windows. It requires outbound TCP 443 and TCP 1500 to AWS replication endpoints.

bash
# Linux agent installation
wget -O ./aws-replication-installer-init.py \
  https://aws-application-migration-service-us-east-1.s3.amazonaws.com/latest/linux/aws-replication-installer-init.py

python3 aws-replication-installer-init.py \
  --region us-east-1 \
  --aws-access-key-id AKIAIOSFODNN7EXAMPLE \
  --aws-secret-access-key wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
OS SupportNotes
Linux (RHEL, CentOS, Ubuntu, SUSE, Amazon Linux)Kernel 2.6.32+ required
Windows Server 2003 - 2022PowerShell 3.0+ required
AIX, HP-UX, SolarisNot supported - use Storage Gateway or manual migration
⚠️

The IAM user or role used during agent installation only needs AWSApplicationMigrationAgentPolicy. Do not use admin credentials on source servers. Rotate these credentials after all agents are installed.

EC2 Launch Template Configuration

Before test launch or cutover, configure the EC2 launch template for each source server. This defines how MGN will convert the replicated disk into an EC2 instance.

SettingGuidance
Instance typeMatch or right-size from source specs. Use Compute Optimizer recommendations after first test launch.
SubnetChoose a private subnet. Never launch migrated servers directly into a public subnet.
Security groupsPre-create SGs matching source firewall rules. MGN does not migrate firewall rules automatically.
EBS volume typegp3 for most workloads. io2 for databases requiring sustained high IOPS.
IAM instance profileAssign SSM agent role so you can connect without bastion hosts after cutover.
💡

MGN's post-launch actions let you run SSM documents or scripts automatically after each test launch or cutover. Use this to join the instance to your domain, configure monitoring agents, or run smoke tests automatically.

Test Launch vs Cutover: The Migration Workflow

The recommended workflow separates testing from the actual cutover to minimize risk. Never skip test launches - they catch OS-level incompatibilities that only appear when the workload boots on EC2.

StepActionOutcome
1Install agents on all source serversServers appear in MGN console as "Not ready"
2Wait for initial sync to completeStatus changes to "Ready for testing"
3Configure launch templatesInstance type, networking, storage defined
4Launch test instanceEC2 instance boots from replicated data alongside source
5Validate application, networking, performanceSign off before scheduling cutover window
6Mark as "Ready for cutover"Finalizes configuration, disables further changes
7Stop source workload, initiate cutoverFinal delta sync (seconds to minutes), EC2 launched
8Finalize migrationCleans up staging resources, stops billing for replication
⚠️

If you finalize the migration without disabling the agent on the source first, you may accidentally trigger replication in reverse. Always uninstall the MGN agent from source servers after a successful cutover.

MGN Pricing and Cost Optimization

MGN has no per-server licensing fee from AWS. You pay only for the staging area resources used during replication.

Cost ComponentDetail
MGN service feeFree for the first 90 days per source server
After 90 days$0.042/hr per source server actively replicating
Staging area storageEBS volumes at standard gp3 rates (~$0.08/GB/month)
Staging EC2 instancesOne t3.small replication server per source region (~$0.021/hr)
Data transfer inFree - ingress to AWS is not charged
💡

Finalize migrations promptly after cutover. Every day a source server stays in "Replicated" state beyond 90 days costs money. Automate finalization with EventBridge rules that trigger after a successful cutover.

🎯

Interview Focus Points

  • 1What is the difference between AWS MGN and AWS SMS (Server Migration Service)?
  • 2How does block-level replication differ from snapshot-based migration and why does it matter for RPO/RTO?
  • 3Walk me through the complete MGN migration workflow from agent installation to cutover finalization.
  • 4How do you minimize downtime during MGN cutover for a database server?
  • 5What networking requirements must be met for the MGN replication agent to reach AWS?
  • 6How would you migrate 200 servers to AWS in 60 days using MGN? What is your sequencing approach?
  • 7What are MGN post-launch actions and how would you use them to automate post-migration configuration?
  • 8How do you handle applications that span multiple servers (app tier + database tier) during cutover?