keepcalculator

06 Numbers and Powers

CentOS to AlmaLinux Migration Guide

Card No. 06·81403 · Updated · Standard formula, shown below

Yes, you can and generally should migrate from CentOS 7 or CentOS 8 to AlmaLinux, especially since CentOS Linux reached end-of-life on June 30, 2024. The migration is free, straightforward, and preserves your existing applications, configurations, and user data by swapping the OS packages in place. This guide explains what AlmaLinux is, how the migration works, what to check beforehand, and how to handle common issues.

Why CentOS Users Need to Move

CentOS Linux was a free, community-supported rebuild of Red Hat Enterprise Linux (RHEL). In December 2020, Red Hat announced it would shift focus to CentOS Stream, a rolling preview of RHEL, and that CentOS Linux 8 would reach end-of-life in December 2021 instead of 2029. CentOS Linux 7 received extended updates until June 30, 2024, but after that date, no security patches or bug fixes are released. Running an unsupported OS exposes your server to unpatched vulnerabilities and software compatibility drift. AlmaLinux, along with Rocky Linux, was created specifically to fill that gap by providing a free, binary-compatible RHEL rebuild with a predictable 10-year support lifecycle.

What AlmaLinux Is and How It Compares

AlmaLinux is a 1:1 binary-compatible fork of RHEL, meaning it aims to be functionally identical to RHEL so that software certified for RHEL runs without modification. It is maintained by the AlmaLinux OS Foundation, a 501(c)(6) nonprofit, and is free to use, with no subscription or license fee. The project provides migration scripts that convert an existing CentOS installation to AlmaLinux by replacing the repository definitions and re-installing the core packages. The result is a system that receives security updates and new minor versions from the AlmaLinux project, typically within days of RHEL releases. Compared to CentOS Stream, AlmaLinux follows the stable, point-release model that CentOS Linux administrators were used to, rather than a rolling preview.

How the Migration Works

The migration process is designed to be non-destructive: it does not erase your data, applications, or user accounts. It works by changing the package manager repositories from CentOS to AlmaLinux, then re-installing the packages that differ between the two distributions. The official tool is almalinux-deploy, available from the AlmaLinux repositories. The general steps are:

  • Back up your system and data (mandatory, even though the process is safe).
  • Ensure your CentOS version is fully updated (sudo yum update).
  • Download and run the AlmaLinux migration script.
  • Reboot and verify that the system now identifies as AlmaLinux.

For CentOS 7, the script replaces the CentOS repositories with AlmaLinux 8 equivalents and then runs a package swap. For CentOS 8, the process is similar but requires that you are on the latest 8.5 release. The script checks for common issues, such as third-party repositories that may need to be disabled or replaced, and logs all actions to /var/log/almalinux-deploy.log.

Before You Migrate: Checklist

While the migration is automated, a few preparation steps significantly reduce the risk of failure:

  • Take a full backup or a snapshot of the server, including databases and application data.
  • Update CentOS to the latest available packages.
  • Disable or remove third-party repositories like EPEL, Remi, or Webtatic, then re-enable them after migration (EPEL has an AlmaLinux version).
  • Check that your kernel modules and drivers are available in the AlmaLinux kernel (most are, but proprietary drivers may need recompilation).
  • Ensure you have at least 2 GB of free disk space for the package swap.
  • If you use cPanel or Plesk, verify that your control panel supports AlmaLinux; both officially do.

Step-by-Step Migration Instructions

Here is the exact procedure for a standard CentOS 7 or 8 server:

  1. Log in as root or a user with sudo privileges.
  2. Run sudo yum update -y and reboot if the kernel was updated.
  3. Install the migration script: curl -O https://raw.githubusercontent.com/AlmaLinux/almalinux-deploy/master/almalinux-deploy.sh
  4. Make it executable: chmod +x almalinux-deploy.sh
  5. Run the script: sudo bash almalinux-deploy.sh
  6. Wait for the script to complete; it may take 10-30 minutes depending on package count.
  7. Reboot: sudo reboot
  8. Verify: cat /etc/redhat-release should show AlmaLinux, and sudo yum repolist should list AlmaLinux repositories.

