An application modernization strategy is a decision made once per system and then put in order. A large company rarely has one answer for forty applications: a reporting tool nobody opens can be switched off, a stable back-office system can stay where it is, and only one or two systems carry a design that blocks the business. The 7 Rs name the options, and a decision matrix makes each choice explicit enough to fund, sequence and defend.

What an application modernization strategy decides

For every system in scope, a strategy answers three questions: which of the seven options it gets, what that will cost in money, risk and calendar time, and when it happens relative to the others. The first two are decided system by system. The third is a portfolio decision, because systems share data, teams and deadlines. Most legacy system modernization strategies list the same handful of options; what makes one usable is the evidence written down behind each choice.

This guide covers the per-system choice and the order. Funding, governance and the business case for a whole portfolio are in our guide to building an IT modernization strategy; the narrower question of whether one legacy system should be kept, upgraded or replaced is in our legacy system modernization guide.

The 7 Rs of application modernization

The "Rs" started as a cloud migration vocabulary, and each provider counts them differently. AWS built its list on the 5 R’s that Gartner outlined here in 2011 (Stephen Orban, AWS, 2016), and its current guidance names seven: retire, retain, rehost, relocate, repurchase, replatform, and refactor or re-architect. Microsoft’s Cloud Adoption Framework uses eight: Each workload can be Retired, Retained, Rehosted, Replatformed, Refactored, Rearchitected, Rebuilt, or Replaced (Microsoft Learn). The cloud-specific entries (relocate moves VMware workloads unchanged; repurchase means moving to SaaS) matter in a data center exit, and our enterprise cloud guide charts that version. For modernization, with or without a cloud move, the split that matters is between refactoring inside the current design and rearchitecting it.

This guide uses seven options that cover what a Java portfolio actually needs, ordered by how much of the system changes:

The 7 Rs of application modernization from the least change to the most, with relative cost, risk and time on a scale of one to five. Retire: switched off, data archived; cost 1, risk 2, time 1. Retain: nothing changes yet, the system is patched and watched; cost 1, risk 2, time 1. Rehost: where it runs changes, the code does not; cost 2, risk 2, time 2. Replatform: runtime and middleware change; cost 3, risk 2, time 3. Refactor: code and dependencies change, the design stays; cost 3, risk 3, time 3. Rearchitect: the design changes one slice at a time; cost 4, risk 4, time 5. Replace: everything, built anew or bought; cost 5, risk 5, time 4.THE 7 RS, FROM THE LEAST CHANGE TO THE MOSTCostRiskTimeRetireSwitched off; data archivedRetainNothing yet; patched and watchedRehostWhere it runs; code unchangedReplatformRuntime and middlewareRefactorCode and dependencies; same designRearchitectThe design, one slice at a timeReplaceEverything: built anew or bought
The 7 Rs, with relative cost, risk and calendar time from one to five. The ratings are our own assessment from modernization work on Java systems.

Cost, risk and time mostly rise together as more of the system changes, with two exceptions. Replatforming carries less risk than its cost suggests, because the code and its behavior stay as they were and only what they run on changes. Replacing can finish sooner than rearchitecting when a product already does the job, but it concentrates the risk in a single cut-over instead of spreading it across slices.

The table below adds what each option changes in practice, how long it usually takes for one system, and what most often goes wrong:

OptionWhat changesTypical duration per systemMain riskAlso called
RetireThe system is switched off and its data archivedWeeksA hidden dependency or a retention rule nobody listedDecommission, eliminate
RetainNothing yet; it is patched, monitored and reviewedOngoingSupport and skills gaps grow every yearKeep, tolerate, keep and contain
RehostWhere it runs: new servers or cloud virtual machinesWeeksMoving the old problems to a new billLift and shift
ReplatformThe runtime and middleware: application server, JDK, database service, containersWeeks to a few monthsBehavior that depended on the old platformLift, tinker and shift
RefactorCode and dependencies, inside the same designWeeks to monthsRegressions where tests are thinUpgrade in place
RearchitectThe design, one slice at a timeQuarters to yearsA long middle with two systems running side by sideRebuild in slices
ReplaceEverything: a new build or a product you buyA year or moreOne big cut-over, and scope that grows as hidden rules surfaceRepurchase, rebuild

