Skip to main content

Command Palette

Search for a command to run...

On-premise Server Migration to AWS using AWS Application Migration Service (MGN)

Updated
5 min read
On-premise Server Migration to AWS using AWS Application Migration Service (MGN)
A

I'm AWS Certified Solution Architect. I do write about the AWS Cloud Operation, Migration, Security and Automations.

Introduction:

Migrating physical or virtual machines from on-premises to AWS can feel scary but AWS Application Migration Service (MGN) makes it straightforward by continuously replicating servers to AWS and enabling test launches and cutovers with minimal downtime. Let’s start from planning to post-cutover validation.

Architecture Diagram

Procedure:

Step 1: Configure replication in AWS MGN

  • Open the AWS Application Migration Service console.

Confirm Replication settings:

  • Under settings select the Replication template and click on edit.

  • Select the subnet for replication instance and instance type based on your requirement.

  • Choose EBS volume type and Encryption method.

  • Save the template

Now, Select the Lunch template under Settings.

  • Edit the template

  • Choose the EBS volume type, security group and EBS volume type

  • Save the template.

Under Post-launch template

  • Select the install the system manager agent and allow exectuting actions on launch servers.

  • Also, choose the Deployment option for agent to be installed on.

  • save the template.

Step 2: Agent installation

The agent registers the server to your MGN service and starts sending block-level data to replication servers in your AWS account .

Now, Select the Source servers and click on Add server.

  • Select the Operating system, replication preferences and

  • Provide the AWS Access key ID and Secret Access Key, you can generate form IAM if you haven’t generated it yet.

  • Copy the Installer link and paste on the browser of your physical machine, it will download an installer file.

Note: remember you need to download the exe file not .sha512

  • Copy the Command below the installer download link and paste on the same directory where your installer is downloaded.

  • In the MGN Console you should see the source server appear (with a discovered source ID).

  • Wait for the lifecycle to complete

  • Wait until replication progress is 100%.

  • We can see the specification of physical machine on the server info

  • After successful replication, the Lifecycle moves to Ready for testing stage.

  • The new ec2 server creation for AWS Migration Service Replication Server is visible.

Step 3: Verifying the Templates

On the AWS Application and Migration Serve on source server

  • Go to the launch settings and modify EC2 launch Template

  • It will redirect to the EC2 launch template

  • Under Key Pair select or create a new key pair

  • Under Advanced network configuration Enable Auto-assign public IP

  • Select the template and choose Set default version from the Action

  • Choose the recent version

  • It’s now visible that default version is changed to 3 from 2.

Step 4: Launch the Testing Instance

On the Migration Dashboard

  • Select Test and cutover and as Lifecycle is Ready for testing, Lunch test instances.

  • Lunch the test instance

  • View the events on the launch history on the left sidebar, wait until it’s completed.

  • The job logs and Lifecycle for an update.

  • As the test instance is launched, now open the RDP port of the instance and you can connect it through the RPD

  • Select the test instance and under Security

  • Click on security group, edit it and

  • Add the RDP port.

  • Select the instance and click on connect

  • Only copy the public DNS and use the username and password of the On-prem server.

  • All the files of on-premises on the ec2 test-instance is replicated, if everything is Perfect, we will start the final cutover.

Step 5: Lunch Final Cutover Instance.

  • Go back to AWS Application Migration server and mark ready for cutover.

  • If you find something unusual or all your data was not migrated, you can Revert to “Ready for testing“ and ensure sync completed before “Lunch Test Instances”.

  • You can see that when you changed to Ready for cutover the Test-Instance is automatically deleted.

    Now for Cutover,

  1. Schedule downtime or maintenance window for the application (short maintenance window reduces final delta).

  2. In MGN Console, Perform Cutover for selected servers:

    • MGN will perform a final sync (brief pause for consistent state).

    • Launch the target EC2 instance(s) in AWS.

  • As the Lifecycle moves to the Ready for cutover,

  • From the Test and cutover option, click on “Lunch cutover instance”

  • Wait until the cutover is completed. Meanwhile you can see the Jobs and logs from lunch history

  • Job logs.

  • After the Cutover is completed, as we can see on the Lunch history.

  • We can see that the Final instance has been created on the EC2 Instances.

  • Now, we need to finalize the cutover after testing the Instance so that we can shutdown the source and Replication server.

  • Click on the Finalize cutover from the “Test and Cutover” Option.

  • Lifecycle transition from the Cutover in profess to Cutover complete after Finalize.

  • After everything is completed next step is mark as archived the source server as it is already disconnected from the service when we finalize the cutover.

  • we can see that only one instance is running tha is our final Cutover Production server migrated from the on-premises. Let’s connect it through the RDP

  • Copy the public-dns of the server and use the on-premises username and Password.

we have migrated the On-premise server to the AWS using AWS Application Migration Service (MGN).

Final tips and best practices

  • Start small: do with a noncritical server to learn the process.

  • Document everything: replication settings, custom drivers, any changes to server configurations.

Conclusion

AWS Application Migration Service (MGN) simplifies moving on-prem servers to AWS by providing continuous block-level replication, safe test launches, and an easy cutover path. With good planning and careful testing, we can migrate mission-critical workloads with minimal downtime with predictable results.

More from this blog

Abishek Gautam | Cloud & DevOps

15 posts

Hands-on blogs on AWS Cloud, DevOps, migration, monitoring, security, and real-world architectures.