If the script fails, check the log file at /var/log/almalinux-deploy.log for the exact error. Common failures involve leftover CentOS repository files or conflicts with third-party packages; the script usually tells you what to remove or disable.

Common Problems and How to Fix Them

Most migration issues fall into a few categories:

  • Third-party repositories: If you have EPEL or Remi enabled, the script may refuse to run. Disable them with sudo yum-config-manager --disable epel remi, then re-enable after migration using the AlmaLinux versions.
  • Kernel modules: If you use a proprietary kernel module (e.g., NVIDIA drivers, some RAID controllers), you may need to reinstall the driver after migration because the kernel version changes. Check the vendor’s documentation for AlmaLinux/RHEL 8 support.
  • cPanel/WHM: cPanel officially supports AlmaLinux 8. After migration, run sudo /usr/local/cpanel/scripts/upcp --force to update cPanel to the AlmaLinux-compatible version.
  • Firewall and SELinux: The migration preserves your firewall rules and SELinux configuration, but if SELinux was disabled, it stays disabled. Verify with getenforce.
  • PHP version: If you used Remi for PHP, you must reinstall the Remi repository for AlmaLinux and then reinstall your PHP packages. The migration script does not handle this automatically.

AlmaLinux vs. Rocky Linux vs. CentOS Stream

If you are weighing options, here is a quick comparison:

  • AlmaLinux: Free, community-owned nonprofit, binary-compatible with RHEL, 10-year support, simple migration script. Good default choice for most CentOS refugees.
  • Rocky Linux: Similar to AlmaLinux, also free and RHEL-compatible, backed by the Rocky Enterprise Software Foundation. Migration scripts exist but are less officially streamlined.
  • CentOS Stream: A rolling preview of RHEL, not a stable point release. Suitable for developers who want to test upcoming RHEL features, but not recommended for production servers that need stability.
  • RHEL itself: Red Hat offers a free developer subscription and a paid support model. If you need official support and are willing to pay, RHEL is an option, but AlmaLinux provides the same binaries for free.

Post-Migration Verification and Maintenance

After rebooting, run these checks to confirm the migration succeeded:

  • cat /etc/os-release – should show AlmaLinux 8.x or 9.x.
  • sudo yum update – should pull updates from AlmaLinux repositories.
  • sudo dnf repolist – shows the active repos.
  • Test your web server, database, and any cron jobs to ensure they start normally.

AlmaLinux follows the same minor release cadence as RHEL, so you will receive point releases (e.g., 8.9, 8.10) until the end of support. AlmaLinux 8 is supported until 2029, and AlmaLinux 9 until 2032. Plan to upgrade to the next major version (e.g., 8 to 9) within that window using the same migration script, which supports major version upgrades as well.

Frequently Asked Questions

Is the migration free?

Yes, AlmaLinux is completely free, and the migration script is open source. There are no license fees or subscriptions required.

Will my applications break after migration?

Most applications that run on CentOS 7 or 8 will run on AlmaLinux because it is binary-compatible with RHEL. The main exceptions are applications that depend on very specific kernel versions or that were compiled against CentOS-specific libraries. In practice, web servers, databases, and most PHP/Python/Node.js applications work without changes.

Can I migrate from CentOS 7 directly to AlmaLinux 9?

No, the official script only migrates CentOS 7 to AlmaLinux 8 and CentOS 8 to AlmaLinux 8 or 9. To go from CentOS 7 to AlmaLinux 9, you must first migrate to AlmaLinux 8, then perform a major version upgrade to 9. The script supports both steps.

What if I have cPanel or Plesk installed?

Both control panels officially support AlmaLinux 8. The migration script works with them, but you should check the control panel’s documentation for any post-migration steps, such as running an update script to switch the OS detection.

How long does the migration take?

Typically 10-30 minutes, depending on the number of packages and the speed of your server and network. The script downloads new packages and re-installs them, so a fast connection helps.

Do I need to reinstall my kernel modules?

If you use standard kernel modules included in the kernel, they will be replaced automatically. Proprietary modules (like NVIDIA drivers) may need to be recompiled or reinstalled after migration because the kernel version changes. Check your vendor’s documentation for RHEL 8 compatibility.

Related

Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.

More cards in this drawer

The whole Numbers and Powers drawer →