As you may already know, it was not possible to migrate between major version of RHEL-derivatives. Meaning - you can't directly upgrade from CentOS 7.x to CentOS 8.x version. The only way was fresh installation. Not anymore! You can now easily migrate from CentOS 7.x to any 8.x of your choice using ELevate tool. This guide explains how to migrate CentOS 7 to AlmaLinux 8, CentOS Stream 8, Oracle Linux 8, and Rocky Linux 8 using AlmaLinux ELvate tool.
What is ELevate?
ELevate is an open source migration tool developed by AlmaLinux team. It allows you to easily and smoothly migrate between major versions of RHEL-based distributions from 7.x to 8.x version.
ELevate combines Red Hat's Leapp framework with a community created library and service for the migration metadata set required for it.
It currently supports migration from CentOS 7 to the following OSes:
- AlmaLinux OS 8
- CentOS Stream 8
- Oracle Linux 8
- Rocky Linux 8
Migrations can be done in place, meaning data and configuration files are preserved. In other words, all the installed applications and settings and data will remain intact. However, the users are HIGHLY ENCOURAGED to backup the important data before starting the migration.
ELevate is an open source program, released under the Apache 2.0 License.
For those wondering, the letters "EL" from ELevate stands for Enterprise Linux.
Things to remember before starting CentOS 7 migration
- As stated earlier, it is strongly recommended to backup your important data and settings.
- Live migration is not supported. Your system will reboot twice. Make sure any important jobs (E.g. Scheduled backups) are not running.
- ELevate is still under development. So I suggest you to test it thoroughly in a virtual system or a sandbox environment before trying it in production.
I tested ELevate tool on a freshly installed CentOS 7 Virtual machine. The migration was smooth and error-free. If you encounter with any issues, report them to the AlmaLinux Bug Tracker and/or AlmaLinux Chat Migration Channel.
Update CentOS 7 system
Make sure you're running the latest CentOS 7.x branch. If not, update your CentOS system using command:
$ sudo yum update
$ sudo yum upgrade
Reboot your system to apply the changes:
$ sudo reboot
Check the currently installed CentOS 7 version using command:
$ cat /etc/centos-release CentOS Linux release 7.9.2009 (Core)
$ cat /etc/os-release NAME="CentOS Linux" VERSION="7 (Core)" ID="centos" ID_LIKE="rhel fedora" VERSION_ID="7" PRETTY_NAME="CentOS Linux 7 (Core)" ANSI_COLOR="0;31" CPE_NAME="cpe:/o:centos:centos:7" HOME_URL="https://www.centos.org/" BUG_REPORT_URL="https://bugs.centos.org/" CENTOS_MANTISBT_PROJECT="CentOS-7" CENTOS_MANTISBT_PROJECT_VERSION="7" REDHAT_SUPPORT_PRODUCT="centos" REDHAT_SUPPORT_PRODUCT_VERSION="7"
As you can see, my system is running with CentOS 7.9 version. This is the latest version in the 7.x branch.
Migrate CentOS 7 To AlmaLinux 8, CentOS 8, Rocky Linux 8, And Oracle Linux 8
Step 1: Install ELevate
elevate-release package in your CentOS 7 system using command:
$ sudo yum install http://repo.almalinux.org/elevate/elevate-release-latest-el7.noarch.rpm
Step 2: Install Leapp and migration data
elevate-release package provides the Leapp utility and the necessary data to migrate Enterprise Linux 7.x to any Enterprise Linux 8.x versions of our choice.
Depending upon the distribution you want to upgrade, you need to install any one of the following packages:
For instance, if you want to migrate CentOS 7 to AlmaLinux 8, you need to install the following packages:
$ sudo yum install -y leapp-upgrade leapp-data-almalinux
To migrate CentOS 7 to CentOS 8, install the following packages:
$ sudo yum install -y leapp-upgrade leapp-data-centos
To migrate CentOS 7 to Oracle Linux 8, install the following packages:
$ sudo yum install -y leapp-upgrade leapp-data-oraclelinux
To migrate CentOS 7 to Rocky Linux 8, install the following packages:
$ sudo yum install -y leapp-upgrade leapp-data-rocky
We have now installed the
leap-upgrade package and the migration data for the OS we want to upgrade.
For the purpose of this guide, I am going to upgrade CentOS 7 to AlmaLinux 8.
Step 3: Start preupgrade check
Next run the following command to check if upgrade is possible or not:
$ sudo leapp preupgrade
This will perform a series of actions and verify if it is possible to perform the upgrade.
==> Processing phase `configuration_phase` ====> * ipu_workflow_config IPU workflow config actor ==> Processing phase `FactsCollection` ====> * scanmemory Scan Memory of the machine. ====> * source_boot_loader_scanner Scans the boot loader configuration on the source system. . . . ============================================================ UPGRADE INHIBITED ============================================================ Upgrade has been inhibited due to the following problems: 1. Inhibitor: Detected loaded kernel drivers which have been removed in RHEL 8. Upgrade cannot proceed. 2. Inhibitor: Multiple devel kernels installed 3. Inhibitor: Possible problems with remote login using root account 4. Inhibitor: Missing required answers in the answer file Consult the pre-upgrade report for details and possible remediation. ============================================================ UPGRADE INHIBITED ============================================================ Debug output written to /var/log/leapp/leapp-preupgrade.log ============================================================ REPORT ============================================================ A report has been generated at /var/log/leapp/leapp-report.json A report has been generated at /var/log/leapp/leapp-report.txt ============================================================ END OF REPORT ============================================================ Answerfile has been generated at /var/log/leapp/answerfile
At the end of the preupgrade check, the Leapp utility will generate a report in
/var/log/leapp/leapp-report.txt file. This file contains possible problems and recommended solutions. No rpm packages will be installed at this phase.
Preupgrade check will fail if the default CentOS 7 doesn't meet all requirements for migration. In that case, you need to fix all the problems and try again.
The following fixes from the
/var/log/leapp/leapp-report.txt file are mandatory, but you can also review the rest of them if needed.
In my case, I fixed the following issues:
$ 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
I also had to remove the extra kernel devels.
List the installed kernels in CentOS:
$ rpm -qa kernel kernel-3.10.0-1160.45.1.el7.x86_64 kernel-3.10.0-1160.42.2.el7.x86_64
As you see above, there are currently two kernels installed in my system.
Remove the old kernel and kernel-devels and keep only the currently active Kernel using command:
$ sudo package-cleanup --oldkernels --count=1
Once you fixed all the problems, run the following command to migrate CentOS 7 to any Enterprise Linux 8.x of you choice:
$ sudo leapp upgrade
Once the upgrade is completed, reboot your system:
$ sudo reboot
A new entry called
ELevate-Upgrade-Initramfs in the GRUB menu will appear. The system will be automatically booted into it. You can view the how the update process goes in the console.
System will automatically reboot once the upgrade is completed. The GRUB menu entries will be automatically updated depending upon the OS.
Login to the system and verify that the current OS is the one you need.
$ cat /etc/os-release
NAME="AlmaLinux" VERSION="8.4 (Electric Cheetah)" ID="almalinux" ID_LIKE="rhel centos fedora" VERSION_ID="8.4" PLATFORM_ID="platform:el8" PRETTY_NAME="AlmaLinux 8.4 (Electric Cheetah)" ANSI_COLOR="0;34" CPE_NAME="cpe:/o:almalinux:almalinux:8.4:GA" HOME_URL="https://almalinux.org/" DOCUMENTATION_URL="https://wiki.almalinux.org/" BUG_REPORT_URL="https://bugs.almalinux.org/" ALMALINUX_MANTISBT_PROJECT="AlmaLinux-8" ALMALINUX_MANTISBT_PROJECT_VERSION="8.4"
Great! We've successfully upgraded CentOS 7 to AlmaLinux 8.4 version.
Clear cache (Optional)
All the downloaded packages during the migration will be saved in cache until the next successful transaction. You can remove cached packages by executing the following command as
$ sudo dnf clean packages
Finally, update the hostname, username to match with AlmaLinux.
$ sudo hostnamectl set-hostname almalinux8
All done! Reboot your system to take effect the changes.
In this guide, we have seen how to upgrade CentOS 7 to RHEL 8 derivatives such as AlmaLinux, CentOS Stream, Oracle Linux, and Rocky Linux with the help of ELevate project from AlmaLinux developers.
I didn't expect that CentOS 7 migration to RHEL 8 derivatives was going to be this much easier! AlmaLinux devs have done a commendable job. Be it a bug fix, or a feature addition, they quickly step in and work on it. They were the first one to release a stable alternative to CentOS 8. They also provided a Bash script to easily convert existing CentOS 8 systems to AlmaLinux 8. For more details, refer the following guide.