Selecting the Optimal Migration Path: AWS Migration Hub & Assessment Lab
Determine the optimal migration approach for existing workloads
Selecting the Optimal Migration Path: AWS Migration Hub & Assessment Lab
This lab provides a hands-on experience in evaluating on-premises workloads and determining the most effective migration strategy based on the 7 Rs (Retire, Retain, Relocate, Rehost, Replatform, Refactor, Repurchase). You will simulate the discovery phase and use AWS Migration Hub to track the migration of a multi-tier application.
[!WARNING] Remember to run the teardown commands at the end of this lab to avoid ongoing charges for AWS Application Migration Service (MGN) resources.
Prerequisites
- An AWS Account with Administrator access.
- AWS CLI installed and configured on your local machine with credentials for
<YOUR_REGION>(e.g.,us-east-1). - Basic understanding of EC2, RDS, and the 7 Rs migration strategies.
- IAM permissions for
mgn.amazonaws.com,discovery.amazonaws.com, andmigrationhub.amazonaws.com.
Learning Objectives
- Initialize and configure AWS Migration Hub for tracking.
- Perform a simulated Application Discovery using CSV import.
- Map discovered servers to applications and assign Migration Strategies (Rehost vs. Replatform).
- Configure AWS Application Migration Service (MGN) replication templates for a Rehost scenario.
- Evaluate database compatibility for Replatforming using AWS SCT concepts.
Architecture Overview
This lab simulates the migration assessment phase where on-premises metadata is ingested into AWS to inform strategy selection.
Strategy Mapping Guide
The following diagram illustrates the relationship between the level of effort and the potential optimization gained from various migration strategies:
\begin{tikzpicture}[scale=1.2, every node/.style={font=\small}] % Axes \draw[thick, ->] (0,0) -- (6,0) node[right] {Level of Effort/Time}; \draw[thick, ->] (0,0) -- (0,5) node[above] {Cloud Optimization};
% Points
\filldraw[blue] (1,0.8) circle (3pt) node[anchor=north west] {Rehost};
\filldraw[cyan] (2.5,2.0) circle (3pt) node[anchor=north west] {Replatform};
\filldraw[teal] (4.5,4.0) circle (3pt) node[anchor=south east] {Refactor};
% Regions
\draw[dashed, gray] (0,0) -- (5,4.5);
\node[rotate=42, gray] at (3,2.5) {Migration Path};\end{tikzpicture}
Step-by-Step Instructions
Step 1: Initialize AWS Migration Hub
Before tracking migrations, you must select your home region. The home region is where your migration metadata is stored and cannot be changed later.
# Check the current home region for Migration Hub
aws migrationhub get-home-region[!NOTE] If no home region is set, you must set it via the console as the CLI does not support initial home region selection for all accounts.
▶Console alternative
- Log in to the AWS Management Console.
- Search for Migration Hub.
- On the landing page, click Select home region.
- Choose your preferred region (e.g., US East (N. Virginia)) and click Confirm.
Step 2: Import Simulated Discovery Data
In a real-world scenario, you would use the AWS Application Discovery Agent. For this lab, we will import a CSV representing an on-premises web server and database.
- Create a file named
discovery_import.csvwith the following content:
External Id,Server Name,IP Address,OS Name,Cores,RAM (MB)
svr-101,Web-Server-Prod,192.168.1.10,Ubuntu 20.04,2,4096
svr-102,DB-Server-Prod,192.168.1.20,Windows Server 2019,4,16384- Upload this data to Migration Hub:
▶Console Instructions
- In Migration Hub, navigate to Discover > Servers.
- Click Import.
- Upload your
discovery_import.csv. - Click Import.
Step 3: Group Servers into Applications
Migration is managed at the application level, not individual server level. You will now group your discovered servers into a single application named Legacy-Web-App.
# Create the application container
aws discovery create-application --name "Legacy-Web-App" --description "Primary e-commerce site"[!TIP] Note the
configurationIdreturned by the command. You will use it to associate the servers found in the Import task.
Step 4: Configure Application Migration Service (MGN)
For the Web-Server-Prod (Rehost strategy), we will use AWS MGN. First, we must initialize the service settings.
# Initialize MGN replication template (Linux example)
aws mgn create-replication-configuration-template \
--staging-area-subnet-id <YOUR_SUBNET_ID> \
--associate-default-security-group \
--ebs-encryption-type DEFAULT \
--data-plane-routing PRIVATE_IP[!IMPORTANT] Replace
<YOUR_SUBNET_ID>with a subnet in your VPC that has outbound internet access (or a VPC endpoint) to communicate with the MGN service.
Checkpoints
| Verification Task | Expected Result |
|---|---|
| Home Region | aws migrationhub get-home-region returns your selected region. |
| Server Discovery | Navigate to Migration Hub > Servers; Web-Server-Prod and DB-Server-Prod appear in the list. |
| Application Grouping | Under Applications, Legacy-Web-App shows 2 associated servers. |
| MGN Status | In the MGN console, the Replication Template status is "Active". |
Troubleshooting
| Error | Potential Cause | Fix |
|---|---|---|
HomeRegionNotSetException | You haven't initialized Migration Hub. | Use the Console to select a home region as shown in Step 1. |
AccessDenied when importing | Missing IAM permissions for discovery. | Ensure your IAM user has the AWSApplicationDiscoveryServiceFullAccess policy. |
| MGN Agent won't install | No outbound access on port 443. | Check Security Group and Route Table for your Staging Subnet. |
Concept Review
| Migration Strategy (7 Rs) | Best Use Case | AWS Tool Choice |
|---|---|---|
| Rehost | Large scale migrations with tight deadlines. | AWS Application Migration Service (MGN) |
| Replatform | Wanting to move to managed services without code changes. | AWS Database Migration Service (DMS) |
| Refactor | Need for high scalability and cloud-native features. | AWS Lambda, Fargate, Aurora |
| Relocate | Moving VMware workloads to AWS. | VMware Cloud on AWS |
Stretch Challenge
Scenario: Your DB-Server-Prod is currently running SQL Server on-premises, but the CTO wants to move to Amazon Aurora (PostgreSQL) to save on licensing costs.
- This is a Refactor/Replatform hybrid.
- Research how AWS Schema Conversion Tool (SCT) would be used here.
- List the steps to perform a heterogeneous migration from SQL Server to Aurora PostgreSQL using DMS.
Cost Estimate
| Service | Cost Component | Estimated Monthly Cost (Small Lab) |
|---|---|---|
| Migration Hub | Metadata storage | $0 (Free) |
| AWS MGN | Replication Server | ~$0.0125/hr per server (t3.small) |
| EBS Snapshots | Data replication | Standard EBS pricing (~$0.05/GB-month) |
| Data Transfer | On-prem to AWS | Free (Inbound) |
Clean-Up / Teardown
-
Delete MGN Replication Template:
bash# Get your template ID first aws mgn describe-replication-configuration-templates # Delete it aws mgn delete-replication-configuration-template --replication-configuration-template-id <TEMPLATE_ID> -
Delete Discovered Applications:
bashaws discovery delete-applications --configuration-ids <APP_CONFIG_ID> -
Terminate any MGN Test Instances: Navigate to the MGN Console > Source Servers and ensure all "Test" or "Cutover" instances are terminated.
[!NOTE] Migration Hub Home Region selection cannot be undone, but it incurs no cost when not in use.