Skip to Content
Cloud Engineering Academy
13. Microsoft-to-AWS Migration

The 7 Rs of migration

Classify every application in a bank's estate as retire, retain, relocate, repurchase, rehost, replatform or refactor using an ordered decision rule, justify each choice with evidence, group chatty components into waves, and test the logic in a small C# classifier.

intermediate⏱ 1 h 30 min🟢 FreeSAP-C03SAA-C03CLF-C02

Assumes: .NET 10 LTS · .NET Framework 4.8 (source apps) · AWS Transform · AWS Application Migration Service · AWS Database Migration Service · Region us-east-1. Verified against official sources on 2026-11-18.

Learning objectives

By the end of this lesson you can:

  • Define each of the seven strategies and give a banking example, the AWS tools it uses, and its typical risk.
  • Apply an ordered rule that picks one R per application and records the evidence behind the choice.
  • Explain how the 7 Rs relate to Microsoft's cloud adoption terms (rehost, refactor, rearchitect, rebuild, replace).
  • Group components into move groups and waves, and say why the least risky group goes first.
  • Run the lab classifier on a sample inventory and change its rules with tests.

Prerequisites

Why this matters in banking

Harbourline's migration programme starts with 212 applications and a deadline. Within a month, the team's default plan is "rehost everything, fix it later", because rehosting is quick to explain. Six months later the bank is paying for AWS servers running software nobody uses, three Windows apps are blocked on a COM component that is end-of-life, and the regulator's questions about why this application moved this way have no written answers.

A migration strategy per application, with evidence, prevents both waste and risk. It gives the change board a defensible record, it gives finance a cost basis, and it tells engineers which apps deserve effort. The cheapest application to migrate is the one you retire.

The idea in plain language

A migration strategy is the answer to: what will we do with this application when we move to AWS? There are seven answers, popularly called the 7 Rs:

ROne-line meaningEffortRisk
RetireSwitch it off; it is not neededLowestLow (if usage is proven zero)
RetainLeave it where it is, for nowNone nowHidden: it still needs a plan
RelocateMove the hypervisor layer or VMs with no change to themLowMedium
RepurchaseReplace it with a SaaS or different productMedium to highMedium (data and process change)
Rehost"Lift and shift": same software on cloud serversLowLow to medium
Replatform"Lift, tinker and shift": same app, managed services (for example a managed database or containers)MediumMedium
RefactorChange the code or architecture to use cloud-native featuresHighHighest, but the most future value

Analogy: moving a bank's branches into a new town. Close branches nobody visits (retire). Leave the vault where it is until the building is ready (retain). Move whole floors with their furniture on a lorry (relocate). Hire a shared-office provider instead of running your own back office (repurchase). Move the desks as they are (rehost). Move the desks and plug them into the new building's managed IT and cleaning (replatform). Redesign the branch layout around self-service (refactor).

Terminology bridge from Microsoft. Microsoft's Cloud Adoption Framework talks about rehost, refactor, rearchitect, rebuild and replace. They map roughly like this:

Microsoft termClosest AWS RNote
RehostRehost (and Relocate for VMware)Same idea
Refactor (light change, managed services)ReplatformMicrosoft's "refactor" is often AWS's "replatform"
Rearchitect / RebuildRefactorCode and architecture change
ReplaceRepurchaseSaaS or a different product
(not a named term)Retire, RetainOften treated as part of "rationalise"

What problem the 7 Rs solve

They give a shared vocabulary and force a decision per application, which prevents the two common errors: moving everything the same way, and moving things that should not move. Honest limits:

  • The Rs are a starting classification, not a plan. Dependencies, data gravity, licences and deadlines change the answer.
  • One application can have different Rs per component (a database replatformed, a web tier refactored, a reporting tool retired).
  • The labels are fuzzy at the edges; teams should write their definitions down and apply them consistently. Our lab encodes one such set of definitions as rules.

Microsoft / Azure comparison

You know (Microsoft/Azure)AWS equivalentWhat's different
Azure Migrate (discover, assess, migrate)AWS Transform for discovery and assessment; AWS Application Migration Service (MGN) for server rehosting; AWS DMS for dataAWS Migration Hub and Application Discovery Service closed to new customers on 2025-11-07; AWS Transform is the recommended successor ⚠ VERIFY the current Transform capabilities before relying on them
Azure Migrate app and code assessment for .NETAWS Transform for .NET (generally available since May 2025)The older Porting Assistant for .NET, App2Container and Microservice Extractor closed to new customers on 2025-11-07
Azure Hybrid Benefit (bring your licence)Licence-included or bring your own licenceCovered in the licensing lesson later in this module
Azure VMware SolutionAmazon Elastic VMware Service (and earlier VMware offerings)The AWS VMware offering has changed over time; confirm the current service and its availability ⚠ VERIFY
Azure Database Migration ServiceAWS DMS with DMS Schema ConversionSchema conversion is a managed, no-extra-charge feature inside DMS
Landing zone (Azure)Control Tower or a custom landing zoneThe landing zone comes before any wave

