Home CentOS How To Migrate CentOS 7 To AlmaLinux 8, CentOS Stream 8, Oracle Linux 8, Rocky Linux 8 Using ELevate Utility

How To Migrate CentOS 7 To AlmaLinux 8, CentOS Stream 8, Oracle Linux 8, Rocky Linux 8 Using ELevate Utility

Upgrade CentOS 7 to AlmaLinux 8, CentOS Stream 8, Oracle Linux 8, and Rocky Linux 8

By sk
Published: Updated: 33.6K views

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"
Check CentOS version
Check CentOS version

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

Install elevate-release package in your CentOS 7 system using command:

$ sudo yum install http://repo.almalinux.org/elevate/elevate-release-latest-el7.noarch.rpm
Install ELevate program in CentOS 7
Install ELevate program in CentOS 7

Step 2: Install Leapp and migration data

The 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:

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

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.

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
Start preupgrade check

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.

WARNING:

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
Upgrade CentOS 7 to RHEL 8 derivatives such as AlmaLinux, CentOS Stream, Oracle, and Rocky Linux
Upgrade CentOS 7 to RHEL 8 derivatives such as AlmaLinux, CentOS Stream, Oracle, and Rocky Linux

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.

Migrating CentOS 7 to AlmaLinux 8
Migrating CentOS 7 to AlmaLinux 8

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

Sample output:

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"
Check AlmaLinux version
Check AlmaLinux version

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 or root user:

$ sudo dnf clean packages

Update hostname

Finally, update the hostname, username to match with AlmaLinux.

$ sudo hostnamectl set-hostname almalinux8

All done! Reboot your system to take effect the changes.

Conclusion

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.

Resource:

You May Also Like

18 comments

robert November 2, 2021 - 9:12 pm

Great to know, I have a slightly complex situation where I have used MD Raid Array to mirror 2 1TB drives in my workstation (Centos 7).

I have the following repo’s:

repo id repo name status
base/7/x86_64 CentOS-7 – Base 10,072
epel/x86_64 Extra Packages for Enterprise Linux 7 – x86_64 13,689
extras/7/x86_64 CentOS-7 – Extras 500
updates/7/x86_64 CentOS-7 – Updates 2,936
virtualbox/7/x86_64 Oracle Linux / RHEL / CentOS-7 / x86_64 – VirtualBox 98
repolist: 27,295

With this info, do you think this tool from the ELevate project I would be able to upgrade my workstation seamlessly to Almalinux?

Reply
sk November 2, 2021 - 9:59 pm

I have the same repos except Virtualbox. I think it should work without any issues. I don’t have any RAID setup in my testing machines, so I can’t comment. Please BACKUP the data and try. Alternatively, deploy the same setup in virtualbox and try ELevate. If it works in virtualbox, it should definitely work in your production machine. Good luck.

Reply
Robert November 3, 2021 - 7:58 pm

In step 3 there is a typo, I think the command is leapp

sudo leapp preupgrade

Reply
sk November 3, 2021 - 9:16 pm

Good catch. Thank you Robert. Fixed now.

Reply
Robert November 3, 2021 - 8:08 pm

Check the preupgrade results of mine:

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: LUKS encrypted partition detected
3. Inhibitor: Missing required answers in the answer file

Consult the pre-upgrade report for details and possible remediation.

Reply
sk November 3, 2021 - 9:18 pm

I don’t have a system with LUKS encrypted partition. So I couldn’t help. Please post your queries in to the AlmaLinux Bug Tracker and/or AlmaLinux Chat Migration Channel.

Reply
Terry January 21, 2022 - 8:42 pm

Thanks for sharing the process!

I have run into this error and can’t find any real info about, maybe you can share some insight?

============================================
Actor: source_boot_loader_scanner
Message: Failed to call `grubby` to list available boot entries.
Summary:
Details: Command [‘grubby’, ‘–info’, ‘ALL’] failed with exit code 1.
Stderr:
=============================================

Reply
sk January 21, 2022 - 9:04 pm

Hi Terry, I don’t have any info about this too. Never had this issue. May be you should file an issue in ELevate Github repository.

Reply
JL September 6, 2022 - 6:21 am

Got the same message.
In my case, grub2 is used.
link /etc/grub2.cfg to /boot/grub2/grub.cfg
After this link, “grubby –info ALL” would return proper infomation

Reply
Hans February 15, 2022 - 7:08 pm

Good article.

Just one question:
How can I do this if my server is not connected to the internet ?
Is there a way to tell the update script to look for the necessary files elsewhere on my LAN (where the files have been downloaded previously, of course) ?

Reply
sk February 16, 2022 - 12:23 pm

As far as I tested, there is no way to do offline upgrade. You need an Internet connection to upgrade to next version.

