Migrate CentOS 7 to 8 of AlmaLinux / CentOS Stream/ Rocky Linux / Oracle Linux

Elevate is an open-source project developed by the AlmaLinux team that allows the migration of CentOS 7 to newer and major versions of RHEL-based distributions such as AlmaLinux 8, Rocky Linux 8, Oracle Linux 8, and CentOS Stream 8. It combines RedHat's Leapp framework with a community-developed library to assist with the migration.

This instructional guide provides you with the steps to upgrade/migrate CentOS 7 to AlmaLinux 8 using Elevate.

Currently available migration paths:

  • CentOS 7 to AlmaLinux 8
  • CentOS 7 to Rocky Linux 8
  • CentOS 7 to Oracle Linux 8
  • CentOS 7 to CentOS Stream 8
Elevate is still at an early stage of development and should only be used for testing purposes. The migration tool SHOULD NOT be tested in production servers.

Step 1: Fully update the system

First and foremost, update all the system packages and repositories.

$ sudo yum update -y

Then reboot your CentOS 7 server.

$ sudo reboot

Step 2: Install elevate-release package

The next step is to install the elevate-release package as follows.

$ sudo yum install -y http://repo.almalinux.org/elevate/elevate-release-latest-el7.noarch.rpm

Once installed, it's now time to install the Leapp packages and migration data for your preferred OS that you want to migrate to. Possible options for migration data packages include:

  • leapp-data-almalinux
  • leapp-data-rocky
  • leapp-data-centos
  • leapp-data-oraclelinux

In our case, we are migrating to AlmaLinux 8, hence, we will install the leapp-data-almalinux package.

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

Step 3: Run a pre-upgrade check

Thereafter, initiate a pre-upgrade check as indicated below. The command runs the checks to see if the upgrade will be successful or not and provides a report of possible remediations that you can take should the test fail.

 $ sudo leapp preupgrade

And indeed, the test fails for two or three reasons which are recorded in the  /var/log/leapp/answerfile file with true/false questions.  There are various recommendations which are suggested to address the inability to upgrade, however, the following suggestions are mandatory.

Therefore, run the following commands in succession

$ 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

Step 4: Upgrade from CentOS 7 to Almalinux 8

To begin the upgrade, run the following command and reboot your system

 $ sudo leapp upgrade
 $ sudo reboot

During the reboot process, a new boot option will appear labeled 'Elevate-Upgrade-Initramfs'. Select this option.

Upgrade Initramfs

The upgrade will continue and will take approximately 25 minutes. Finally, the system will reboot once again. this time with AlmaLinux grub menu options.

AlmaLinux grub

Once you have logged in, verify the OS version you are using.

$ cat /etc/redhat-release
verify the AlmaLinux OS version

In my case, the output confirms that I have successfully upgraded from CentOS 7 to AlmaLinux 8.4. And that's it. I hope that this guide was insightful and you can now seamlessly upgrade from CentOS 7 to any major RHEL 8.x based distros without a problem.

Leave a Comment