Architecture: the decision flow

The order matters: stop paying for waste first, avoid risky moves second, then choose the cheapest strategy that meets the goal.

Security-boundary view. Classification is also a risk decision: a Retain on a payments component keeps its network exposure on-premises; a Rehost moves an unpatched Windows Server 2012 into your AWS account unless you plan remediation. Record, for each R, who owns patching and where regulated data will be stored.

The seven Rs one by one

Retire

Switch it off. Evidence: no active users in 90 days, no inbound dependencies, the owner agrees in writing. Harbourline example: an old sales-reports site (Web Forms) with zero users in 90 days. Tools: none; decommission checklist, data archival, and a retention decision for its data. Risk: a quarterly or annual process (year-end reports) that 90 days of logs miss. Mitigate with a longer observation window for batch-like workloads and a communication period. Check: archive the data before deletion, and keep it per the records schedule (a legal question, not a technical one).

Retain

Leave it. Evidence: needs on-premises hardware (a branch card reader, a hardware security module with contractual placement), regulatory constraint on location, or a decommission date already approved within about a year. Example: the warehouse label printer manager that talks to printers on a local network. Tools: hybrid connectivity so the retained component can still talk to the migrated ones. Risk: "retain" is often forgotten and becomes permanent; record a review date and an owner.

Relocate

Move the virtual machines at the hypervisor level with no change to the VMs. Example: a VMware cluster running a legacy branch-support suite. Tools: AWS's VMware offering for the current generation ⚠ VERIFY. Risk: it moves the problem (the old hypervisor and its licence) as well as the workload; set an end date for modernising what runs inside.

Repurchase

Replace with a product (usually SaaS). Example: a self-hosted CRM replaced by the vendor's SaaS edition. Tools: the vendor's migration tools; AWS DMS or S3-based transfers for data extraction. Risk: process change, data mapping, and third-party risk (outsourcing and exit planning for a regulated bank). The vendor must pass your due diligence before you migrate.

Rehost

"Lift and shift". Example: an accounting package with no source code and no SaaS edition, moved as a server. Tools: AWS Application Migration Service (MGN) replicates the source server's disks continuously to AWS, lets you run test launches, then a cut-over launch (a later lesson covers it). Risk: you bring old problems with you (out-of-support operating systems, unpatched software) and Windows licensing costs. Benefit: fast and a good first step to learn the platform.

Replatform

Keep the application's code and architecture, but move onto managed services. Examples: a SQL Server database to Amazon RDS for SQL Server; an ASP.NET Core app on .NET 8 into a container on ECS; a file share to FSx for Windows File Server. Tools: AWS DMS for data, Elastic Beanstalk or ECS for hosting. Risk: hidden differences (RDS has no sysadmin, for instance). Benefit: less operations work with limited code change.

Refactor

Change the code or architecture to be cloud-native: move to .NET 10, containers, queues, serverless. Example: the ASP.NET MVC 5 storefront with Entity Framework 6, moved to ASP.NET Core with EF Core on Fargate. Tools: AWS Transform for .NET can assist with porting; the .NET Upgrade Assistant is a free alternative (porting lesson). Risk: the highest effort and regression risk; reserve it for strategic applications that change often, because that is where the investment pays back.

Step-by-step implementation

Build the inventory

One row per component, not per project name: web tier, service, batch job, database, file share, package, VM. Capture platform, criticality, active users, source availability, change rate, SaaS alternative, hardware needs, planned decommission, blockers and dependencies. The lab's data/bookstore-inventory.json shows the columns.

Apply the ordered rules

Run the rules in order. Stop at the first match and record the reason text. If the data is missing (for example usage unknown), record low confidence and go and measure.

Review exceptions with the owners

A rule engine finds the default; humans own the exceptions. For each override, write one sentence of rationale. These sentences are the change-board evidence.

Group and sequence

Union components with chatty (latency-sensitive) dependencies into move groups, order groups by risk (the least critical first, so the team learns on something forgiving), and put retirements before everything: they reduce the scope.

Estimate effort and cost per R

Use blocker points for code, size and licensing for servers, and data volume for databases. Feed the totals into the business case and the licensing analysis later in this module.

Record the decision

Store the classification, evidence, reviewer and date in your repository (an architecture decision record per application or one table). Re-run it when data changes.

AWS Console instructions

