
Table of Contents
By Khimananda Oli | Last reviewed: August 2026
If you are still running CentOS 7 or CentOS Stream 8 in production, you need a validated path to migrate from CentOS to Rocky Linux before support gaps expose your infrastructure to security risks. The ELevate project provides an in-place upgrade mechanism that preserves users, services, and configurations while swapping the underlying RPM base to a supported RHEL-compatible release. This guide walks through the exact preparation, execution, and verification steps I use when converting legacy fleets, ensuring you avoid common pitfalls like broken repositories or orphaned packages during the transition.
How do you prepare a server before you migrate from CentOS to Rocky Linux?
Preparation determines whether your migration succeeds cleanly or leaves you debugging a half-converted system at 2 AM. Before you attempt to migrate from CentOS to Rocky Linux, treat the server as if it might fail mid-process. A proper safety net lets you roll back instantly rather than rebuilding from scratch. For teams managing critical workloads, reviewing our server backup strategies guide reinforces principles that apply equally well to RHEL-family systems.
Create a verified full-system backup
Do not rely solely on application-level dumps. You need a block-level snapshot or complete filesystem archive that you can restore without reinstalling the OS. If you run on VMware, Proxmox, or AWS EC2, take a VM snapshot or EBS snapshot immediately before starting. For bare metal or VPS instances without snapshot APIs, use fsarchiver or dd to image the disk, or at minimum run a full rsync -aAXvHx to external storage preserving ACLs, xattrs, and hard links.
# Example: Full filesystem backup with fsarchiver (run from rescue/live media)
fsarchiver savefs /backup/centos-pre-migrate.fsa /dev/sda1 -v
# Alternative: rsync with all metadata preserved
rsync -aAXvHx --delete / /mnt/backup/ --exclude={/proc/*,/sys/*,/dev/*,/run/*,/tmp/*,/mnt/*,/media/*,/lost+found} Audit third-party repositories and custom packages
ELevate handles official CentOS and EPEL repositories automatically, but third-party repos (RPM Fusion, Remi, IUS, custom internal mirrors) often lack migration metadata. List all enabled repos and identify non-standard ones:
yum repolist all | grep enabled
rpm -qa --qf '%{VENDOR} %{NAME}\n' | grep -v 'CentOS\|Red Hat\|EPEL' | sort -u Disable or remove incompatible third-party repos before migration. Packages from these sources may need manual reinstallation after the base OS converts. Document every custom package so you can verify functionality post-migration.
Verify disk space and kernel compatibility
The upgrade process downloads several gigabytes of packages and creates temporary initramfs images. Ensure at least 5 GB free in /var/cache and /boot. Old kernels accumulate over time; clean them to prevent /boot exhaustion:
# Keep only current and one previous kernel
package-cleanup --oldkernels --count=2 -y
# Verify /boot has sufficient space
df -h /boot /var/cache/yum What tools automate the CentOS to Rocky Linux migration process?
The ELevate project is the standard toolchain for in-place migrations across RHEL derivatives. It wraps Red Hat’s Leapp framework with distribution-specific metadata, enabling cross-distro upgrades that Red Hat does not officially support. When you migrate from CentOS to Rocky Linux, ELevate handles repository mapping, package replacement, and configuration adjustments automatically.
Install the correct ELevate release package
Select the ELevate package matching your source OS version. Using the wrong package causes metadata mismatches and failed pre-upgrade checks:
# For CentOS 7 → Rocky Linux 9
yum install -y http://repo.almalinux.org/elevate/elevate-release-latest-el7.noarch.rpm
# For CentOS Stream 8 → Rocky Linux 9
dnf install -y http://repo.almalinux.org/elevate/elevate-release-latest-el8.noarch.rpm
# Install leapp with Rocky-specific data
yum install -y leapp-upgrade leapp-data-rocky # EL7
dnf install -y leapp-upgrade leapp-data-rocky # EL8 Understand what ELevate actually modifies
ELevate does not reinstall the OS. It performs a transactional package swap: removing CentOS-branded packages, installing Rocky Linux equivalents, updating GRUB, and regenerating initramfs. User data in /home, /var, and /opt remains untouched. Configuration files receive .rpmnew suffixes when upstream defaults change; your originals stay intact but may need manual merging.
How do you execute the in-place upgrade safely?
Execution follows a strict two-phase pattern: pre-upgrade assessment, then actual upgrade. Never skip the pre-upgrade phase. It identifies blockers without modifying the system, giving you a chance to fix issues while rollback is trivial.
Run pre-upgrade and resolve all inhibitors
The pre-upgrade generates a detailed report listing errors (must-fix), warnings (review recommended), and informational messages:
leapp preupgrade --target 9.4 --channel ga
# Review the report
cat /var/log/leapp/leapp-report.txt
less /var/log/leapp/answerfile Common inhibitors include:
- Incompatible kernel modules: Remove proprietary drivers lacking EL9 builds, or switch to open-source alternatives.
- Deprecated PAM configurations: Update
/etc/pam.d/files per Leapp remediation instructions. - Python 2 dependencies: Migrate scripts to Python 3 before upgrading; EL9 drops Python 2 entirely.
- Conflicting third-party packages: Remove or replace packages from disabled repos that have no EL9 equivalent.
After resolving each inhibitor, re-run leapp preupgrade until zero errors remain. Warnings are acceptable if you understand their impact; document accepted warnings in your change log.
Execute the upgrade with controlled reboot
Once pre-upgrade passes cleanly, schedule a maintenance window. The upgrade itself takes 30–90 minutes depending on package count and disk speed:
# Start the upgrade (system will reboot automatically)
leapp upgrade --target 9.4 --channel ga
# Monitor progress via serial console or IPMI if SSH drops
# After reboot, check migration status
cat /var/log/leapp/leapp-upgrade.log
journalctl -u leapp-resume.service During reboot, the system boots into a special Leapp initramfs that performs the actual package transaction. Do not interrupt this phase. If power loss occurs, restore from your pre-migration backup rather than attempting recovery.
What post-migration validation ensures Rocky Linux works correctly?
A successful boot does not mean a successful migration. Post-upgrade validation confirms that services function, security policies enforce correctly, and no orphaned artifacts remain. Teams running databases should cross-reference our PostgreSQL administration essentials to verify database integrity after OS-level changes.
Verify OS identity and repository state
Confirm the system identifies as Rocky Linux and pulls updates from correct repositories:
# Confirm OS release
cat /etc/os-release
hostnamectl
# Verify Rocky repos are active and CentOS repos removed
dnf repolist all | grep -E 'rocky|baseos|appstream'
ls /etc/yum.repos.d/ | grep -i centos # Should return nothing
# Test update path works
dnf check-update Validate critical services and SELinux context
SELinux relabeling occurs during upgrade, but mislabeled files cause silent denials. Force a complete relabel if services behave unexpectedly:
# Trigger full SELinux relabel on next boot
touch /.autorelabel
reboot
# After relabel completes, check for denials
ausearch -m avc --recent | audit2why
sestatus # Must show "enforcing" Test every production service: web servers, databases, cron jobs, monitoring agents, and backup routines. Compare behavior against pre-migration baselines. Pay special attention to systemd unit files; some legacy units require syntax updates for EL9 systemd.
Clean up migration artifacts
Remove Leapp packages and temporary files once validation completes. These serve no purpose on a stable Rocky system and consume disk space:
# Remove migration tooling
dnf remove -y leapp leapp-upgrade leapp-data-rocky elevate-release
# Clean cached packages and old kernels
dnf clean all
dnf autoremove -y
package-cleanup --oldkernels --count=2 -y
# Archive migration logs for audit trail
tar czf /root/centos-to-rocky-migration-$(date +%F).tar.gz /var/log/leapp/ | Criteria | CentOS 7 | Rocky Linux 9 |
|---|---|---|
| Vendor Support | Ended June 2024 | Active until May 2032 |
| Kernel Version | 3.10.x (frozen) | 5.14.x (backported fixes) |
| Default Python | 2.7 (EOL) | 3.9+ (maintained) |
| OpenSSL | 1.0.2 (insecure) | 3.0.x (FIPS-capable) |
| Container Runtime | Docker 1.x only | Podman 4.x, CRI-O, Buildah |
| Compliance Readiness | Fails modern audits | SOC 2 / ISO 27001 aligned |
| In-Place Migration Path | N/A (source only) | ELevate supported |
Migrate from CentOS to Rocky Linux with confidence
When you migrate from CentOS to Rocky Linux using ELevate, you preserve operational continuity while gaining a decade of security support and modern tooling. The key is disciplined preparation: verified backups, thorough pre-upgrade remediation, and systematic post-migration validation. Skipping any phase invites preventable outages. For teams needing hands-on assistance with fleet conversions or compliance-aligned infrastructure transitions, reach out directly to discuss your specific environment. Proper planning today prevents emergency rebuilds tomorrow.