Skip to main content
XenonStack

Deployment Automation

XenonStack Insights Refactor vs Lift and Shift vs Containers Explained

| Published | Updated

Refactor vs Lift and Shift vs Containers Explained
9:14
Cloud migration routes: rehost, replatform with containers and refactor, chosen per application

Key takeaway

  • Compare lift and shift, replatform with containers, and refactor for cloud migration: what each changes, what it costs and how to choose per application.

Lift and shift (rehost) moves an application to the cloud without changing it, replatform adds some optimisation on the way, and refactor redesigns the application to use cloud-native features. Containers are not a fourth strategy: they are a packaging technology that can be used inside a replatform or a refactor.

This guide is for architects, engineering leads and CIOs who must choose a route for each application in a portfolio. It compares the three approaches, explains where containers fit, and shows how AI agents change the work. For the wider programme, see our cloud migration services page.

What is cloud migration?

Cloud migration is the process of moving data, applications or other business workloads to a cloud environment, whether from an on-premises data centre or from one cloud platform to another. The route you pick for each application decides how fast you move, what you pay afterwards and how much of the cloud you can actually use.

What is lift and shift (rehost)?

The AWS Prescriptive Guidance on migration strategies says rehost is also known as lift and shift, and that you move applications from the source environment to the cloud "without making any changes to the application". The same page says this lets you migrate many machines without worrying about compatibility, performance disruption or long cutover windows, and that it can be automated with tools such as VM Import/Export.

The trade-off is that a rehosted application does not gain cloud optimisations. AWS notes that applications are easier to optimise once they already run in the cloud, which is why rehosting is often a first step and not a final destination. Applications that are not natively cloud-native keep the limits they had on-premises.

What is replatform, and where do containers fit?

AWS describes replatform as "lift, tinker, and shift": you move the application and introduce some level of optimisation. Its examples include moving a database to a managed database service and moving from Windows to Linux. The same page lists migrating virtual machines into containers, without code changes, under replatform.

Docker explains the difference from virtual machines this way: containers virtualise the operating system instead of hardware, and multiple containers share the host kernel as isolated processes. See our guide to the Docker container for the basics. Containers make an application portable between environments, and an orchestrator such as Kubernetes, described by its project as an open source platform for managing containerised workloads and services, runs them at scale.

Containers also carry risk. The NIST Application Container Security Guide (SP 800-190) identifies risks across images, registries, orchestrators, containers and host operating systems, including a shared kernel between containers. Portability does not remove the need for governance.

What is refactoring in cloud migration?

AWS defines refactor, or re-architect, as moving an application to the cloud and modifying its architecture "by taking full advantage of cloud-native features to improve agility, performance, and scalability". It calls this the most complex and costly of the migration strategies and, for large migrations, recommends it only when the other strategies are not acceptable.

Refactoring is justified when a business need, such as a new feature set, scale or performance, cannot be met inside the existing design. A partial refactor changes the parts of the application that block that need. A complete refactor redesigns most of it. Both lean on cloud infrastructure services you would not have on a rehost.

How do refactor, lift and shift, and containers compare?

QuestionLift and shiftReplatform (including containers)Refactor
What changes?Nothing in the applicationSome components or the packagingThe architecture
Speed to first moveFastestModerateSlowest
Use of cloud-native featuresLittleSomeMost
Effort and costLowest up frontModerateHighest, per AWS
Best whenYou need to move many workloads quicklyYou want portability or a managed service without a rewriteThe current design blocks a business need

How do you choose between them?

Decide per application, not per company. Start from the business case: a data centre exit date favours rehosting, a portability or release-speed goal favours containers, and a capability the current design cannot deliver favours refactoring. Use the same assessment to mark applications to retire or keep, as the AWS guidance does with its Retire and Retain strategies. Our cloud migration strategy guide walks through the full portfolio view.

Two-column comparison. Lighter routes: rehost, when it fits, replatform, containers. Deeper routes: refactor, when it fits, cost, governance.

