Skip to content

CentOS 7 to AlmaLinux 9 Migration: In-Place Upgrade vs. New EC2 Instance with EBS Snapshot

0

Hello,

We have EC2 instances running CentOS 7 in our AWS environment, and we are planning to migrate them to AlmaLinux 9.

Our existing instances host websites, web applications, and databases.

We are currently considering the following migration approaches:

1. In-Place Operating System Upgrade

Upgrading the operating system directly from CentOS 7 to AlmaLinux 9 on the existing EC2 instances.

  • Is a direct migration from CentOS 7 to AlmaLinux 9 technically possible?
  • If so, is there any official documentation or step-by-step migration guide we can follow?
  • If a direct upgrade is not supported, what intermediate upgrade steps would you recommend?

2. Creating New EC2 Instances and Migrating Data Using EBS Snapshots

Creating new EC2 instances with AlmaLinux 9, taking EBS snapshots of the existing CentOS 7 instances, creating new EBS volumes from those snapshots, and attaching them to the new instances as secondary volumes to migrate the required application files and database data.

Which of these two approaches would you recommend? In particular, which method would provide a safer and more reliable migration for production environments hosting web applications and databases?

We would appreciate your recommendations and any relevant technical documentation or migration guides.

Thank you.

  • If my answer was helpful, I would appreciate it if you could mark it as the accepted answer.

2 Answers
1

As to my understanding, it is possible but NOT in one step. AlmaLinux's upgrade tool is designed for one-step upgrades, so you go CentOS 7 to AlmaLinux 8, then AlmaLinux 8 to 9. The AlmaLinux wiki has a guide for exactly this path, "ELevate CentOS 7 to AlmaLinux 9" (ELevate wiki). Each step starts with leapp preupgrade, which reports what would block the upgrade on that instance. Create an AMI or EBS snapshots before each step so you can roll back.

EXPERT

answered 7 days ago

EXPERT

reviewed 7 days ago

0

For migrating your CentOS 7 EC2 instances to AlmaLinux 9, the recommended approach is to create new EC2 instances with AlmaLinux 9 and migrate your data, rather than attempting an in-place upgrade. Here's why:

Why New Instances Are Recommended:

Cloud migrations are typically not straightforward lift-and-shift operations. You cannot simply take what you have and move it without optimization. The migration process should be viewed as an opportunity to rethink and optimize your infrastructure for the future, not merely change where it lives. A typical cloud migration timeline is often a year or longer when done properly, though focused efforts can be completed in shorter timeframes with proper planning.

Recommended Approach:

The second option you described—creating new AlmaLinux 9 instances and migrating data using EBS snapshots—is the safer and more reliable method for production environments. This approach allows you to:

  1. Minimize Risk: Keep your existing CentOS 7 instances running while you build and test the new environment
  2. Test Thoroughly: Validate applications, databases, and configurations on the new instances before cutover
  3. Enable Easy Rollback: Maintain the ability to quickly revert to the original environment if issues arise
  4. Optimize During Migration: Review and improve your architecture, not just replicate the old setup

Migration Process Considerations:

Before beginning your migration, you should assess your application landscape, set clear goals, and identify stakeholders. For your websites, web applications, and databases, plan your migration strategy carefully, including:

  • Setting up testing environments to validate functionality
  • Planning and executing comprehensive tests
  • Monitoring performance and load
  • Having a detailed rollback plan
  • Ensuring proper backup, transfer, synchronization, and validation of your data

For Production Environments:

Given that you're hosting production web applications and databases, the new instance approach provides better safety through testing and validation before cutover, minimizes downtime, and reduces the risk of application compatibility issues that could arise from an in-place OS upgrade.

Regarding in-place upgrades from CentOS 7 to AlmaLinux 9: This would involve multiple intermediate steps and carries significant risk for production systems. The complexity and potential for issues make this approach less suitable for environments hosting critical applications and databases.
Sources
Community | Migrate your existing applications to AWS Cloud: A comprehensive guide
How the NBA future-proofed its digital infrastructure in 6 months | AWS for M&E Blog

answered 7 days ago

EXPERT

reviewed 7 days ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.