CentOS 8 to AlmaLinux 8: A Step-by-Step Migration Guide

Here's how to easily go through the migration process from CentOS 8 to the latest version of AlmaLinux using an automated script.

CentOS 8 to AlmaLinux 8: A Step-by-Step Migration Guide

This guide will help you to migrate in-place your current CentOS 8 installation to AlmaLinux 8 in a few simple steps.

As you know, CentOS 8 reached its End-of-Life on December 31, 2021. If you want to migrate your CentOS 8 server to AlmaLinux 8 which is a 1:1 binary compatible with CentOS and RHEL, then here are the steps to follow.

An in-place upgrade involves using the official AlmaLinux automated script to migrate your current CentOS 8 operating system files to AlmaLinux. In addition, an in-place upgrade does not require formatting of hard disk and due to that fact all settings, programs, and files on your current CentOS 8 system will be preserved.

Steps to Migrate CentOS 8 to AlmaLinux 8

Here’s our CentOS 8 system before we start the migration process to AlmaLinux.

Sysytem Information Before Upgrade

1. Take System Backup

Before upgrading please make sure you take the backup of all your important data and if possible, take the snapshot of complete CentOS 8 system. This way you will be on the right side of things if anything goes wrong.

2. Upgrade the Current CentOS 8 System

The next step in the upgrade process is to make sure we have a completely upgraded system. Update existing software with the following command:

sudo dnf update

Once all the packages are updated, reboot your system to apply the changes.

Now let’s verify our current operating system version.

cat /etc/centos-release
Checking the Current CentOS 8 Version

3. Download the Official AlmaLinux Migration Script

The first step in the actual upgrade process is to download the almalinux-deploy.sh script from the AlmaLinux GitHub repo:

curl -O https://raw.githubusercontent.com/AlmaLinux/almalinux-deploy/master/almalinux-deploy.sh
almalinux-deploy.sh Migration Script

Next, make the script executable:

chmod +x almalinux-deploy.sh

3. Migrate from CentOS 8 to AlmaLinux 8

Finally, with the script available locally, run it to to start migration process:

sudo bash almalinux-deploy.sh

After the migration script performs a few initial checks, it will begin the process of upgrading certain packages in order to synchronize the system with the current AlmaLinux 8 release.

Be patient since the upgrade process could take some time.

CentOS 8 to AlmaLinux 8 Migration in Progress

Once the migration is completed, you will get:

Migration from CentOS 8 to AlmaLinux 8 Completed Successfully

Run the following command to sync installed packages and then simply reboot the system:

sudo dnf distro-sync -y
sudo reboot

The GRUB menu will appear with the AlmaLinux entry at the very top. Just hit Enter or wait a sec and it will boot automatically into AlmaLinux 8.

AlmaLinux 8 Bootloader

4. Check AlmaLinux Version to Validate Migration

Just to confirm that you have successfully migrated, check the OS version:

cat /etc/redhat-release
Check the OS Version

That’s all. Congratulations! You have successfully migrated from CentOS 8 to AlmaLinux 8.

(Optional) In addition, you can change the server hostname to match with AlmaLinux:

sudo hostnamectl set-hostname almalinux8
sudo reboot
AlmaLinux 8 System Information


Please note that the almalinux-deploy.sh script will only convert CentOS 8 version to AlmaLinux 8. If you are running older version like CentOS 7.x, all you have to do to switch to AlmaLinux 8 is just to follow our How to Migrate CentOS 7 to AlmaLinux 8: A Step-by-Step Guide.

I have tried to make this guide as simple as possible. Thanks for using it! As always, feel free to share your thoughts in the comments box below.


Leave a Reply

Your email address will not be published.

Latest from Linux Knowledge