CentOS 7 reached end of life in June 2024 and gets no more security updates. The ELevate project from AlmaLinux uses the leapp tool to upgrade a CentOS 7 server in place to AlmaLinux 8, keeping data and most configuration. After that, AlmaLinux 8 can be elevated again to 9.
Before you start
- A full, tested backup or snapshot. An in-place major upgrade can fail and leave the server unbootable.
- Console access to the VPS, not just SSH.
- At least 5 GB free on
/and a fully updated CentOS 7 system. - Compare targets in AlmaLinux vs Rocky Linux.
Danger: cPanel servers must use cPanel's own ELevate script, not plain leapp. For any panel, follow the vendor's documented method or migrate to a fresh server.
Tip: For production sites, a fresh AlmaLinux server plus a migration is often safer and quicker than an in-place upgrade. Use ELevate when rebuilding is impractical.
Update CentOS 7 and reboot
CentOS 7 mirrors moved to the vault, so make sure yum can still reach a repository, then:
sudo yum update -y
sudo rebootInstall ELevate and leapp
sudo yum install -y http://repo.almalinux.org/elevate/elevate-release-latest-el7.noarch.rpm
sudo yum install -y leapp-upgrade leapp-data-almalinuxRun the pre-upgrade check
sudo leapp preupgradeRead /var/log/leapp/leapp-report.txt. Items marked inhibitor block the upgrade. Common ones and fixes:
sudo rmmod pata_acpi
echo PermitRootLogin yes | sudo tee -a /etc/ssh/sshd_config
sudo leapp answer --section remove_pam_pkcs11_module_check.confirm=TrueOnly apply the fixes your report asks for, then re-run leapp preupgrade until no inhibitors remain. If you allowed root login only for the upgrade, remove it afterwards (see disable root SSH login).
Run the upgrade
sudo leapp upgrade
sudo rebootThe server boots into a special upgrade environment and can take 20 to 60 minutes. Watch progress in the VPS console; do not power it off.
Verify the result
cat /etc/redhat-release
uname -r
sudo dnf upgrade -y
rpm -qa | grep el7Remove leftover el7 packages that have no el8 replacement, check systemctl --failed, and test every website and service. Firewall and SELinux defaults may have changed; see firewalld on AlmaLinux and SELinux basics.
Troubleshooting
- Repository errors on yum: point CentOS 7 repos at
vault.centos.org. - Upgrade stops in the initramfs: check
/var/log/leapp/leapp-upgrade.logfrom the console; restore your backup if it cannot boot. - Third-party packages break: reinstall them from el8 repositories (EPEL 8, Remi).
