Migrating from CentOS 7 to AlmaLinux 9: A Complete Guide for Production Servers

centos migrate to almalinux

When CentOS 7 reached End of Life in June 2024, it left countless production servers without updates or security patches. For businesses that built their infrastructure on CentOS, this wasn’t just inconvenient — it was a real security risk.

The good news? AlmaLinux 9 is here, offering a seamless, community-driven, RHEL-compatible replacement that’s stable, secure, and enterprise-ready.

In this guide, I’ll walk you through a safe, tested, real-world process for migrating your production servers from CentOS 7 to AlmaLinux 9 — step by step, with practical insights, gotchas, and rollback tips.

Why Migrate from CentOS 7 to AlmaLinux 9?

Let’s start with the “why.”

1. CentOS 7 Is Officially Unsupported

As of June 30 2024, CentOS 7 stopped receiving updates, bug fixes, and security patches. That means every day you continue running it, you’re exposing your systems to new vulnerabilities.

2. AlmaLinux 9 Is the Logical Successor

AlmaLinux, built by the CloudLinux team, is binary-compatible with RHEL — the same DNA that powered CentOS for years.
It offers:

  • 1:1 RHEL compatibility
  • A long support lifecycle (through 2032)
  • Active community and commercial support
  • Zero-cost usage

3. Future-Proofing Your Infrastructure

Migrating now ensures your stack (databases, web servers, control panels) stays current and compliant with modern libraries and kernels.

Preparing for Migration — Don’t Skip This Step

This is where most failed migrations happen — in the rush. A few hours of prep now can save you days of troubleshooting later.

1. Take Full Backups

Back up everything — system configuration, databases, and critical app data.
Use:

rsync -aAXv / /mnt/backup/
mysqldump -u root -p --all-databases > /mnt/backup/all_dbs.sql

Or rely on your provider’s snapshot feature (e.g., MainVPS offers instant snapshots on all VPS and dedicated plans).

2. Check Hardware & Software Compatibility

AlmaLinux 9 uses a newer kernel (5.14) and newer libraries. Ensure:

  • Your control panels (cPanel, Plesk, DirectAdmin) support Alma 9
  • Your apps don’t depend on older glibc or Python 2.x
  • You have at least 2 GB RAM and 20 GB disk space for the upgrade process

3. Update CentOS 7 Fully

Make sure your CentOS 7 system is fully up to date:

sudo yum update -y
sudo reboot

Step-by-Step: Migrating CentOS 7 → AlmaLinux 9

The official AlmaLinux team provides a migration tool called ELevate. It handles major-version transitions — not just upgrades within CentOS but across the RHEL family (CentOS 7 → AlmaLinux 8 → 9).

Here’s how to use it safely.

🔹 Step 1: Install ELevate Tool

Enable EPEL repo first:

sudo yum install -y epel-release

Add the ELevate repository and tool:

sudo yum install -y https://repo.almalinux.org/elevate/elevate-release-latest-7.noarch.rpm
sudo yum install -y leapp leapp-data-almalinux

🔹 Step 2: Run a Pre-Upgrade Check

Before you actually upgrade, audit your system for blockers:

sudo leapp preupgrade

This generates /var/log/leapp/leapp-report.txt — a detailed report of issues like:

  • Unsupported kernels
  • Removed packages
  • Custom SELinux policies

Read it carefully. The tool even lists suggested fixes.

🔹 Step 3: Resolve Issues

Common quick fixes:

  • Remove old Python 2 modules or legacy PHP versions.
  • Disable unsupported repos: sudo yum-config-manager --disable repository-name
  • Uninstall EOL packages: sudo yum remove package-name

Once everything looks clean, proceed.

🔹 Step 4: Run the Upgrade to AlmaLinux 8

sudo leapp upgrade
sudo reboot

The system reboots into an AlmaLinux 8 environment.
Check:

cat /etc/os-release

You should see AlmaLinux 8.x.

