Decorative image for blog on migration from CentOS to AlmaLinux
September 12, 2022

How to Plan a CentOS to AlmaLinux Migration

Operating Systems

Given that CentOS 6 and CentOS 8 are already end of life, and CentOS 7 is sunsetting in 2024, it’s time to plan your migration off CentOS. Because of its enterprise viability, AlmaLinux is one of the most popular CentOS alternatives.

In this blog, we explore the reasons for choosing AlmaLinux, potential migration paths, and other considerations for teams deciding if and when to migrate to AlmaLinux. 

Back to top

Why Migrate From CentOS to AlmaLinux?

In September 2019, the CentOS community announced that CentOS Linux, the stable release, would be replaced by CentOS Stream rolling releases. This meant that there would no longer be a base version and that with every new update, there would be a risk of third-party applications breaking due to corresponding API changes.

Understandably, many people prefer the stable release distribution model, where the software stays the same on major versions, and security updates, including bug fixes, are backported. In response to this need, CentOS Linux alternatives like AlmaLinux and Rocky Linux have emerged.

Back to top

Choosing Your CentOS to AlmaLinux Migration Path

It is possible to migrate a system to AlmaLinux in place, or build a new system and migrate data and applications over. Each pathway has advantages and disadvantages.

If you are on physical hardware, migrating in place may be the easiest (and cheapest) route because it does not require more systems. In this scenario, it’s important to make sure that connections are stable, and the machine will be available the whole time, because the system could end up in an unrecoverable state if the script gets interrupted. If that were to happen, you would need a rescue disk and some manual work to get back to functionality. If you can't take a system out of use to rebuild, then running the migration may be the best option.

However, if you have spare hardware or are on a virtualized infrastructure, it would be preferable (and safer) to build a new system to your specifications, migrate the apps and data over, and then replace the old system with the new one.

CentOS 6 to AlmaLinux

Since there is no direct migration path from Centos 6 to AlmaLinux (AlmaLinux starts at 8.4), you must be on CentOS 8.4 at least in order to migrate.

Two possible approaches — the first would be to upgrade from 6 to 7 to 8, and then migrate your data. However, this would be time-consuming and risky because of all the package changes between major versions.

The second (and more advisable) approach is to build a new machine prior to migrating. Best case scenario: All required third-party software has a new version, and data can be safely upgraded. Worst case: There is software that depends on CentOS libraries. If the latter is true, you would need to either find alternatives, or identify a way to run the software anyway. Fortunately, containerization makes it relatively easy nowadays to run older versions of software on newer systems, or even on completely different distributions.

CentOS 7 to AlmaLinux

The migration path for CentOS 7 is virtually identical to CentOS 6, but a little easier because CentOS 7 already uses systemd for service management, whereas CentOS 6 uses legacy SysV init scripts. There are a few other changes, but that is a major one that makes upgrading from 7 less complex than 6.

CentOS 8 to AlmaLinux

Since CentOS 8 and AlmaLinux are nearly identical, this is a relatively painless migration. Minor changes only; the CentOS repos are swapped out for AlmaLinux repos, and a handful of packages (mostly branding packages) are replaced.

Back to top

Migrating From CentOS Stream to AlmaLinux

The script automates the process of converting a CentOS Stream system to AlmaLinux 8. It creates the repo files for AlmaLinux, replaces branded packages, and then performs a distro-sync to sync up the system to the current version of the packages in the repos.

Back to top

Available AlmaLinux Migration Scripts

The only official migration script is, provided by AlmaLinux itself. This script will not only migrate CentOS 8 to AlmaLinux, but also Oracle Linux 8, RHEL 8, Rocky Linux 8, Virtuozzo Linux (VZLinux) 8, and CentOS Stream, along with the version 9 variants.

There may be others out there, but you should proceed with caution, and verify the script does what is wanted.

Back to top

Things to Consider Before You Migrate

The migration will work with CentOS Stream, but some packages may be a little newer than the current AlmaLinux packages, so it downgrades packages using distro-sync to match the current version in the repos.

AlmaLinux aims to be 100% compatible with upstream RHEL, and new releases should be within a few weeks of upstream. While it is not recommended to upgrade between major versions, it is possible to do so if you have to.

Back to top

Final Thoughts

For those who want the same experience they had with CentOS Linux, migrating to AlmaLinux makes perfect sense. If you are on CentOS 6 or 7, the migration will require a few extra steps and a little more planning but is still worth it if you prefer the stable release model.

24/7/365 Technical Support for AlmaLinux 

Backed by ironclad SLAs, our team of experts can support your AlmaLinux or other Enterprise Linux deployments.  

See AlmaLinux Support Options

Additional Resources

Back to top