How to migrate from CentOS to AlmaLinux

AlmaLinux
AlmaLinux

The main motivation behind the creation of AlmaLinux was to be a viable replacement for CentOS Linux at the time of its shift from an enterprise-stable operating system to an upstream development branch of RHEL.

Now that AlmaLinux is released, it still leaves CentOS users wondering how to switch operating systems. Ideally, this should be done as seamlessly as possible, to prevent downtime, loss of data, etc. In this guide, we’ll show you the step by step instructions to migrate from CentOS to AlmaLinux with just a few commands.

Migrate from CentOS to AlmaLinux

Will use the official almalinux-deploy script that’s hosted on GitHub. Follow along with the steps below to download the script and use it to perform the migration from CentOS to AlmaLinux. This script takes certain scenarios into consideration like migrating DirectAdmin, cPanel, Plesk, and other programs as seamlessly as possible. Check the GitHub page for full details.

Start by downloading the script and giving it execute permissions.

# curl -O https://raw.githubusercontent.com/AlmaLinux/almalinux-deploy/master/almalinux-deploy.sh
# chmod +x almalinux-deploy.sh

Next, execute the script as root or with sudo.

# bash almalinux-deploy.sh

After the script performs a few initial checks, it will begin the process of removing, reinstalling, downgrading, and upgrading certain packages in order to synchronize the system with the current AlmaLinux release. End of process should look like this:

Complete!
Run dnf distro-sync -y                                                OK
Restoring of alternatives is done                                     OK
Generating grub configuration file ...
File descriptor 5 (/var/log/almalinux-deploy.debug.log) leaked on vgs invocation. Parent PID 441055: /usr/sbin/grub2-probe
File descriptor 5 (/var/log/almalinux-deploy.debug.log) leaked on vgs invocation. Parent PID 441055: /usr/sbin/grub2-probe
File descriptor 5 (/var/log/almalinux-deploy.debug.log) leaked on vgs invocation. Parent PID 441275: /usr/sbin/grub2-probe
File descriptor 5 (/var/log/almalinux-deploy.debug.log) leaked on vgs invocation. Parent PID 441275: /usr/sbin/grub2-probe
Adding boot menu entry for EFI firmware configuration
done
All Secure Boot related packages which were not released by AlmaLinux are reinstalled OK
BootCurrent: 0003
BootOrder: 0004,0003,0002,0001,0000
Boot0000* EFI Network
Boot0001* EFI SCSI Device
Boot0002* EFI SCSI Device
Boot0003* CentOS Linux
Boot0004* AlmaLinux
The new EFI boot record for AlmaLinux is added                        OK

Migration to AlmaLinux is completed

This process will take some time, but once it’s done, you can reboot the system and load into AlmaLinux.

# reboot

Once the computer is done booting up, verify that the system has migrated successfully by checking the /etc/redhat-release file.

#  cat /etc/redhat-release
AlmaLinux release 8.5 (Arctic Sphynx)

Also make sure that the system is set to boot the AlmaLinux kernel by default.

# grubby --info DEFAULT | grep AlmaLinux
title="AlmaLinux (4.18.0-348.12.2.el8_5.x86_64) 8.5 (Arctic Sphynx)"

That’s all there is to it. As long as you didn’t encounter any errors along the way, you’ve successfully migrated your system from CentOS to AlmaLinux.

Be the first to comment

Leave a Reply

Your email address will not be published.


*


This site uses Akismet to reduce spam. Learn how your comment data is processed.