Hands-On Lab1,342 words

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, and migrationhub.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.

Loading Diagram...

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};

code
% 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.

bash
# 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
  1. Log in to the AWS Management Console.
  2. Search for Migration Hub.
  3. On the landing page, click Select home region.
  4. 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.

  1. Create a file named discovery_import.csv with the following content:
csv
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
  1. Upload this data to Migration Hub:
Console Instructions
  1. In Migration Hub, navigate to Discover > Servers.
  2. Click Import.
  3. Upload your discovery_import.csv.
  4. 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.

bash
# Create the application container aws discovery create-application --name "Legacy-Web-App" --description "Primary e-commerce site"

[!TIP] Note the configurationId returned 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.

bash
# 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 TaskExpected Result
Home Regionaws migrationhub get-home-region returns your selected region.
Server DiscoveryNavigate to Migration Hub > Servers; Web-Server-Prod and DB-Server-Prod appear in the list.
Application GroupingUnder Applications, Legacy-Web-App shows 2 associated servers.
MGN StatusIn the MGN console, the Replication Template status is "Active".

Troubleshooting

ErrorPotential CauseFix
HomeRegionNotSetExceptionYou haven't initialized Migration Hub.Use the Console to select a home region as shown in Step 1.
AccessDenied when importingMissing IAM permissions for discovery.Ensure your IAM user has the AWSApplicationDiscoveryServiceFullAccess policy.
MGN Agent won't installNo outbound access on port 443.Check Security Group and Route Table for your Staging Subnet.

Concept Review

Migration Strategy (7 Rs)Best Use CaseAWS Tool Choice
RehostLarge scale migrations with tight deadlines.AWS Application Migration Service (MGN)
ReplatformWanting to move to managed services without code changes.AWS Database Migration Service (DMS)
RefactorNeed for high scalability and cloud-native features.AWS Lambda, Fargate, Aurora
RelocateMoving 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.

  1. This is a Refactor/Replatform hybrid.
  2. Research how AWS Schema Conversion Tool (SCT) would be used here.
  3. List the steps to perform a heterogeneous migration from SQL Server to Aurora PostgreSQL using DMS.

Cost Estimate

ServiceCost ComponentEstimated Monthly Cost (Small Lab)
Migration HubMetadata storage$0 (Free)
AWS MGNReplication Server~$0.0125/hr per server (t3.small)
EBS SnapshotsData replicationStandard EBS pricing (~$0.05/GB-month)
Data TransferOn-prem to AWSFree (Inbound)

Clean-Up / Teardown

  1. 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>
  2. Delete Discovered Applications:

    bash
    aws discovery delete-applications --configuration-ids <APP_CONFIG_ID>
  3. 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.

Ready to study AWS Certified Solutions Architect - Professional (SAP-C02)?

Practice tests, flashcards, and all study notes — free, no sign-up needed.

Start Studying — Free