Migrating CentOS 8 to Rocky Linux or AlmaLinux via ELevate
A technical guide on migrating EOL CentOS 8 systems to Rocky Linux or AlmaLinux using the ELevate framework to maintain stability without a full reinstall.
28 Sept 2025, 15:44 UTC

CentOS 8 reached End-of-Life (EOL), meaning systems no longer receive security patches or bug fixes. For production environments where a full OS reinstallation is too disruptive, the engineering solution is a binary-compatible migration to Rocky Linux or AlmaLinux. This is achieved using the ELevate framework, which replaces the distribution-specific core packages while preserving application data and local configurations.
Migration Prerequisites
To prevent broken dependency chains or partial upgrades, ensure the following conditions are met before starting:
- Full System Update: The current CentOS 8 installation must be fully patched. Run
sudo dnf updateand reboot if a kernel update occurred. - System Snapshot: Because this process modifies core system libraries and the bootloader, a full-system snapshot or verified backup is mandatory.
- Repository Access: The server must have outbound connectivity to the target distribution's mirrors. If standard mirrors are unreachable, you may need to point your
.repofiles to the CentOS vault. - Disk Space: Ensure at least 5GB of available space in
/var/cache/dnfand the root partition to handle the package swap.
Step 1: Installing the Migration Toolset
The ELevate project provides a release package that adds the necessary repositories to facilitate the transition. Run these commands as root or via sudo:
# Install the ELevate release package
sudo dnf install -y centos-release-elevate-le
Next, install the specific upgrade agent for your chosen destination. For AlmaLinux, use almalinux-deploy; for Rocky Linux, use rocky-deploy. This example uses AlmaLinux:
# Install the AlmaLinux deployment tool
sudo dnf install -y almalinux-deploy
Step 2: Pre-Upgrade Diagnostic Analysis
Before committing changes to the disk, you must run a pre-upgrade check. This diagnostic identifies incompatible third-party repositories or conflicting packages that would cause the migration to fail mid-process.
# Run the pre-upgrade check
sudo almalinux-deploy --preupgrade
Diagnostic Decision: If the output lists "Inhibitors," the migration will not proceed. Common inhibitors include custom third-party repos (e.g., EPEL or proprietary drivers). You must either update these repositories to their target-distro equivalents or disable them in /etc/yum.repos.d/ before re-running the check.
Step 3: Executing the Distribution Swap
Once the pre-upgrade check returns a clean bill of health, execute the migration. This command replaces the CentOS 8 base packages with the target distribution's packages.
# Execute the migration
sudo almalinux-deploy
This operation typically takes 15 to 45 minutes. Once the process completes, the system will prompt for a reboot to initialize the new kernel and distribution identity.
Step 4: Post-Migration Verification
After the reboot, verify that the system identity has shifted and the package manager is communicating with the correct mirrors.
Verify OS Identity
Check the os-release file to confirm the distribution change:
cat /etc/os-release
The ID and PRETTY_NAME fields should now reflect AlmaLinux or Rocky Linux.
Verify Package Manager Health
Ensure the DNF metadata is synchronized and no broken dependencies remain:
sudo dnf check update
Application Validation
Check the status of critical services (e.g., Nginx, MariaDB) to ensure no shared library conflicts were introduced during the package swap:
sudo systemctl status [service_name]
Recovery and Limitations
If the --preupgrade check fails, no changes have been made to the system; simply resolve the inhibitors. If the system fails to boot after the final migration step, use the GRUB menu to attempt booting into the previous kernel. If the bootloader is corrupted, boot from a Live ISO of the target distribution and use a chroot environment to repair the packages.
Rollback: Because this operation performs an in-place replacement of core system binaries, there is no built-in "undo" command. The only reliable rollback mechanism is restoring the full-system snapshot taken during the prerequisites phase.
0 replies
A thoughtful contribution can make all the difference. Be the first to share one.