Lesson 1 of 6 Migration Execution

Rehosting Servers with AWS Application Migration Service

This lesson explains how AWS Application Migration Service (AWS MGN), the primary tool for rehosting servers on AWS, replicates and launches servers with minimal downtime and little manual work.

Learning outcomes

After completing this lesson, you will be able to:

  • Describe how MGN replicates servers and launches test and cutover instances.
  • Describe launch templates and post-launch actions.
  • Identify related tools such as VM Import/Export.

How MGN works

The AWS Replication Agent is installed on each source server, whether physical, virtual or in another cloud; for vCenter environments, agentless replication is also available. MGN then continuously replicates the servers' block storage to a staging area subnet in the target account, using low-cost replication servers and EBS volumes, so the replica is always only seconds behind the source while the source keeps running.

At any time, test instances can be launched from the replicated data to run acceptance tests, without affecting replication. At cutover, the source is stopped, replication catches up, and cutover instances are launched and finalised, so the downtime is measured in minutes rather than the hours a full copy would take.

Configuration and scale

Launch templates define how each server's EC2 instance is created: instance type, subnet, security groups and licensing. Post-launch actions run Systems Manager documents on the new instances, for example to install the CloudWatch and SSM agents, remove on-premises software that is no longer needed, or change configuration for the new environment, so every migrated server ends up in the same state.

Large migrations are organised into applications and waves within MGN, with server lists imported in bulk, so hundreds of servers are tested and cut over as groups. Replication traffic is encrypted and can use private connectivity over Direct Connect or VPN, so it never crosses the internet.

Related tools

Alongside Application Migration Service, four tools cover particular cases. VM Import/Export converts existing virtual machine images into AMIs, which suits one-off imports of a few images rather than continuous replication. App2Container analyses running .NET and Java applications and packages them as containers, with the files needed to deploy them on ECS or EKS. AWS Transform uses AI agents to accelerate the modernisation of VMware, mainframe and .NET workloads. Elastic Disaster Recovery uses the same block-level replication technology as Application Migration Service, but for ongoing disaster recovery rather than a one-time move. The following table summarises the tools.

ToolUse
VM Import/ExportConverts VM images to AMIs
App2ContainerContainerises .NET and Java applications
AWS TransformAccelerates VMware, mainframe and .NET modernisation
Elastic Disaster RecoverySame replication technology, for DR
Worked example

A cutover weekend with MGN

Wave 2 contains 16 servers. Replication has run for two weeks and test instances passed acceptance testing. The cutover follows a scripted timeline:

Friday 18:00   Confirm all source servers show "Healthy" replication, lag in seconds
Friday 20:00   Stop application services on premises (data stops changing)
Friday 20:15   Wait for final replication (lag 0), then launch cutover instances:
                 aws mgn start-cutover --source-server-ids s-1111 s-2222 ...
Friday 20:45   Post-launch actions install CloudWatch/SSM agents, remove on-prem backup agent
Friday 21:00   Smoke tests; switch DNS (Route 53 records, low TTLs set a week earlier)
Saturday 09:00 Business validation; rollback = point DNS back, restart on-prem services
Sunday 18:00   Finalise:  aws mgn finalize-cutover --source-server-id s-1111   (stops replication)

Downtime is limited to the window between stopping services and switching DNS. Keeping the on-premises servers intact until finalisation is the rollback plan. Lowering DNS TTLs days in advance is a small step that often decides how quickly users reach the new environment.

Check yourself

How can a migrated server be tested before cutover without interrupting replication?

Show answer

Launch a test instance from the replicated data in Application Migration Service; replication continues while acceptance tests run.

Exam Tips

Remember for the exam

  • To rehost hundreds of servers with minutes of downtime, use Application Migration Service (MGN).
  • To run configuration steps automatically after launch, use MGN post-launch actions.
  • To keep replication traffic off the internet, use MGN's private connectivity setting.
  • To test migrated servers without stopping replication, launch MGN test instances.
  • To containerise an existing Java or .NET application, use App2Container.