CentOS 8 reached end-of-life (EOL) on December 31, 2021, meaning no official security patches or updates are available. Running it in production exposes systems to unpatched vulnerabilities. In 2026, the safest and most common paths are in-place migrations to AlmaLinux 8 or Rocky Linux 8 — both are free, community-driven, 1:1 binary-compatible RHEL 8 clones with long-term support (through ~2029 for major version 8).
Both migrations use official, well-tested scripts that replace branding packages, swap repositories, and perform a distro-sync — typically completing in 10–60 minutes with minimal downtime.
Key Differences: AlmaLinux vs Rocky Linux (Quick Comparison)
| Aspect | AlmaLinux 8 | Rocky Linux 8 |
|---|---|---|
| Migration Script | almalinux-deploy.sh (official, simple) | migrate2rocky.sh (official) |
| Support Duration | Until 2029 (aligned with RHEL 8) | Until 2029 (aligned with RHEL 8) |
| Community Focus | Broad compatibility, frequent point releases | Strong emphasis on 1:1 fidelity, founded by CentOS co-creator |
| Control Panel Support | Excellent (cPanel, Plesk, DirectAdmin tested) | Very good (similar ecosystem) |
| 2026 Recommendation | Slightly easier script + broader testing reports | Excellent if you prefer the “classic CentOS feel” |
Both are excellent choices — pick based on team familiarity or existing tooling.
Pre-Migration Checklist (Mandatory for Safety)
Before running any script:
Backup everything
- Full system snapshot (cloud VM or hypervisor)
- Files: rsync critical dirs (/etc, /var/www, /home, databases)
- Databases: mysqldump / pg_dumpall
- Configuration backups (cPanel/WHM, Plesk, etc.)
- Test restore in staging if possible
Update CentOS 8 fully CentOS 8 must be at least 8.4 (ideally 8.5.2111 final).
Bashsudo dnf clean all sudo dnf -y update sudo rebootVerify: cat /etc/centos-release → should show CentOS Linux release 8.5 or similar.
Check for control panels / custom software
- cPanel/Plesk/DirectAdmin: follow vendor-specific guides (they often pre-approve or integrate with these scripts)
- Stop non-essential services to reduce risk
- Document installed packages: dnf list installed > installed-packages.txt
Test in staging Clone the production server (VM snapshot or rsync) and test migration there first.
Plan downtime & rollback Migration requires reboot. Have console access (IPMI, rescue mode) ready.
Option 1: Migrate to AlmaLinux 8 (Recommended for Simplicity)
Official tool: almalinux-deploy.sh (supports CentOS 8, CentOS Stream 8, Oracle Linux 8, etc.)
Steps:
Download the script:
Bashcd /tmp curl -O https://raw.githubusercontent.com/AlmaLinux/almalinux-deploy/master/almalinux-deploy.shMake executable & run (as root):
Bashchmod +x almalinux-deploy.sh sudo bash almalinux-deploy.shThe script:
- Checks compatibility
- Replaces CentOS repos with AlmaLinux
- Removes branded packages (centos-logos, etc.)
- Runs dnf distro-sync to align packages
- Reports success/failure
Reboot:
Bashsudo rebootVerify:
Bashcat /etc/os-release # should show AlmaLinux cat /etc/redhat-release dnf update -y # ensure repos work
Option 2: Migrate to Rocky Linux 8
Official tool: migrate2rocky.sh (from rocky-tools repo)
Steps:
Download the script:
Bashcd /tmp curl -O https://raw.githubusercontent.com/rocky-linux/rocky-tools/main/migrate2rocky/migrate2rocky.shMake executable & run:
Bashchmod +x migrate2rocky.sh sudo bash migrate2rocky.sh(Some guides suggest -r flag for report-only first: ./migrate2rocky.sh -r)
Reboot & verify: Same as AlmaLinux (check /etc/os-release, run updates).
Post-Migration Steps (Both Distributions)
- Reboot and confirm services start correctly (httpd/nginx, mariadb, sshd, etc.)
- Run dnf update -y again to catch any post-sync updates
- Re-enable firewalld/SELinux rules if adjusted
- Test applications thoroughly (web apps, cron jobs, backups)
- Update monitoring/alerting to reflect new OS
- Remove old CentOS repo files if any remain in /etc/yum.repos.d/
- Schedule regular updates & consider extended support if needed
Common Pitfalls & Troubleshooting
- Script fails on dependencies: Usually fixed by full update + clean before running.
- Control panel issues: Check vendor docs (cPanel has AlmaLinux-specific notes).
- Custom kernels/modules: May need reinstallation post-migration.
- Rollback: Boot from snapshot/backup; migration is mostly reversible but reboot makes it live.
- Air-gapped/offline systems: Manual repo mirroring + script tweaks required (advanced; consult official wikis).
In 2026, both AlmaLinux and Rocky Linux are mature, widely adopted, and receive timely security updates. The in-place script method is reliable for most servers, but always prefer a fresh install for new deployments or when major reconfiguration is acceptable.