The durations are ranges from our own work, for a single system of the size a team of four to eight engineers maintains. Our legacy system modernization guide groups the same ground into four options: keep and contain covers retain, upgrade in place covers refactor, and rearchitecting in slices and replacing are the same in both.

Retire

Retiring is the cheapest option and the one most often skipped. A portfolio review usually finds applications that duplicate another system, serve a process that no longer exists, or have a handful of users who could be moved elsewhere. AWS has found that as much as 10% (I’ve seen 20%) of an enterprise IT portfolio is no longer useful, and can simply be turned off (Stephen Orban, AWS). The work is mostly archaeology: find every consumer of the data (reports, exports, other systems reading the database directly), agree how long records must be kept, archive them in a format that outlives the application, then switch it off. Retired systems also free the budget and the people that the harder options need.

Retain

Retaining is a decision with conditions attached. A system that rarely changes, runs on a supported runtime and blocks nothing can stay as it is, provided it is patched on schedule, monitored and reviewed at least once a year. The review asks whether any of the three conditions has changed. A system whose JDK has left support fails the second condition, and belongs in another row of the matrix below.

Rehost

Rehosting moves the system to new infrastructure without changing it: from an old data center to cloud virtual machines, or from end-of-life hardware to new servers. It fits a hard infrastructure deadline, such as a data center exit or a hardware support contract ending, and systems that will not change for years. It does nothing for an application server or a JDK that is out of support, and the costs of running the old design move with it. Microsoft puts the limit plainly: Rehosting is suitable only when you’re confident that the workload remains in its current state for at least two years (Microsoft Learn). AWS reports that in large migrations the majority of applications are rehosted (AWS), which says more about deadlines than about the right end state.

Replatform

Replatforming changes what the application runs on while keeping its code and design largely intact. For a Java system that typically means one or more of these: a supported JDK, a lighter or supported application server, containers in place of hand-built servers, a managed database service in place of a self-run one.

IBM's account of Mitsubishi Motors North America shows the shape at portfolio scale. It ran 110 business applications and 60 web services on Java 8 and WebSphere Application Server Network Deployment; an automated assessment found that about 90 of the 110 needed minimal or no code changes to move to WebSphere Liberty, which also opened a path to Java 17 and Jakarta EE. IBM sells both Liberty and the assessment tool, and the post publishes no cost figures. In our experience the split is common: most applications in a portfolio replatform cleanly, and the rest need refactoring first.

Refactor

Refactoring changes the code and its dependencies while the design stays: moving from Java 8 or 11 to 25, from Spring Boot 2 to 3 or 4, from the javax to the jakarta namespace, replacing abandoned libraries, adding the tests that make the change safe. It is the option most Java systems need most often, and the one that can be repeated as new versions arrive.

Tooling has made the mechanical part cheaper. Amazon reports that its code transformation agent cut the average upgrade of an application to Java 17 from about 50 developer days to a few hours, with an estimated 4,500 developer-years saved (Andy Jassy, August 2024; Amazon sells the tool). The judgement calls remain: which library replaces an abandoned one, what to do when a framework changes behavior, which tests are missing. On a fifteen-year-old online store and back office, we moved two applications from Java 17 and Spring 5.3 to Java 25 and Spring 6.2 in about four weeks with no feature freeze, and the dependency scan went from 47 critical and high-severity advisories to none.

Rearchitect

Rearchitecting changes the design: a batch process that has to become real time, a data model that no longer fits the business, a monolith whose release cycle holds back the teams working in it. Done safely, it happens one slice at a time behind a stable interface, with the old system serving everything not yet moved; our guide to the strangler fig pattern covers the mechanics.

