Application Migration Service (MGN)
Use AWS MGN to continuously replicate on-premises servers to AWS and perform non-disruptive test cutover before the final migration window.
Application Migration Service (MGN) is a free AWS Solutions Architect lesson on CoddyKit — lesson 3 of 4. You can read the complete lesson below for free — then practise it hands-on in the browser with a built-in code editor and a 24/7 AI tutor. It is part of the AWS Solutions Architect learning path, one of 4 lessons in the course, and your progress syncs across the web and the CoddyKit app.
What Is AWS MGN?
AWS Application Migration Service (MGN) is the primary AWS service for rehosting (lifting and shifting) on-premises servers — physical or virtual — to Amazon EC2. MGN continuously replicates source servers to a staging area in AWS, so when you are ready to migrate, the cutover window is very short (minutes rather than hours). MGN supports Windows and Linux servers from any hypervisor or bare-metal environment.
MGN Architecture: Continuous Replication
MGN installs a lightweight AWS Replication Agent on each source server. The agent establishes an encrypted connection over TCP port 1500 and continuously replicates block-level disk changes to a staging area in your target AWS Region. The staging area consists of low-cost Replication Servers (automatically launched by MGN) and EBS volumes that mirror the source disks in near-real time. No downtime occurs during replication.
# Install the MGN Replication Agent on a Linux source server
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 <ACCESS_KEY> \
--aws-secret-access-key <SECRET_KEY>Launch Templates in MGN
Each source server has a Launch Template that defines how the migrated EC2 instance will be configured: instance type, subnet, security groups, IAM instance profile, EBS volume types, and whether a public IP is assigned. You configure the launch template before testing. MGN uses this template when it launches a test or cutover instance from the replicated EBS snapshots.
# View and modify a source server's MGN launch template settings
aws mgn update-launch-configuration \
--source-server-id s-12345678 \
--instance-type t3.medium \
--launch-disposition STARTED \
--target-instance-type-right-sizing-method NONETesting: Non-Disruptive Test Cutover
MGN's Test phase lets you launch a test EC2 instance from the most recent replicated snapshot without stopping the source server. Run application smoke tests, validate network connectivity, and verify that the migrated server boots and responds correctly in AWS. After testing, you terminate the test instance and replication continues — there is zero impact on the live source during the test.
# Launch a test instance for a source server
aws mgn start-test \
--source-server-ids '["s-12345678"]'
# After validating, mark the test as complete and clean up
aws mgn finalize-cutover \
--source-server-ids '["s-12345678"]'Cutover: Performing the Migration
When you are confident after testing, initiate the cutover. MGN takes a final snapshot of the source disks, launches the cutover EC2 instance, and the source server stops receiving new write replications. You update DNS to point to the new EC2 instance. The entire cutover window — from triggering cutover to the new EC2 instance being live — is typically under 15 minutes, enabling very short maintenance windows.
# Initiate cutover for a source server
aws mgn start-cutover \
--source-server-ids '["s-12345678"]'
# After verifying the new EC2 instance is healthy,
# finalize to stop billing for replication resources
aws mgn finalize-cutover \
--source-server-ids '["s-12345678"]'Post-Launch Actions
MGN supports Post-Launch Actions — scripts that automatically execute on the migrated EC2 instance immediately after launch. Use these to install monitoring agents (CloudWatch Agent, SSM Agent), apply security baseline configurations, register the instance with internal CMDB systems, or run validation health checks. Post-launch actions are attached to a launch template and run via Systems Manager Run Command, reducing manual post-migration steps.
# Add a post-launch action to install the CloudWatch Agent
aws mgn put-source-server-action \
--source-server-id s-12345678 \
--action-id 'InstallCWAgent' \
--action-name 'Install CloudWatch Agent' \
--ssm-document '{
"actionName": "AWS-ConfigureAWSPackage",
"parameters": {
"action": {"type": "EnumList", "default": ["Install"]},
"name": {"type": "StringList", "default": ["AmazonCloudWatchAgent"]}
}
}'MGN vs SMS (Server Migration Service)
AWS previously offered Server Migration Service (SMS) for server migration. MGN is its successor and is now the recommended service. Key improvements in MGN: it replicates at the block level (not snapshot level), enabling near-real-time continuous replication rather than periodic snapshots; it supports a wider range of source environments; and it provides the non-disruptive test cutover workflow. If an exam question mentions SMS as an option, prefer MGN unless the question is specifically about SMS.
Bandwidth and Network Requirements
MGN replicates over an encrypted TLS connection on port 1500 to the Replication Server in the staging area. The initial replication syncs all source disk data, which can be bandwidth-intensive. For large servers in data centres with limited internet bandwidth, consider using AWS Direct Connect or AWS Site-to-Site VPN to carry replication traffic instead of the public internet. After the initial sync, only incremental block changes are sent.
Pricing Model
MGN has a simple pricing model: free for the first 90 days per server, then a per-server-per-hour charge after that. The staging area incurs charges for Replication Server EC2 instances (typically t3.small) and the EBS volumes replicating the source disks. Minimising the total replication duration by testing and cutting over promptly keeps costs low. There is no charge for the MGN Agent itself.
Common MGN Exam Scenarios
For the SAA-C03 exam, MGN appears in scenarios that need fast, low-risk server migration. Key signals: rehost with minimal downtime, lift-and-shift hundreds of servers, short cutover window, no application changes. Contrast with DMS (database migration), Snowball (bulk data transfer with no active server), and Glue/DataSync (data movement between storage services). MGN is for servers, not databases or pure data transfers.
MGN with Application Groups
For multi-tier applications (web, app, database servers that must migrate together), MGN supports Wave and Application groupings. You group source servers into an application, then launch test and cutover for the entire group in sequence, ensuring dependent tiers come up in the right order. This prevents the classic failure of migrating a web server before its database server is available in AWS.
# Group source servers into an application in MGN
aws mgn create-application \
--name 'OrderManagementSystem'
aws mgn associate-source-servers \
--application-id 'app-12345678' \
--source-server-ids '["s-web01", "s-app01", "s-db01"]'Quick Check
Test your understanding of AWS Solutions Architect (SAA-C03) concepts from this lesson.
Lesson Recap
In this lesson you learned: MGN provides continuous block-level replication from on-premises servers to AWS for near-zero-downtime cutover, the non-disruptive test feature lets you validate migrated servers without stopping the source, and Post-Launch Actions automate post-migration configuration via Systems Manager. Next up we explore Database Migration Service for database-specific migration scenarios.
Frequently asked questions
Is the “Application Migration Service (MGN)” lesson free?
Yes — the full text of “Application Migration Service (MGN)” is free to read here on the web, and the AWS Solutions Architect course includes 4 lessons in total. To practise it interactively (a built-in code editor and a 24/7 AI tutor) and unlock the rest of the AWS Solutions Architect course, upgrade to CoddyKit PRO.
What will I learn in “Application Migration Service (MGN)”?
Use AWS MGN to continuously replicate on-premises servers to AWS and perform non-disruptive test cutover before the final migration window. You practise AWS Solutions Architect with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.
Do I need any experience to start AWS Solutions Architect?
No prior experience is required. AWS Solutions Architect on CoddyKit is structured for beginners through advanced learners; this is — lesson 3 of 4, so you can start here or from the beginning and move at your own pace.
How long does the “Application Migration Service (MGN)” lesson take?
Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.
Can I write and run code in this AWS Solutions Architect lesson?
Yes. Every AWS Solutions Architect lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.
All lessons in this course
- The 7 Rs of Migration Strategy
- AWS Migration Hub and Application Discovery Service
- Application Migration Service (MGN)
- Database Migration Service (DMS) and Schema Conversion Tool