How to Migrate a Physical Server Directly to AWS EC2?

A practical guide to moving a physical server to AWS EC2, covering MGN workflow, prerequisites, unsupported shortcuts, bandwidth planning, troubleshooting, and when image-based conversion is the better choice.

Free Download
for VM, OS, DB, File, NAS, etc.
amelia-luo

Updated by Amelia Luo on 2026/12/04

Table of contents
  • Key Takeaways

  • What Does "Direct Migration" to EC2 Mean?

  • How AWS MGN Migrates a Physical Server

  • Pre-Migration Checklist

  • Physical Server to EC2 Workflow (AWS MGN)

  • Bandwidth and Cutover Estimation

  • Migration Methods Compared

  • Where Vinchin Fits

  • Troubleshooting Table

  • Best Practices and Common Mistakes

  • FAQs

  • Conclusion

The most direct supported route is block-level replication with AWS Application Migration Service (MGN). You install an agent on the physical server, let it replicate disks to AWS, launch a test instance, then cut over. Backup-image-based tools can also restore a physical server straight to EC2. Exporting the server to a VMDK/VHD and importing it with VM Import/Export is not supported for physical-to-virtual conversions.

Key Takeaways

What Does "Direct Migration" to EC2 Mean?

It means moving the server's operating system, applications, and data to an EC2 instance as a single unit (rehost, or "lift and shift"), without reinstalling or reconfiguring the application.

In practice, a "direct" physical-to-EC2 migration usually takes one of three routes:

  1. Agent-based block replication (AWS MGN).

  2. Image-based conversion from a backup of the physical server.

  3. Disk export, then import with VM Import/Export. This is the route AWS does not support for physical sources (see below).

Re-platforming or rebuilding the application on a fresh EC2 instance is a different strategy and is not covered here.

How AWS MGN Migrates a Physical Server

MGN installs an agent on the source, copies every disk block to low-cost staging resources in your AWS account, then converts the replicated data into a bootable EC2 instance at launch.

According to AWS, the service creates a staging area subnet with lightweight EC2 replication servers and staging EBS volumes. The agent sends data from the source to the replication servers, which write it to the EBS volumes. Replication has two stages: an initial sync of existing data, then continuous replication of new writes.

Pre-Migration Checklist

Check four things before installing anything: OS support, disk and memory headroom, network paths, and the application's own dependencies.

Check Requirement Source
Architecture x86 only MGN docs                
OS Must be on the supported Windows/Linux list (depends on version and Region) MGN docs                
Disk space At least 2 GB free on / (Linux). 500 MB free on /tmp during install Install requirements, agent troubleshooting                
Memory At least 300 MB free RAM for the agent MGN docs                
Volume size Maximum 16 TB per volume MGN docs                
Linux Python installed. Matching kernel-devel packages must be available MGN docs                
Windows .NET Framework 3.5 or later. Mount points need a drive letter Agent troubleshooting, MGN docs                
Network TCP 443 outbound to MGN and S3. TCP 1500 to the staging subnet Network requirements                

MGN derives the source server's unique ID from its MAC address. If the MAC changes (for example after a NIC replacement), the service can no longer identify the server correctly. Freeze hardware changes during replication.

MGN works at the server level and is not cluster-aware. Clustered applications need extra steps after cutover.

Physical Server to EC2 Workflow (AWS MGN)

The sequence below follows the AWS migration workflow. Console labels may change between releases.

Step 1. Initialize MGN in the target Region

Open the MGN console in the Region where the instance will run. Complete the replication settings template, including the staging area subnet.

Step 2. Open the network paths

Allow TCP 443 from the source to the MGN endpoint and S3, and TCP 1500 from the source to the staging subnet. For private connectivity, AWS supports VPN, Direct Connect, VPC peering or PrivateLink.

Failure-prone step: if the "Use VPN" setting in the replication template does not match your real path, the agent cannot reach the replication server (AWS troubleshooting).

Step 3. Install the AWS Replication Agent

Run the installer on the physical server with root or sudo rights (Linux) or as administrator (Windows). Use the installer command shown in the AWS documentation for your OS and Region. Do not copy commands from old blog posts.

Step 4. Wait for initial sync

The server stays in Not ready until initial sync finishes, then moves to Ready for testing with Healthy replication status (lifecycle states). Servers re-run initial sync after a network disconnect.

Step 5. Review launch settings

Set instance type, subnet, security groups, and disk types. Size the instance from the source server's real CPU, memory and I/O, not from the old chassis.