Microsoft's migration planning guidance adds a second axis: classify each workload by downtime tolerance. It says downtime migration suits non-critical workloads such as development and test systems, while near-zero downtime migration is essential for customer-facing and real-time transaction systems.

How do AI agents change cloud migration?

Migration work is full of repeatable judgement: inventorying applications, mapping dependencies, picking a strategy per workload, checking a cutover plan. AI agents can take on the evidence gathering and drafting in that loop, while engineers keep approval over strategy and cutover. Agents also need governed access to the systems they touch, so the permissions and audit trail should be designed before the first move. ElixirClaw is XenonStack's AI agents computing platform for building and running such agents.

What should you do first?

  1. Inventory applications and dependencies, and record the business reason for each move.
  2. Mark each application: retire, retain, rehost, replatform or refactor.
  3. Classify each workload by downtime tolerance and criticality.
  4. Pilot one rehost and one container replatform, and compare effort and run cost.
  5. Plan optimisation after the move, starting with the workloads that justify a refactor.

To map one decision your agents make during migration, and the data and policy it depends on, book a Context Workshop. See what happens in the workshop.

Next Steps in Adopting Cloud Migration Strategy

Talk to our experts about selecting the right cloud migration strategy. Learn how industries leverage refactoring, lift-and-shift, and containerization to modernize applications for scalability and efficiency. We optimize cloud deployments with automation, cost optimization, and seamless workload transitions, ensuring improved performance and resilience.

Frequently asked questions

What is the difference between lift and shift and refactoring?

Lift and shift moves an application to the cloud without changing it. Refactoring changes the architecture to use cloud-native features, which takes more effort but can improve agility, performance and scalability.

Is containerisation the same as lift and shift?

No. AWS lists moving virtual machines into containers without code changes under replatform, because it adds some optimisation. Containers can also appear inside a refactor when the application is redesigned around them.

When is lift and shift the right choice?

It fits when many workloads must move quickly and the applications do not need redesign first. AWS notes that applications are easier to optimise once they run in the cloud.

Why is refactoring described as costly?

AWS calls refactor the most complex and costly migration strategy because it modifies the application architecture. It recommends it for large migrations only when other strategies are not acceptable.

Do containers remove the need for security work?

No. NIST SP 800-190 identifies risks across images, registries, orchestrators, containers and host operating systems, so governance still applies.

Ready to put AI agents to work? See an ElixirClaw demo: the agentic OS to build, orchestrate and govern AI agents across your enterprise systems.

Table of Contents

Navdeep Singh Gill

Navdeep Singh Gill

Founder and CEO, XenonStack

LinkedIn profile

Navdeep Singh Gill is the Founder and Global CEO of XenonStack. With more than 20 years in network and cloud transformation, he leads the company’s strategy and product development in private cloud and agentic AI, including the ElixirData, ElixirClaw and NexaStack platforms. He writes about enterprise AI, data platforms and the architecture decisions that help large organisations run AI safely at scale.

Get the latest articles in your inbox

Subscribe Now

Interested in solving your challenges with the XenonStack team?
Get Started

Tell us about you and your priorities so we can prepare the right conversation. It takes about 2 minutes.

Please Select your Industry
Banking
Fintech
Payment Providers
Wealth Management
Discrete Manufacturing
Semiconductor
Machinery Manufacturing / Automation
Appliances / Electrical / Electronics
Elevator Manufacturing
Defense & Space Manufacturing
Computers & Electronics / Industrial Machinery
Motor Vehicle Manufacturing
Food and Beverages
Distillery & Wines
Beverages
Shipping
Logistics
Mobility (EV / Public Transport)
Energy & Utilities
Hospitality
Digital Gaming Platforms
SportsTech with AI
Public Safety - Explosives
Public Safety - Firefighting
Public Safety - Surveillance
Public Safety - Others
Media Platforms
City Operations
Airlines & Aviation
Defense Warfare & Drones
Robotics Engineering
Drones Manufacturing
AI Labs for Colleges
AI MSP / Quantum / AGI Institutes
Retail Apparel and Fashion

Continue