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.
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
- Azure vs AWS: the big picture and Hosting side by side
- Porting .NET Framework apps to AWS and Public, private and hybrid cloud
- Tools for the hands-on part: Docker (or the .NET 10 SDK). No AWS account is needed.
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:
| R | One-line meaning | Effort | Risk |
|---|---|---|---|
| Retire | Switch it off; it is not needed | Lowest | Low (if usage is proven zero) |
| Retain | Leave it where it is, for now | None now | Hidden: it still needs a plan |
| Relocate | Move the hypervisor layer or VMs with no change to them | Low | Medium |
| Repurchase | Replace it with a SaaS or different product | Medium to high | Medium (data and process change) |
| Rehost | "Lift and shift": same software on cloud servers | Low | Low to medium |
| Replatform | "Lift, tinker and shift": same app, managed services (for example a managed database or containers) | Medium | Medium |
| Refactor | Change the code or architecture to use cloud-native features | High | Highest, 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 term | Closest AWS R | Note |
|---|---|---|
| Rehost | Rehost (and Relocate for VMware) | Same idea |
| Refactor (light change, managed services) | Replatform | Microsoft's "refactor" is often AWS's "replatform" |
| Rearchitect / Rebuild | Refactor | Code and architecture change |
| Replace | Repurchase | SaaS or a different product |
| (not a named term) | Retire, Retain | Often 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 equivalent | What's different |
|---|---|---|
| Azure Migrate (discover, assess, migrate) | AWS Transform for discovery and assessment; AWS Application Migration Service (MGN) for server rehosting; AWS DMS for data | AWS 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 .NET | AWS 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 licence | Covered in the licensing lesson later in this module |
| Azure VMware Solution | Amazon 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 Service | AWS DMS with DMS Schema Conversion | Schema conversion is a managed, no-extra-charge feature inside DMS |
| Landing zone (Azure) | Control Tower or a custom landing zone | The 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.
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:
{
"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:
[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
Decideevaluates 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.ActiveUsersLast90Days == 0compares a nullable value:null(unknown) does not equal zero, so an unmeasured application is never retired by accident. The classifier lowers its confidence instead.- The Retain rule combines hardware and a decommission date compared with the assessment date (
_today), which is passed in so results are repeatable. - Every branch adds a human-readable reason, so each recommendation explains itself, which is what the change board reads.
DecideCodeis 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).- 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:
| Application | Components | Likely classification |
|---|---|---|
| Retail online banking | ASP.NET Core web (modern), SQL Server database, a COM-based statement generator | Web: replatform (containers). Database: replatform to RDS for SQL Server or, if Compass is clean, Babelfish. Statement generator: rehost now, refactor later |
| Branch teller suite | Vendor package with branch hardware, reporting site with zero users | Package: retain (hardware). Reporting site: retire |
| Payments back office | Web Forms admin, WCF services, MSMQ, high change rate | Replatform 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
| Symptom | Likely cause | Fix |
|---|---|---|
| Classifier returns Rehost for a modern app you expected to refactor | Platform text does not start with ".NET Framework", so it is treated as modern .NET | Check 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 waves | It was classified Retire or Retain | Expected; they are listed separately |
depends on unknown component | Typo in targetId | Match an id in the file |
| Results change from day to day | The decommission rule depends on today's date | Pass --today to pin it |
| A hard blocker still gets Refactor | Blocker name misspelled | Use 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 unlessactiveUsersLast90Daysis 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
web-reports-legacy is retired because it has zero active users and no one else depends on it; evidence is the 90-day usage count, but a careful note adds "check year-end". web-newsletter-old is retired because it duplicates another component. pkg-label-printer-manager is retained because it needs warehouse printer hardware; job-ftp-export is retained because its decommission is planned for 2027-03-31, inside the 12-month window from 2026-11-18. The why: Retire and Retain are decided by evidence of usage and constraints, before any technology question is asked.
Add public const string Biztalk = "Biztalk"; and [Biztalk] = 7 to Blockers.Weights. In DecideCode, after the source-code check and before the modern-.NET check, add if (c.Blockers.Contains(Blockers.Biztalk, StringComparer.OrdinalIgnoreCase)) { reasons.Add("BizTalk dependency: replatform onto Windows."); return MigrationStrategy.Replatform; }. The zero-usage case is already handled earlier because the Retire rule runs first, which is why you should test that the order holds: one test with ActiveUsersLast90Days = 0 expecting Retire, one with 50 users expecting Replatform. The why: the rule order is the policy, so put the exception where it belongs in the order and test the boundary.
Knowledge check
Answer: Retire, because it removes the application from scope entirely; there is nothing to migrate, host or support.
Answer: Repurchase. The new risk is third-party and data risk: due diligence on the vendor, data location and exit planning for a regulated bank.
Answer: Rehost moves the server as it is (same OS, same software). Replatform keeps the application code but moves it onto managed services, such as RDS instead of a self-managed SQL Server or containers instead of VMs.
Answer: unknown means nobody measured it; zero means measured and unused. Retiring on unknown data could switch off a needed system, so the classifier lowers confidence and asks for measurement.
Answer: it lets the team test networking, identity, tooling and runbooks on something forgiving before moving high-impact systems.
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
A bank has an on-premises application used to print cheques on a branch-hosted printer. The printers cannot be moved, and the application is scheduled for decommission in eight months. What is the most appropriate migration strategy?
A. Refactor to serverless B. Rehost with AWS Application Migration Service C. Retain the application on-premises and plan its retirement D. Replatform to Amazon RDS
Answer: C. Hardware dependency and a near-term decommission mean migration effort would be wasted. A, B and D spend effort on something being switched off.
A portfolio assessment shows an internal reporting site with no active users for six months and no dependencies. What should the migration team do first?
A. Rehost it to EC2 to preserve it B. Refactor it to containers C. Confirm with the owner and retire it, archiving its data per the retention policy D. Repurchase a SaaS reporting tool
Answer: C. Retiring removes cost and risk. A, B and D spend money on an unused system.
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.
Monitoring and identity side by side: Azure Monitor and Entra ID vs AWS
Translate Azure Monitor, Application Insights, KQL and Log Analytics into CloudWatch, Logs Insights and OpenTelemetry, and map Entra ID, Active Directory and managed identities onto IAM Identity Center, Cognito, AWS Managed Microsoft AD and IAM roles, with four identity integration patterns for a bank.
Lab 13.1: classify an estate with the 7 Rs
Run and extend a tested C# rule engine that classifies a fifteen-component bookshop estate (modelled on a classic .NET Framework and SQL Server monolith) into the seven migration strategies, groups chatty components into waves, and prints a change-board report, with no AWS account.