The 7 Rs are a planning method, so there is no console step. If you use AWS Transform for discovery and assessment, open Console → AWS Transform and follow its guided workspace; its capabilities and regions change, so check the current documentation first ⚠ VERIFY. Never upload real customer data into a learning sandbox.

AWS CLI

Run the lab classifier from the repository root. No AWS credentials are used.

# Run the lab tests and print the sample report (Docker; nothing installed locally).
MSYS_NO_PATHCONV=1 docker run --rm --memory 3g \
  -v "$PWD/labs/m13-migration-classifier:/src" \
  -v cea-nuget-m13:/root/.nuget/packages \
  -w /src mcr.microsoft.com/dotnet/sdk:10.0 \
  sh -c "dotnet test --solution MigrationClassifier.slnx && dotnet run --project src/Harbourline.Migration.Tools -- data/bookstore-inventory.json --today 2026-11-18; find . -type d \( -name bin -o -name obj \) -prune -exec rm -rf {} +"

Infrastructure as code does not apply to this lesson: the output is a decision record, not cloud resources.

Complete code

The heart of the lab, abridged from labs/m13-migration-classifier/src/Harbourline.Migration.Assessment/Classifier.cs. The full project, with tests, is in Lab 13.1.

Classifier.cs (core rule order, abridged)
private MigrationStrategy Decide(AppComponent c, int points, List<string> reasons)
{
    // 1. Retire: nobody uses it, or something else already does the job.
    if (c.ActiveUsersLast90Days == 0 || c.DuplicatesOtherComponent)
    {
        reasons.Add("No active users or duplicate: switching it off is cheaper than moving it.");
        return MigrationStrategy.Retire;
    }

    // 2. Retain: the move would be pointless or impossible right now.
    if (c.RequiresOnPremisesHardware ||
        (c.DecommissionPlannedBy is { } date && date <= _today.AddMonths(DecommissionHorizonMonths)))
    {
        reasons.Add("On-premises hardware or an approved decommission date: keep it.");
        return MigrationStrategy.Retain;
    }

    // 3 to 5. Relocate VMware, repurchase or rehost packages, replatform databases and file shares.
    // 6. Code: DecideCode applies source availability, platform, change rate and blocker points.
    return DecideCode(c, points, reasons);
}

An inventory row:

bookstore-inventory.json (one component)
{
  "id": "web-storefront",
  "name": "Customer storefront (ASP.NET MVC 5)",
  "kind": "WebApplication",
  "platform": ".NET Framework 4.8",
  "criticality": 3,
  "activeUsersLast90Days": 5200,
  "changesLast12Months": 24,
  "containsPersonalData": true,
  "blockers": ["AspNetMvc5", "EntityFramework6", "WindowsAuth"],
  "dependsOn": [{ "targetId": "db-bookstore", "chatty": true }]
}

A test from the lab that locks one rule in place:

ClassifierTests.cs (one test)
[Fact]
public void Hard_blocker_prevents_refactor_even_when_points_are_low()
{
    var c = Code(changes: 20, blockers: [Blockers.WebForms]);
    Assert.Equal(MigrationStrategy.Replatform, Sut.Classify(c).Strategy);
}

Code explained line by line

  1. Decide evaluates rules top to bottom and returns at the first match; the rule order is the policy. Reordering it changes outcomes, which is why the tests exist.
  2. ActiveUsersLast90Days == 0 compares a nullable value: null (unknown) does not equal zero, so an unmeasured application is never retired by accident. The classifier lowers its confidence instead.
  3. The Retain rule combines hardware and a decommission date compared with the assessment date (_today), which is passed in so results are repeatable.
  4. Every branch adds a human-readable reason, so each recommendation explains itself, which is what the change board reads.
  5. DecideCode is where .NET specifics live: no source means rehost; modern .NET means replatform to containers; .NET Framework depends on change rate and blocker points (Web Forms, Remoting and COM are "hard" blockers that prevent a refactor on their own).
  6. The test names the rule in plain words. If someone "improves" the rule later, a failing test starts a conversation instead of a silent change.

Security considerations

⚠ Learning shortcut — not for production

The lab classifier reads an inventory you typed by hand and trusts it. A real assessment reconciles the inventory against discovery data (network flows, installed software, usage logs), is reviewed by application owners and security, and its output is stored with access control, because a portfolio map with blockers and dependencies is valuable to an attacker. The weights in the classifier are teaching values, not estimates of hours.

  • Classify data, not just applications. Components with personal data need a data-protection impact assessment (DPIA) review when they change location or processor; involve your DPO. This lesson makes no legal determination.
  • Rehost is not a security improvement. A migrated unsupported OS remains unsupported. Plan patching or isolation.
  • Repurchase adds third-party risk. Due diligence, exit plans and data-location checks apply.
  • Retain needs a secure path. A retained component that talks to migrated ones needs encrypted, monitored connectivity.
  • Segregation of duties. The person who classifies should not be the only one who approves it.

