Docs / Migration Guides / How to Migrate from CentOS to AlmaLinux

How to Migrate from CentOS to AlmaLinux

By Admin · Mar 2, 2026 · Updated Apr 23, 2026 · 27 views · 3 min read

How to Migrate from CentOS to AlmaLinux

With CentOS Linux reaching end of life, AlmaLinux has emerged as a stable, community-driven replacement that maintains binary compatibility with the upstream enterprise distribution. This guide covers how to migrate your Breeze instance from CentOS to AlmaLinux, either in-place or via a fresh installation.

Understanding Your Options

  • In-place migration — convert the existing CentOS installation to AlmaLinux using the AlmaLinux Migration Tool, preserving all data and configurations
  • Fresh install and data transfer — provision a new Breeze with AlmaLinux and migrate applications and data manually

The in-place migration is faster but carries more risk. A fresh install is cleaner and gives you the opportunity to modernize your stack.

Option A: In-Place Migration with almalinux-deploy

Pre-Migration Checks

Before starting, take a full backup of your Breeze. Snapshot the instance if possible. Then verify your current CentOS version:

cat /etc/centos-release
rpm -qa | wc -l

Run the Migration Script

Download and execute the official AlmaLinux migration script:

curl -O https://raw.githubusercontent.com/AlmaLinux/almalinux-deploy/master/almalinux-deploy.sh
sudo bash almalinux-deploy.sh

The script will replace CentOS repositories with AlmaLinux equivalents, swap branding packages, and synchronize all installed packages. This process typically takes 15-30 minutes depending on the number of packages installed.

Reboot and Verify

After the script completes, reboot the Breeze:

sudo reboot

After reboot, verify the migration succeeded:

cat /etc/almalinux-release
rpm -qa | grep centos

The release file should show AlmaLinux and no CentOS packages should remain.

Option B: Fresh AlmaLinux Install

Step 1: Provision a New Breeze with AlmaLinux

Create a new Breeze instance and select AlmaLinux as the operating system. Update the system immediately:

sudo dnf update -y

Step 2: Install Required Packages

Reinstall the same packages you had on CentOS. Export the package list from the old server:

# On the CentOS server
rpm -qa --qf '%{NAME}\n' | sort > /tmp/packages.txt
scp /tmp/packages.txt user@new-breeze-ip:/tmp/

On the new AlmaLinux Breeze, install matching packages:

sudo dnf install -y $(cat /tmp/packages.txt | tr '\n' ' ')

Step 3: Transfer Configuration and Data

Copy configuration files from key directories:

rsync -avz user@old-server:/etc/nginx/ /etc/nginx/
rsync -avz user@old-server:/etc/php.d/ /etc/php.d/
rsync -avz user@old-server:/var/www/ /var/www/

Migrate databases using mysqldump or pg_dump as described in the respective database migration guides.

Post-Migration Tasks

  • Enable EPEL repositorysudo dnf install -y epel-release
  • Verify services — check that nginx, PHP-FPM, MySQL, and other services start correctly
  • Test firewall rules — AlmaLinux uses firewalld, verify all necessary ports are open
  • Check SELinux — ensure SELinux contexts are correct for your web application files
  • Update monitoring — update any monitoring agents or server labels to reflect AlmaLinux
  • Cron jobs — verify all scheduled tasks are in place and running

Why AlmaLinux

AlmaLinux provides long-term support, regular security patches, and full RHEL compatibility. It is governed by the AlmaLinux OS Foundation, a nonprofit organization, ensuring the distribution remains free and community-driven for the long term.

Was this article helpful?