TExcelTAD
Home › AWS Cloud › Migration and the 7 Rs

Migration and the 7 Rs

Moving existing applications to AWS is a project of its own. AWS describes a migration in three phases (assess → mobilize → migrate and modernize) and classifies each application with one of the 7 Rs of migration strategy.

The 7 Rs

Strategy What happens Example
Retire Switch it off; nobody needs it A reporting tool replaced years ago
Retain Keep it where it is (for now) A mainframe app with a recent hardware refresh
Rehost ("lift and shift") Move servers as they are to EC2 A VM migrated with AWS Application Migration Service
Relocate Move a whole platform without changes VMware workloads moved to VMware Cloud on AWS
Replatform ("lift, tinker and shift") Small optimisations, same architecture Self-managed MySQL → Amazon RDS
Repurchase ("drop and shop") Replace with a SaaS product Own CRM → a SaaS CRM
Refactor / re-architect Rebuild with cloud-native services A monolith split into Lambda + DynamoDB microservices

Effort and benefit grow roughly from top to bottom: rehosting is fast but changes little; refactoring is slow and expensive but unlocks the most cloud benefits.

Migration tools

Tool Purpose
AWS Migration Hub Track migration progress across tools
AWS Application Discovery Service / Migration Evaluator Inventory servers, dependencies and utilisation; build the business case
AWS Application Migration Service (MGN) Continuous block-level replication of servers to EC2 for rehosting
AWS Database Migration Service (DMS) Migrate databases with minimal downtime (continuous replication)
AWS Schema Conversion Tool (SCT) / DMS Schema Conversion Convert schemas between engines (e.g. Oracle → PostgreSQL)
AWS DataSync, Snow family Move files and bulk data
AWS Cloud Adoption Framework (CAF) Guidance for the organisation: business, people, governance, platform, security, operations

Model: assigning a strategy

A portfolio assessment asks the same questions for every application. This rule-based model is a simplified version of such a decision tree:

python · try it yourself
def strategy(app):
    if not app["still_used"]:
        return "Retire"
    if app["blocked"]:
        return "Retain"
    if app["saas_alternative"]:
        return "Repurchase"
    if app["on_vmware"] and app["deadline_months"] <= 6:
        return "Relocate"
    if app["business_critical"] and app["needs_scaling"]:
        return "Refactor"
    if app["uses_self_managed_db"]:
        return "Replatform"
    return "Rehost"

portfolio = [
    {"name": "old-reporting", "still_used": False},
    {"name": "mainframe-billing", "still_used": True, "blocked": True},
    {"name": "crm", "still_used": True, "blocked": False, "saas_alternative": True},
    {"name": "intranet", "still_used": True, "blocked": False, "saas_alternative": False,
     "on_vmware": True, "deadline_months": 3},
    {"name": "web-shop", "still_used": True, "blocked": False, "saas_alternative": False,
     "on_vmware": False, "deadline_months": 12, "business_critical": True, "needs_scaling": True},
    {"name": "inventory-api", "still_used": True, "blocked": False, "saas_alternative": False,
     "on_vmware": False, "deadline_months": 12, "business_critical": True, "needs_scaling": False,
     "uses_self_managed_db": True},
    {"name": "file-server", "still_used": True, "blocked": False, "saas_alternative": False,
     "on_vmware": False, "deadline_months": 12, "business_critical": False, "needs_scaling": False,
     "uses_self_managed_db": False},
]

from collections import Counter
results = {app["name"]: strategy(app) for app in portfolio}
for name, s in results.items():
    print(f"{name:<18} -> {s}")
print(Counter(results.values()).most_common())
old-reporting      -> Retire
mainframe-billing  -> Retain
crm                -> Repurchase
intranet           -> Relocate
web-shop           -> Refactor
inventory-api      -> Replatform
file-server        -> Rehost
[('Retire', 1), ('Retain', 1), ('Repurchase', 1), ('Relocate', 1), ('Refactor', 1), ('Replatform', 1), ('Rehost', 1)]

Note the order of the questions: the cheapest answers (retire, retain, buy) are checked first. Every application you can retire or replace is one you don't have to migrate at all.

Model: migration waves and dependencies

Applications that talk to each other heavily should move together, or latency between on-premises and AWS will hurt (see the hybrid lesson). Grouping applications into waves by their dependencies:

python · try it yourself
links = [("web-shop", "inventory-api"), ("inventory-api", "inventory-db"),
         ("crm-sync", "crm"), ("intranet", "file-server"), ("web-shop", "payments")]
apps = {a for pair in links for a in pair} | {"wiki"}

parent = {a: a for a in apps}
def find(a):
    while parent[a] != a:
        parent[a] = parent[parent[a]]
        a = parent[a]
    return a
for a, b in links:
    parent[find(a)] = find(b)

groups = {}
for a in sorted(apps):
    groups.setdefault(find(a), []).append(a)
waves = sorted(groups.values(), key=lambda g: (len(g), g))
for i, wave in enumerate(waves, start=1):
    print(f"wave {i}: {wave}")
wave 1: ['wiki']
wave 2: ['crm', 'crm-sync']
wave 3: ['file-server', 'intranet']
wave 4: ['inventory-api', 'inventory-db', 'payments', 'web-shop']

Small, independent groups (like wiki) make good first waves: they teach the team the process with little risk. The big connected group moves last, together.

Database migration with DMS

bash
aws dms create-replication-task --replication-task-identifier shop-db-move \
    --source-endpoint-arn arn:aws:dms:eu-west-1:123456789012:endpoint:SRCMYSQL \
    --target-endpoint-arn arn:aws:dms:eu-west-1:123456789012:endpoint:TGTAURORA \
    --replication-instance-arn arn:aws:dms:eu-west-1:123456789012:rep:REPL1 \
    --migration-type full-load-and-cdc --table-mappings file://tables.json

full-load-and-cdc copies all existing data and then keeps replicating changes (change data capture), so the switch-over can happen in minutes.

Test yourself

Moving a VM unchanged onto EC2 is called ...

  1. Refactor
  2. Rehost
  3. Repurchase
  4. Retire

Moving a self-managed MySQL database to Amazon RDS, without other changes, is an example of ...

  1. Replatform
  2. Retain
  3. Relocate
  4. Refactor

Which service replicates a database continuously to AWS so the cut-over takes minutes?

  1. AWS DataSync
  2. AWS Database Migration Service
  3. AWS Snowball
  4. Amazon Athena