Step 6. Launch a test instance

Connect by RDP or SSH. Validate boot, network, services, and application behavior. Mark the server "Ready for cutover" when done.

Step 7. Plan and launch cutover

Schedule a maintenance window. Quiesce the application and let the last writes replicate. Launch the cutover instance. Each new cutover deletes any earlier test instance. AWS recommends turning on EC2 termination protection before you finalize.

Step 8. Finalize and clean up

Finalizing the cutover stops replication, discards replicated data, terminates replication resources, and tells the agent to uninstall itself (quick start). Archive the source only after production validation.

Bandwidth and Cutover Estimation

Before choosing a method, measure three values: used source data, effective throughput to the AWS staging subnet, and peak application write rate. Estimate initial-sync time from used data and the link capacity left over after writes. Then use the replication lag seen during testing to set the cutover window.

AWS ties bandwidth sizing to the source server's write activity. It says the bandwidth needed on TCP 1500 should be based on the source servers' write speed. Its migration-at-scale guidance says total storage and daily change rate determine whether bandwidth is sufficient.

Step 1. Measure the inputs

Input Symbol How to get it
Used source data D Sum of used capacity across replicated disks. Use provisioned size as a conservative upper bound if unsure
Effective throughput B Test a sustained transfer from the source network to AWS over the real path (VPN, Direct Connect, or internet). Do not use the nominal link speed
Peak write rate W Measure during business peaks and batch jobs. AWS points to OS tools such as Windows Performance Monitor's Avg. Disk Bytes/Write counter (AWS troubleshooting)

Convert everything to the same unit (for example, bits per second) before calculating.

Step 2. Check feasibility first

The link carries both the backlog and new writes. If B is not clearly above W, the backlog never shrinks.

  • Condition: B must stay above W.

  • Margin: pick a planning margin, such as requiring B to be at least 2× W as a conservative starting point. This is a planning heuristic, not an AWS requirement.

  • If it fails: do not start replication. Raise throughput, reduce write load (for example, defer batch jobs), or choose a different method.

Step 3. Estimate initial-sync time

T_sync ≈ D ÷ (B − W) × (1 + m)

Here m is the contingency for protocol overhead and link variability. The result is a planning estimate, not a guarantee.

Worked example (illustrative arithmetic, not a benchmark):

Value Figure
Used data (D) 2 TB (1.6 × 10¹³ bits)
Measured effective throughput (B) 400 Mbps
Peak write rate (W) 50 Mbps
Spare capacity (B − W) 350 Mbps
Base sync time about 12.7 hours
With 30% contingency (m = 0.3) about 16.5 hours

Step 4. Size the final-sync and cutover window

After testing begins, the server is replicating continuously. At cutover:

  1. Quiesce the application. Writes stop, so W drops to roughly zero.

  2. Drain the remaining backlog. Time is about backlog ÷ B. Observe the replication lag in the console and monitoring during the test phase, and use the worst value you saw (check your current console for the lag indicator).

  3. Add launch and validation time. Measure how long the test instance took to launch, boot and pass checks. Reuse that figure.

  4. Add the switch-over steps, such as DNS changes and dependent-system updates.

Cutover window ≈ drain time + instance launch/boot + validation + switch-over steps, plus your own buffer.

Step 5. Fit the plan inside the free period

The MGN free period of 2,160 hours per server starts at agent installation and runs during active replication. Initial sync, test cycles, waiting for the change window, and cutover must all fit inside it. Servers still replicating afterward are charged hourly.

Step 6. Budget what MGN does not cover

Cost item Notes
MGN service Free for 2,160 hours per server, then hourly (pricing)
Replication servers (EC2) Billed during replication, including the free period
Staging EBS volumes Billed during replication, including the free period
Test and cutover instances EC2 and EBS charged once launched (FAQ)
Connectivity VPN or Direct Connect is a separate project and cost. Check AWS pricing for your option

Migration Methods Compared

Choose by source OS support first. Then use the bandwidth and cutover estimate above to test whether your link and downtime window can support each method.

Method Fits when Key limitation
AWS MGN (agent, block-level) Source OS is supported, and bandwidth is adequate OS, x86, and 16 TB volume limits. Not cluster-aware
Backup-image-based P2C (e.g., Vinchin) You also need backups, want a retained rollback image, or prefer restoring from an image Target platforms and OS depend on the tool and version. Verify before committing
VM Import/Export The source is already a virtual machine P2V-converted VMs are not supported                
Rebuild and redeploy The application is stateless or config-light Highest effort. Not a lift-and-shift

