ELevate to the Future

For years, CentOS was the operating system of choice for users who needed a free enterprise Linux solution. CentOS offered a predictable lifecycle and a long lifespan for each release, making it a reliable alternative to the commercial Red Hat Enterprise Linux (RHEL) distribution. That all changed in 2020 when Red Hat replaced CentOS 8 with CentOS Stream and announced that CentOS 7 would reach end of life on June 30, 2024.

Despite its name, CentOS Stream does not serve as a replacement for CentOS. While CentOS sat downstream of RHEL, making it a reliable replacement for RHEL, CentOS Stream sits upstream and serves as a developmental platform for RHEL contributors. As a result, Red Hat has warned that CentOS Stream is not considered stable for production environments.

As one would expect from the open source community, CentOS alternatives started popping up almost immediately after this announcement. One of these alternatives, AlmaLinux, quickly stepped in as a replacement for CentOS by offering 1:1 bug compatibility with RHEL by early 2021, eventually moving to application binary interface compatibility in 2023 when Red Hat restricted access to RHEL source code. Today, AlmaLinux provides an alternative for former CentOS users as a forever-free, community-governed, production-grade platform focused on long-term stability.

While an alternative free enterprise Linux solution is good news in light of the CentOS end of life, migration isn’t a trivial task. Luckily, AlmaLinux has simplified this task with its ELevate migration tool. Based on Red Hat’s Leapp, ELevate combines the pure Leapp framework with AlmaLinux’s forked leapp-repository,  which enables third-party repository support, plus leapp-data,  a migration metadata library (PES data, repositories mappings, RPM GPG keys) for AlmaLinux, CentOS, and vendors. As of leapp-repository v0.23.0, the AlmaLinux community now contributes AlmaLinux OS support to the Leapp upstream project, making ELevate, as a fork, much closer to the upstream.

ELevate makes it easy to convert an existing CentOS 7 installation to AlmaLinux 8. (Because ELevate supports single-step upgrades by design, you will need to upgrade to CentOS 7 first if you are still using CentOS 6 using ELevate.) As shown in Figure 1, you can also use ELevate as a regular upgrade tool, moving from versions 8 or 9 to version 10 within the same OS.

Figure 1: ELevate lets you upgrade in-place from CentOS to AlmaLinux OS (or CentOS Stream).

If your CentOS install used the popular Extra Packages for Enterprise Linux (EPEL) repository, ELevate support is available for upgrades to AlmaLinux OS (but not for CentOS Stream). However, this support only works for Enterprise Linux (EL) 9 packages that are currently available in EL 10. ELevate also supports other third-party repositories: Docker CE, KernelCare, MariaDB, NGINX, TuxCare, and PostgreSQL for all supported systems (AlmaLinux and CentOS), as well as Imunify for upgrades to EL 8 and EL 10.

To get started on your migration journey to AlmaLinux, I will show you how to use ELevate to migrate from CentOS 7 to AlmaLinux 8.

Precautions Before Upgrading

This article intends to be a quick-start guide on ELevate to help you upgrade away from CentOS 7 to AlmaLinux quickly and painlessly. Before you get started, it’s important you adopt the necessary precautions and make the required preparations. You can also find the complete, step-by-step procedure on the AlmaLinux website.

While ELevate is being used to upgrade production systems in the wild, caution is still advised. At the very least, you should back up your systems before you get started, just in case. AlmaLinux recommends doing a trial run in a sandbox to verify the migration works in your environment before migrating a production system.

The upgrade process will be done in-place, which means AlmaLinux will be installed over your CentOS instance directly. The machine being subjected to conversion will need to be rebooted more than once.

Only single-step upgrades are supported. This means that if you intend to migrate to AlmaLinux 9 (or AlmaLinux 10 or AlmaLinux Kitten 10), you will need to migrate to AlmaLinux 8 first and then upgrade from there.

Gathering the Tools

Before you start migrating, you first must ensure your CentOS instance is up to date. I like to reboot after system updates to ensure every installed service loads the updated components. Because the CentOS 7 repositories are now offline, you will need to swap to the CentOS vault, or you can use AlmaLinux’s CentOS 7 mirror that has been set up for use with ELevate as follows:

$ sudo curl ‑o /etc/yum.repos.d/CentOS‑Base.repo https://el7.repo.almalinux.org/centos/CentOS‑Base.repo
$ sudo yum update ‑y
$ sudo reboot

Next, you need to install ELevate. You can install the standard release from the associated AlmaLinux repository, which you can enable as follows:

$ sudo yum install ‑y http://repo.almalinux.org/elevate/elevate‑release‑latest‑el$(rpm ‑‑eval %rhel).noarch.rpm

As mentioned earlier, ELevate uses Red Hat’s upgrade tool, Leapp. In order to migrate to AlmaLinux, you must fetch Leapp, along with the patch files that will configure it to upgrade CentOS 7 into AlmaLinux:

$ sudo yum install ‑y leapp‑upgrade leapp‑data‑almalinux

Ready to Migrate

It is a good idea to ensure your applications will run on AlmaLinux before you migrate. AlmaLinux provides a pre-upgrade check to determine the feasibility of the migration. When migrating from CentOS 7, you are likely to get a failure message at this stage, which is to be expected (Figure 2). Make sure you invoke the preupgrade checks with the following command:

$ sudo leapp preupgrade
Figure 2: This failure message is to be expected. In order to proceed further, you need to fix the problems listed in /var/log/leapp/answerfile.

During the pre-upgrade stage, a report will be saved to /var/log/leapp/leapp‑report.txt with a list of dangerous actions that might occur during the migration. Some suggestions are also given. Most likely, a file will be generated in /var/log/leapp/answerfile with questions that require a true/​false answer. These questions must be answered before the upgrade can take place (Figure 3). You can answer these questions by either editing the file directly or using leapp answer . Listing 1 shows the bare minimum fixes you should perform immediately after running preupgrade in order to satisfy the answerfile from a CentOS 7 install.

Figure 3: The issues listed in /var/log/leapp/answerfile must be resolved before the upgrade process can commence.

Listing 1

Common Fixes after the Pre-Upgrade

sudo rmmod pata_acpi
echo PermitRootLogin yes | sudo tee ‑a /etc/ssh/sshd_config
sudo leapp answer ‑‑section remove_pam_pkcs11_module_check.confirm=True

Once you are ready, launch the upgrade by issuing the final command:

$ sudo leapp upgrade

You will need to reboot manually afterwards (Figure 4). A new entry in GRUB, ELevate‑Upgrade‑Initramfs , will appear, which is where the system will be automatically booted into. Console access is required to view the actual upgrade process.

Figure 4: Once leapp upgrade is finished, the only thing left to do is to reboot your machine.

The machine will be rebooted once again (to restore SElinux), and then it will boot into the new AlmaLinux 8 distribution. At this point, you should check for any remaining logs or packages from the previous OS version; these can be removed or upgraded manually. If you run into any additional issues, please see the ELevate Frequent Issues page on the AlmaLinux website.

Verifying SELinux State

Running leapp will set SELinux to permissive mode during the upgrade in order to carry it out. This should not be an issue for most users. Nevertheless, if you had SELinux enabled in CentOS 7, you might want to have it enabled in AlmaLinux 8. You can check the current SELinux state with the following command:

$ getenforce

If the output of the above command is Enforcing,  SELinux is enabled and there is nothing left to do. If not, you can set SELinux to enforcing mode by editing /etc/selinux/config and setting the variable SELINUX within the config file to enforcing . You then need to reboot your system for the configuration to take effect.

Conclusion

With CentOS 7 no longer receiving updates or support, you need a migration plan. ELevate helps you migrate from CentOS to AlmaLinux with relative ease. During testing, I discovered that ELevate could reliably upgrade a CentOS 7 machine, which hosted a Dockerized web application and some EPEL services, using nothing but the steps described in this article (Figure 5).

Figure 5: Welcome to AlmaLinux! This is what a successful migration to AlmaLinux 8 looks like.

Once you have AlmaLinux 8 installed, you can use ELevate to upgrade to AlmaLinux 9. From there, you can even move ahead to AlmaLinux 10.

As a community-driven Linux OS, AlmaLinux welcomes contributions to the ELevate project. For more information, see the “Get Involved” box.

Get Involved

If you’d like to contribute to ELevate, the AlmaLinux Package Evolution Service (PES) collects bug reports and issues from users as well as supplies information on migrating from one RHEL-compatible distribution to another. For more information on how to contribute to PES, see the ELevate Contribution Guide.

This article was made possible by support from AlmaLinux OS Foundation through Linux New Media’s Topic Subsidy Program.

comments powered by Disqus
Subscribe to our ADMIN Newsletters
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs



Support Our Work

ADMIN content is made possible with support from readers like you. Please consider contributing when you've found an article to be beneficial.

Learn More”>
	</a>

<hr>		    
			</div>
		    		</div>

		<div class=