It is also the option most likely to run long. Netflix began moving to the cloud in August 2008 and finished in January 2016, after seven years of diligent effort; it chose to rebuild virtually all of our technology and moved from a monolith to hundreds of microservices rather than lifting the data center into AWS (Netflix). The opposite lesson is Segment's: its engineers consolidated over 140 services into a single service after the microservice design left 3 full-time engineers spending most of their time just keeping the system alive (Segment engineering blog). Rearchitect the part whose design blocks the business, and nothing else.

The cheapest rearchitecting starts with proof. For a global flight information company, we replaced schedule calculation logic built on DB2 in-database processing and proprietary Java with an open-source Java framework, as a proof of concept tested on the same input data as production. It produced the same output 65% faster, before anyone committed to a rebuild.

Case study: flight schedule calculation for a global flight information company. DB2 in-database processing and proprietary Java code were replaced by an open-source high-performance Java framework in a proof of concept, tested on the same input data as production. Calculation time fell by 65 percent, the output matched production, and the total cost of ownership was lower.CASE STUDY: AVIATION DATAFlight schedule calculation, 65% fasterDB2 in-database logic and proprietary Java,replaced by an open-source Java framework andproven on production data before any rebuild.-65%calculation timeSame outputas productionDB2 in-database logiclicensedOpen-source JavaSame daily outputfunctional testsRead the case study

Replace

Replacing means a new system, either built or bought. Buying fits work that is the same in every company, such as payroll, CRM or document management, where a product now does the job better than an internal system can. Building new fits the rare system whose design is wrong throughout and too small, or too isolated, to rebuild in slices.

Large replacements carry the most risk of the seven. Lidl started replacing its in-house merchandise management system with an SAP-based one in 2011 and stopped the project in 2018, saying in an internal memo quoted by Computerwoche that the original strategic goals could not be reached with reasonable effort; it went back to developing its old system. The participants did not say what the project cost; Lebensmittel Zeitung reported, citing industry observers, that it had consumed about EUR 500 million.

An application modernization decision matrix for each system

The matrix below turns the choice into six questions per system, each answered from evidence the team already has. The answers point to one R. Where two rows match, the cheaper option comes first and the other becomes the plan for later.

OptionBusiness still needs itChange requestsRuntime and platformDesign blocks changeA product could do the jobInfrastructure deadline
RetireNoAnyAnyAnyAnyAny
RetainYesRareSupportedNoAnyNo
RehostYesRareSupportedNoNoYes
ReplatformYesRare or regularOut of support, code still fineNoNoAny
RefactorYesRegularCode or libraries out of supportNoNoAny
RearchitectYesFrequentAnyYes, in partsNoAny
ReplaceYesAnyAnyYes, throughoutYes, or the system is smallAny

Each column has an evidence source, which keeps the scoring honest:

  • Business still needs it: usage logs and the list of processes it supports; a named business owner.
  • Change requests: tickets and releases over the last twelve months, then the roadmap.
  • Runtime and platform: the vendor support dates for the JDK, framework and application server, and an SBOM of the libraries (our Java end of life dates and SBOM for Java guides cover both).
  • Design blocks change: the changes the business asked for and did not get, and why. A design blocks change when the answer is structural: a batch window, a shared schema, a release train. A missing test does not count.
  • A product could do the job: whether the system's rules are specific to your business or the same as everyone's.
  • Infrastructure deadline: data center contracts, hardware support, hosting and license renewals.

A worked example: six Java systems

An illustrative portfolio, scored with the matrix:

SystemWhat the evidence saysDecision
Reporting tool on an old BI serverTwelve active users, all of whom also use the data warehouseRetire
HR applicationRules are standard; a SaaS product covers themReplace (buy)
Partner portal on a Java EE application serverFew change requests; server out of support; code fineReplatform
Billing batch on Java 8 and Spring Boot 2Regular changes; framework and libraries out of support; design adequateRefactor
Order coreFrequent changes; real-time stock blocked by the batch designRearchitect the stock and order slices
Internal admin toolRare changes; supported runtimeRetain, reviewed yearly

Replatform vs refactor for Java EE applications

