- Newest
- Most votes
- Most comments
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.
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:
- Minimize Risk: Keep your existing CentOS 7 instances running while you build and test the new environment
- Test Thoroughly: Validate applications, databases, and configurations on the new instances before cutover
- Enable Easy Rollback: Maintain the ability to quickly revert to the original environment if issues arise
- 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

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