🔹 Step 5: Upgrade AlmaLinux 8 → AlmaLinux 9

Now that you’re on 8, the jump to 9 is straightforward.

sudo dnf install -y dnf-plugin-system-upgrade
sudo dnf system-upgrade download --releasever=9 -y
sudo dnf system-upgrade reboot

After reboot, verify:

cat /etc/redhat-release

Output should read:

AlmaLinux release 9.x (Emerald Puma)

🎉 Congratulations — your system is officially running AlmaLinux 9!

Post-Migration: Tune and Verify

Check System Health

Run:

sudo dnf update -y
sudo dnf autoremove -y
sudo reboot

Re-enable SELinux (if you disabled it)

sudo setenforce 1

Verify Core Services

Check web, database, and mail services:

systemctl status nginx
systemctl status mariadb
systemctl status postfix

If you’re using control panels, ensure they detect Alma 9 correctly.

Hardening AlmaLinux 9 for Production

Now that you’re live on AlmaLinux 9, lock it down.

Firewall & Security

sudo dnf install firewalld -y
sudo systemctl enable firewalld --now
sudo firewall-cmd --permanent --add-service=http
sudo firewall-cmd --permanent --add-service=https
sudo firewall-cmd --reload

Intrusion Protection

Install Fail2Ban and enable automatic banning of brute-force attempts:

sudo dnf install fail2ban -y
sudo systemctl enable fail2ban --now

Automatic Updates

sudo dnf install dnf-automatic -y
sudo systemctl enable --now dnf-automatic.timer

Performance Tweaks Worth Doing

  • Enable HTTP/2 and Gzip in Nginx or Apache.
  • Tune MariaDB using mysqltuner.pl.
  • Enable swap if your VPS has under 2 GB RAM.
  • Use a local VPS provider like MainVPS India for lower latency and faster package downloads.

Lessons from Real Migrations

I’ve helped several businesses move production workloads from CentOS 7 to Alma 9.
Here’s what experience teaches you:

  1. Read the pre-upgrade report — don’t ignore even minor warnings.
  2. Remove cPanel before migration and reinstall it after; same for Plesk.
  3. Test in staging first if your server runs critical apps.
  4. Have console access ready. If SSH fails after reboot, you can still fix boot issues via console.
  5. Clean up legacy services (like old PHP-FPM 5.x) that might not exist in Alma 9.

FAQs

1. Is AlmaLinux 9 a direct drop-in for CentOS 7?

Not quite — you’ll notice updated system libraries, new dnf package manager, and a newer kernel. But application compatibility remains extremely high.

2. How long will AlmaLinux 9 be supported?

Until 2032 with security updates — nearly 8 years of peace of mind.

3. Can I use the Elevate tool to skip straight from 7 to 9?

The official path is 7 → 8 → 9. You can chain both upgrades safely in one maintenance window if planned properly.

4. Will my existing cPanel or Plesk setup survive migration?

Usually not. You’ll need to reinstall them on Alma 9 for full compatibility. Always back up configs and licenses first.

5. What’s the rollback plan if something breaks?

If you’ve made full backups or snapshots, you can revert instantly. Always take a snapshot before running Elevate.

6. Where should I host my new AlmaLinux 9 server?

Choose a reliable, low-latency provider with enterprise hardware. For businesses in India Best VPS Hosting India offer optimized local performance and full root control.

Final Thoughts

Migrating from CentOS 7 to AlmaLinux 9 isn’t just a version upgrade — it’s a strategic move to keep your infrastructure secure and supported for the next decade.

With the ELevate tool and careful planning, you can perform this migration without downtime, maintain configuration consistency, and future-proof your production stack.

If you’re still running CentOS 7, now’s the time to act.
Take backups, test on staging, and migrate confidently — your future self (and your security team) will thank you.

👉 Need a stable environment to deploy AlmaLinux 9?
Check out MainVPS VPS and Dedicated Server Plans for high-performance infrastructure built for production workloads.