Reply
rajreddy April 21, 2022 - 11:25 am

I am getting this error while updating from centos7.9 to alma linux.
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.
Consult the pre-upgrade report for details and possible remediation.

Reply
sk April 21, 2022 - 11:52 am

Usually, the following commands will commands will fix all problems.

$ 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 recommend you to review the other issues from the /var/log/leapp/leapp-report.txt file

Reply
Francis Yakin April 30, 2022 - 12:20 am

I upgrade CentOS 7.9 to Rocky Linux 8, but finish, the system reboot and it display grub cmd line, it doesn’t go to Rocky linux OS – cmd line.
Need help for this issue.

Please advise

Thanks

Francis

Reply
Nicolas Munoz May 9, 2022 - 12:23 am

I had the following error after update:

[root@almalinux8 /]# sudo dnf clean packages
Traceback (most recent call last):
File “/usr/lib64/python3.6/site-packages/libdnf/error.py”, line 14, in swig_import_helper
return importlib.import_module(mname)
File “/usr/lib64/python3.6/importlib/__init__.py”, line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File “”, line 994, in _gcd_import
File “”, line 971, in _find_and_load
File “”, line 955, in _find_and_load_unlocked
File “”, line 658, in _load_unlocked
File “”, line 571, in module_from_spec
File “”, line 922, in create_module
File “”, line 219, in _call_with_frames_removed
ImportError: libbrotlidec.so.1: cannot open shared object file: No such file or directory

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/bin/dnf”, line 57, in
from dnf.cli import main
File “/usr/lib/python3.6/site-packages/dnf/__init__.py”, line 30, in
import dnf.base
File “/usr/lib/python3.6/site-packages/dnf/base.py”, line 29, in
import libdnf.transaction
File “/usr/lib64/python3.6/site-packages/libdnf/__init__.py”, line 8, in
from . import error
File “/usr/lib64/python3.6/site-packages/libdnf/error.py”, line 17, in
_error = swig_import_helper()
File “/usr/lib64/python3.6/site-packages/libdnf/error.py”, line 16, in swig_import_helper
return importlib.import_module(‘_error’)
File “/usr/lib64/python3.6/importlib/__init__.py”, line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
ModuleNotFoundError: No module named ‘_error’

How can I solve it?

Reply
Tanmay Roy July 8, 2024 - 4:01 pm

Was this ever get sorted for you?

Reply
Jeff Dvo January 16, 2023 - 6:12 am

Apologies for the long post.
I’m trying to migrate CentOS 7.9.2009 to Rocky 8 and have tried a few things without success, even using the info provided on the Rocky site.
I have a home setup of Windows 10 boxes + iPads + Android phones
The Fujitsu Primergy TX140 S1p is a headless installation and is used a SAMBA server, using a 2TB raid 5 array (with hot swapable HDDs)
I access the CentOS server remotely using Webmin, Putty and WinSCP because I’m more knowledgeable about Windows.

Love this article and the way it is clearly set out but I’m struggling to complete the migration 🙁

I no longer have YUM installed so used DNF to install Elevate and that progressed OK.
I then used DNF to install leapp-data-rocky and carried out the leapp preupgrade.

Which gave an Error “Failed to exceute script to apply transaction workaround yum config fix. Message” ( I can provide full message)

Leapp_Answer File gives “[remove_pam_pkcs11_module_check]” (I can provide full message)

The Leapp_report gives a few “problems” (I can provide full message)
Risk Factor: high
Title: Packages from unknown repositories may not be installed

Risk Factor: high
Title: GRUB core will be updated during upgrade

Risk Factor: high
Title: Packages not signed by Red Hat found on the system

Risk Factor: high
Title: Difference in Python versions and support in RHEL 8

Risk Factor: high
Title: Failed to exceute script to apply transaction workaround yum config

Risk Factor: medium
Title: chrony using default configuration

Risk Factor: low
Title: Postfix has incompatible changes in the next major version

Risk Factor: low
Title: Grep has incompatible changes in the next major version

Risk Factor: low
Title: Dosfstools incompatible changes in the next major version

Risk Factor: low
Title: The subscription-manager release is going to be kept as it is during the upgrade

Risk Factor: info
Title: Current PAM and nsswitch.conf configuration will be kept.

Risk Factor: info
Title: SElinux disabled

Looking for advice on moving forward.

Reply
sk January 16, 2023 - 12:16 pm

That’s odd. I never had this issue while upgrading to Rocky Linux. Please post your issue in ELevate GitHub repository.

Reply

Leave a Comment

* By using this form you agree with the storage and handling of your data by this website.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

This website uses cookies to improve your experience. By using this site, we will assume that you're OK with it. Accept Read More