Decision matrix

Your measured situation Likely best fit
Supported OS, B comfortably above W, and the estimated T_sync and cutover window fit your change calendar AWS MGN
B is close to W, or the final-sync window exceeds your downtime limit Reduce write load or improve the link first. Otherwise consider a backup-image-based approach, where the full copy runs from an image and does not depend on continuous replication
You need retained backup images for rollback or ongoing protection Backup-based P2C
OS or kernel is not on the MGN supported list Check the alternative tool's supported list; otherwise rebuild
Server is already virtualized VM Import/Export or MGN

Where Vinchin Fits

If you already back up physical servers, an image-based path can reuse that work. Vinchin's P2C migration captures a Windows or Linux physical server as an image through an agent, and restores it directly to a cloud target. Its FAQ lists AWS EC2 and Huawei ECS as the currently supported P2C targets. It also states you can keep the pre-migration image to restore to physical hardware if needed. Its step-by-step Amazon EC2 P2C tutorial covers the exact procedure for your product version.

High-level flow:

  1. Install the Vinchin agent on the source and back up the server (image-level, with a consistent snapshot).

  2. Run a P2C restore job to Amazon EC2.

  3. Validate the instance in isolation, then cut over.

  4. Retain the image until production is confirmed stable.

Download Free TrialFor Multi Hypervisors ↖        
* Free Secure Download

Troubleshooting Table

Symptom Likely cause Fix
Agent install fails on Linux Under 500 MB free on /tmp, missing kernel-devel, unsupported OS Free space, install matching packages, check the OS list                
Agent install fails on Windows .NET below 3.5, low disk space on C:\ Install .NET, free space
Server not appearing in console Port 443 blocked to MGN endpoint Open firewall or use PrivateLink (guide)
Stuck in "Not ready" Port 1500 blocked, or bandwidth lower than write rate Verify the path to the staging subnet. Recalculate bandwidth
Server re-syncs repeatedly Network disconnects (initial sync reruns) Stabilize the link
Agent rejects a disk Volume exceeds 16 TB Resize or split data first
Windows volume missing Mounted as a folder instead of a drive letter Assign a drive letter
Source seen as a new server MAC address changed Avoid NIC changes mid-migration
Cluster node fails post-cutover MGN is not cluster-aware Apply post-cutover cluster steps

Best Practices and Common Mistakes

Best practices

  • Pilot one low-risk server first.

  • Keep the source untouched until after finalization, so the physical server remains your rollback.

  • Replace hardware-bound agents and management tools after migration (e.g., vendor RAID utilities).

  • Right-size instances using real utilization, not old chassis specs.

Common mistakes

  • Skipping the test instance.

  • Installing agents on all servers at once on a thin link.

  • Assuming the exported-disk route works for physical sources.

  • Migrating clustered databases as independent servers.

FAQs

Q1: Does the source server need to reboot?
AWS states MGN does not require source server reboots. Windows agent behavior varies by version, so check current notes.

Q2: Can I migrate without sending data over the public internet?
Yes. AWS documents private connectivity options such as VPN, Direct Connect, and VPC peering.

Q3: Can I roll back to the physical server after cutover?
Only if the source is left unchanged. Data written on EC2 after cutover is not synchronized back automatically. This is a consequence of one-way replication, so plan a data return step if rollback matters.

Q4: Will ARM-based physical hardware work?
MGN supports only OSes built for x86 (docs).

Q5: Does end-of-life Windows work with VM Import/Export?
Support depends on version and date. AWS notes it is deprecating i386 and end-of-life OS support in 2026. This depends on the platform and version, so check the page before relying on it.

Q6: What happens to the free period if I pause?
AWS says the free period continues during active replication. Servers not migrated within it are charged hourly while still replicating (FAQ).

Q7: Does Vinchin's P2C support every Linux distribution?
No assumption should be made. Supported OS lists differ by product version, so confirm in the current release notes before planning.

Conclusion

Moving a physical server to EC2 comes down to one question: which tool can convert this server's drivers and boot setup for AWS? Use MGN where the OS is supported and bandwidth is adequate, consider image-based conversion where backups and rollback matter, and avoid disk-export shortcuts. Test first, stage agents by bandwidth, and keep the source intact until validated.


Share on:

Categories: VM Migration