CentOS 7 reached end of life on 30 June 2024. It no longer gets security updates, its repositories have moved to the vault archive, and its software is very old: PHP 5.4, Python 2.7, OpenSSL 1.0.2 and kernel 3.10. A CentOS 7 server on the internet accumulates unpatched vulnerabilities every month. If you still run one, plan the move now.

Your options

Option What it is Effort Good for
AlmaLinux / Rocky Linux 8 or 9 Free RHEL-compatible rebuilds, supported to 2029–2032 Medium Staying in the RHEL world (cPanel, vendor software certified for RHEL)
CentOS Stream 9 Upstream of RHEL, rolling just ahead of it Medium Development, or if you’re fine with a moving target
RHEL Commercial, with support. Free developer subscription for small use Medium Companies needing vendor support
Ubuntu LTS / Debian Different family (apt), long support, huge ecosystem Higher (different tools) Fresh starts, modern stacks, Docker hosts
Extended lifecycle support Paid patches for CentOS 7 from third parties Low (buys time) When migration must wait

For most servers the recommendation is: move to AlmaLinux or Rocky Linux 9 on a fresh server, and migrate your data and apps.

In-place upgrade vs fresh server

In place with ELevate

The ELevate project (by AlmaLinux, based on Red Hat’s Leapp) upgrades CentOS 7 → AlmaLinux/Rocky/Oracle 8 in place, then 8 → 9 in a second run.

The process, in outline (follow the current ELevate documentation for exact repository URLs):

  1. Point yum at the CentOS 7 vault mirrors, run yum upgrade to the final 7.9 packages, and reboot.
  2. Install the elevate-release package, then leapp-upgrade plus the data package for your target (leapp-data-almalinux, leapp-data-rocky…).
  3. Run sudo leapp preupgrade and fix every inhibitor listed in /var/log/leapp/leapp-report.txt.
  4. Run sudo leapp upgrade, then reboot. The upgrade finishes during that boot. Watch it on the VNC console.

Pros: you keep the server, IP and configuration. Cons: two major jumps, many possible blockers (old kernel modules, third-party repos, Python 2 dependencies), and if it fails mid-way, recovery means restoring a backup. Take a full backup first.

  1. Deploy a new server with the target OS.
  2. Install the software stack in current versions.
  3. Copy data (databases, files) and adapt the configs.
  4. Test using a hosts-file entry or a temporary subdomain.
  5. Switch DNS, keep the old server for a rollback period, then shut it down.

Pros: a clean system, current versions, and an easy rollback, since the old server keeps running. Cons: you need to know what’s installed, and you’ll reinstall it.

Plan the migration

1. Inventory the old server:

cat /etc/centos-release
rpm -qa --qf '%{NAME}\n' | sort > packages.txt
systemctl list-unit-files --state=enabled
ss -tlnp                                 # listening services
crontab -l; ls /etc/cron.d/              # scheduled jobs
ls /etc/yum.repos.d/                     # third-party repos (EPEL, Remi, MySQL…)
df -h; du -sh /var/www /var/lib/mysql /home

2. Expect version jumps. PHP 5.x/7.x → 8.x, Python 2 → 3, MySQL 5.x/MariaDB 5.5 → MySQL 8 or MariaDB 10.11+, OpenSSL 1.0 → 3. Applications may need updates before they run on the new stack. Test this first.

3. Move the data:

# databases
mysqldump --single-transaction --routines --all-databases | gzip > all.sql.gz
# files
rsync -aHAX --info=progress2 /var/www/ newserver:/var/www/

See mysqldump and rsync.

4. Translate configs. Most apps and Nginx configs carry over. If you change families (CentOS → Ubuntu), remember:

CentOS / RHEL Ubuntu / Debian
yum / dnf apt
firewalld ufw (or nftables)
httpd (user apache) apache2 (user www-data)
/etc/httpd/conf.d/ /etc/apache2/sites-available/
SELinux AppArmor
wheel group sudo group

5. Lower the DNS TTL a day ahead, so the switch propagates quickly. See DNS records.

If you can’t migrate yet

  • Isolate the server: firewall everything except essential ports, and restrict SSH to your IP.
  • Put a maintained reverse proxy or WAF in front of web apps.
  • Use vault repositories (vault.centos.org) only for reinstalling existing packages. There are no new fixes.
  • Consider paid extended support (TuxCare and others) as a bridge, with a firm migration date.

Get a new server for the migration

VPS.DO offers CentOS Stream 9 in every location, plus AlmaLinux 8 and 9 on USA VPS plans. Ubuntu and Debian are available everywhere. See CentOS VPS. Run the new server in parallel during the migration. New orders come with a 7-day refund window (once per customer per data center).

Quick reference

Step Command / tool
Check version cat /etc/centos-release
In-place path ELevate (leapp preupgrade, leapp upgrade)
Inventory rpm -qa, systemctl list-unit-files, ss -tlnp
Move DB mysqldump → import
Move files rsync -aHAX

Related: AlmaLinux setup, Rocky Linux setup and choosing a server distro.

  • CentOS
  • Linux
  • Migration