The most common Java decision sits between two neighboring options: an application on WebLogic, WebSphere or JBoss, written against Java EE, whose server or JDK is reaching the end of support.

Replatforming keeps the Java EE programming model and moves to a supported runtime: a newer release of the same server, a lighter one such as WebSphere Liberty or Open Liberty, or the same server in containers. Microsoft's guide to running WebLogic on Azure Kubernetes Service is an example of the second route (Microsoft Learn). It is the faster route when the code is in reasonable shape and the application changes rarely.

Refactoring to Spring Boot replaces the application server with an embedded one and rewrites the parts that depend on the server: EJBs become Spring beans, JNDI lookups become configuration, server-managed transactions and messaging move to Spring's equivalents. It pays off when the application changes regularly and the team wants one programming model across its systems.

Either route crosses the same line. Jakarta EE 9 completed the transition from the use of the javax.* package namespace to jakarta.* (Jakarta EE), and Spring Boot 4 requires Java 17 or later and is based on Jakarta EE 11 (Spring Boot 4.0 migration guide). An application that stays on javax stays on old servers and old libraries. The namespace change itself is mechanical, and OpenRewrite recipes do most of it; our Spring Boot 4 migration guide covers the order of work.

Replatform to a supported serverRefactor to Spring Boot
Code changesConfiguration, deployment descriptors, the namespaceEvery server-managed feature: EJB, JNDI, JTA, JMS wiring
Typical duration per applicationDays to weeksWeeks to months
What it leaves you withThe same design on a supported runtimeOne programming model, an embedded server, simpler containers
Fits whenThe application rarely changesThe application changes regularly or will be extended

Sequencing an application modernization roadmap

Once each system has its R, the order follows from four rules:

  1. Deadlines first. A support end date or an infrastructure contract fixes the latest start for the systems it affects.
  2. Retire early. Every retired system removes work from every later wave and frees the people who maintained it.
  3. Make it safe before you make it better. Replatform or refactor a system onto supported versions before rearchitecting it, so the long project does not start on a runtime that leaves support halfway through.
  4. One rearchitecture at a time per team. The long middle of a slice-by-slice rebuild needs the same senior people every week; two at once starve both.
An illustrative two-year modernization sequence for six systems. The reporting tool is retired in the first quarter. The HR application is replaced by a SaaS product, configured and migrated in the first half, then cut over. The partner portal is replatformed from its application server to containers in the first year. The billing batch is refactored from Java 8 to Java 25, tests first, between the second and fourth quarters. The order core is rearchitected in three slices from the third quarter to the end of the second year. The admin tool is retained, patched on schedule and reviewed yearly.AN ILLUSTRATIVE TWO-YEAR SEQUENCE FOR SIX SYSTEMSReporting toolRetireSwitch offHR applicationReplace (SaaS)Configure, migrateLivePartner portalReplatformApp server to containersBilling batchRefactorJava 8 to 25, tests firstOrder coreRearchitectSlice 1Slice 2Slice 3Admin toolRetainPatched on schedule; reviewed yearlytwo years
The worked example from the matrix above, sequenced over two years. Illustrative.

Dependencies between systems adjust the order: a retained system that feeds a rearchitected one may need its interface changed in the same wave. The portfolio view, with funding waves and governance, is in our IT modernization strategy guide.

Where legacy application modernization strategies go wrong

The legacy modernization approach we see fail most often picks one R for everything:

  • Everything rehosted. The data center closes on time and nothing else changes: the same unsupported runtimes, now on a monthly bill.
  • Everything rearchitected. The budget goes to rebuilding systems whose design never blocked anyone, and the ones that needed it wait.
  • Everything replaced. A program that bundles many systems into one cut-over takes on the risk the Lidl case shows, all at once.
  • Retain by default. Systems kept without a yearly review drift out of support one dependency at a time, until the only option left is the most expensive one.

If you want the matrix filled in for your systems, our Application Modernization Sprint starts with a scoping call and a written inventory: the R for each application, the evidence behind it, the order of work and a ballpark estimate.