Banking use case

Harbourline's three-application starter portfolio for the module assignment:

ApplicationComponentsLikely classification
Retail online bankingASP.NET Core web (modern), SQL Server database, a COM-based statement generatorWeb: replatform (containers). Database: replatform to RDS for SQL Server or, if Compass is clean, Babelfish. Statement generator: rehost now, refactor later
Branch teller suiteVendor package with branch hardware, reporting site with zero usersPackage: retain (hardware). Reporting site: retire
Payments back officeWeb Forms admin, WCF services, MSMQ, high change rateReplatform onto Windows first, strangle out services to .NET 10 with SQS, refactor the highest-change services first

The move groups glue the web tier and database of retail banking into one wave, put the retirement before everything, and keep the teller suite where it is with a review date.

Common mistakes

  • Classifying by application name instead of component. A "single" app is often five components with different answers.
  • Treating Rehost as the default. It is a legitimate strategy for the right components, not a reflex.
  • Retiring on thin evidence. Ninety days of logs miss year-end processing. Observe over a full business cycle when possible.
  • Refactoring everything. Without a high change rate, the investment rarely pays back.
  • Forgetting dependencies. Chatty components separated across a VPN link time out. Group them.
  • Never revisiting Retain. Add a review date.

Troubleshooting

SymptomLikely causeFix
Classifier returns Rehost for a modern app you expected to refactorPlatform text does not start with ".NET Framework", so it is treated as modern .NETCheck the platform value; modern .NET goes to Replatform
Everything is "Low confidence"Web application rows have no usage data (null)Gather usage and fill in activeUsersLast90Days
A component is missing from wavesIt was classified Retire or RetainExpected; they are listed separately
depends on unknown componentTypo in targetIdMatch an id in the file
Results change from day to dayThe decommission rule depends on today's datePass --today to pin it
A hard blocker still gets RefactorBlocker name misspelledUse the identifiers in Blockers.cs (matching is case-insensitive)

Cost and cleanup

Cost label: free. The classifier runs locally and uses no AWS resources. Delete bin/ and obj/ folders if you ran it locally (the Docker command above does this for you). There is nothing in AWS to tear down.

Exercises

  • 🟢 Guided: run the lab tests and tool, then take the sample report and write one sentence per Retire and Retain decision explaining the evidence behind it.
  • 🟡 Challenge: add a new blocker Biztalk (weight 7) and a rule that makes any component with it Replatform onto Windows unless activeUsersLast90Days is zero. Add tests for both paths.
  • 🔴 Live problem: the business insists the "legacy reports site" must be refactored because the CFO likes it, yet the logs show zero users in 90 days. Prepare a one-page note for the change board: what you measured, what you may have missed (year-end, seasonal use), how you would test the hypothesis, and what you recommend.

Assignment

Classify ten real components from your estate (or invented banking components) using the lab's inventory format. For each, record the R, the evidence, the confidence, the blockers and the owner. Add a wave plan and a table of five assumptions to verify. Commit it to your portfolio repository.

Solutions

Knowledge check

Interview questions

  • "How do you decide between replatform and refactor for a .NET Framework app?" By strategic value and blockers: refactor when it changes often and has no hard blockers; otherwise replatform onto Windows hosting and modernise piece by piece.
  • "What evidence do you want before retiring an application?" Usage over a full business cycle, no inbound dependencies, owner sign-off, and an archive and retention plan for its data.
  • "Where does Retain go wrong?" It becomes permanent without an owner or review date, and its connectivity to migrated systems is not designed.

Certification practice

Completion checklist

  • I can define the 7 Rs and map Microsoft's terms to them
  • I ran the lab tests and read the sample report
  • I understand why the rule order is the policy
  • I classified at least five components with evidence

Key takeaways

  • The 7 Rs are seven answers to "what do we do with this application?": retire, retain, relocate, repurchase, rehost, replatform, refactor.
  • Order matters: retire and retain first, then pick the cheapest strategy that meets the goal.
  • Classify components, record evidence, and lower confidence when data is missing.
  • Move groups and waves keep chatty components together and put the least risky first.
  • Rehost is a valid strategy, not a default; refactor only where change rate justifies it.

Further reading

Independent learning resource — not affiliated with, endorsed or sponsored by Amazon Web Services. AWS and related marks are trademarks of Amazon.com, Inc. or its affiliates. All banking data in examples is fictional. Sample architectures are for learning and are not automatically compliant with GDPR, PCI DSS or any banking regulation.

On this page