fbpx
Home » Blog » Migrating from CentOS 8 to AlmaLinux: A Step-by-Step Guide

Migrating from CentOS 8 to AlmaLinux: A Step-by-Step Guide

Migrating from CentOS 8 to AlmaLinux: A Step-by-Step Guide

CentOS 8 is a popular open-source Linux distribution, but as time goes by, it may no longer be the best option for your business needs. In this article, we will guide you through the process of migrating from CentOS 8 to AlmaLinux, a newer and more modern Linux distribution.

What is AlmaLinux and Why Should You Consider Migrating?

AlmaLinux is a community-driven, enterprise-grade Linux distribution that is based on Red Hat Enterprise Linux (RHEL). It was created in response to the discontinuation of CentOS and aims to provide a stable and reliable open-source alternative to RHEL.

One of the key benefits of AlmaLinux is its strong focus on security and stability, making it a great choice for businesses and organizations that require a robust and secure operating system. Additionally, AlmaLinux provides access to a large number of packages and software applications through its official repositories, giving you the flexibility to install and configure the tools you need to run your business.

Preparing for the Migration

Before you start the migration process, it is important to take the necessary steps to prepare your current CentOS 8 system. This includes backing up all important data, verifying the compatibility of your applications and services, and ensuring that you have all the necessary login credentials and access to the new AlmaLinux system.

Step 1: Backup Your Data
The first step in migrating from CentOS 8 to AlmaLinux is to backup all of your important data. This includes any files, databases, and configuration files that you need to preserve. You can use a variety of tools and methods to backup your data, including the built-in backup tools in CentOS 8, or a third-party backup solution.

Step 2: Verify Compatibility of Applications and Services
Before you start the migration process, it is important to verify that all of your applications and services are compatible with AlmaLinux. This includes checking the version compatibility of your applications, as well as the compatibility of any dependencies or libraries that your applications may require.

The procedure to migrate CentOS 8 Linux stable to AlmaLinux is as follows

Log in as the root user:

sudo -i

Apply pending updates to CentOS 8 by running the dnf command/yum command:

dnf update

Apply pending updates before migration starts

Reboot the Linux box when new kernel updates are installed:

reboot

After reboot, you need to download the almalinux-deploy.sh script using the wget or curl command, type:

wget https://raw.githubusercontent.com/AlmaLinux/almalinux-deploy/master/almalinux-deploy.sh
# read the script #
vim almalinux-deploy.sh

Next set up executable permission using the chmod command, run:

chmod -v +x almalinux-deploy.sh

Downloading almalinux-deploy.sh script

Finally, migrate CentOS to AlmaLinux by typing the almalinux-deploy.sh:

./almalinux-deploy.sh

As of January 31, 2022 the official CentOS 8 mirrorlists are offline. In order to successfully perform dnf update -y you need to update your dnf config files to point to a valid mirror. Hence, if you get any error, do pass the -f as follows:

./almalinux-deploy.sh -f

The upgrade and migration will take their own sweet time. It all depends upon your server hardware specification and the Internet speed. So wait and watch for errors on the screen. In the end, you should see a confirmation message as follows on screen:
Complete!

Run dnf distro-sync -y                                                OK
Restoring of alternatives is done                                     OK
Generating grub configuration file ...
done

All Secure Boot related packages which were released by not AlmaLinux are reinstalled                                                           OK
 
Migration to AlmaLinux is completed
Reboot the Linux box hosted at AWS or Linode:
shutdown -r now
Connection to 3.1x.2xx.2xx closed by remote host.

Finally, verify the AlmaLinux version, run:


cat /etc/redhat-release
## OR ##
cat /etc/os-release

CentOS to Almalinux migration successfully executed

Also, make sure all services such as PGSQL, Apache and others are running using the ps command or ss command:


ss -tulpn | more
ss -tulpn | grep ":80"
# Verify logs using the tail command and dmesg command+egrep command #
tail -f /var/log/httpd/app_name_goes_here
dmesg | egrep -i 'error|critical|warn'

Step 3: Obtain Login Credentials and Access to the New AlmaLinux System
Once you have verified the compatibility of your applications and services, you will need to obtain the necessary login credentials and access to your new AlmaLinux system. This may involve setting up a new user account, obtaining an SSH key, or configuring remote access to the new system.

Step 4: Transfer Data to the New AlmaLinux System
With your data backed up and your applications and services verified, you are ready to transfer your data to the new AlmaLinux system. This can be done using a variety of methods, including copying files over a network connection, or using a data migration tool.

Step 5: Configure and Test the New AlmaLinux System
Once your data has been transferred to the new AlmaLinux system, you will need to configure and test your applications and services to ensure that everything is working as expected. This includes setting up any necessary configuration files, installing any necessary packages and dependencies, and testing your applications and services to ensure that they are working properly.

FAQs

What is AlmaLinux?

AlmaLinux is a community-driven, enterprise-grade Linux distribution that is based on Red Hat Enterprise Linux (RHEL). It was created in response to the discontinuation of CentOS and aims to provide a stable and reliable open-source alternative to RHEL.

Why should I consider migrating from CentOS 8 to AlmaLinux?

You should consider migrating from CentOS 8 to AlmaLinux if you want a more modern, secure, and stable operating system for your business. AlmaLinux provides access to a large number of packages and software applications, making it a great choice for businesses and organizations that require a robust and secure operating system.

What steps do I need to take before I start the migration process?

Before you start the migration process, it is important to take the necessary steps to prepare your current CentOS 8 system. This includes backing up all important data, verifying the compatibility of your applications and services, and ensuring that you have all the necessary login credentials and access to the new AlmaLinux system.

How do I transfer my data to the new AlmaLinux system?

You can transfer your data to the new AlmaLinux system using a variety of methods, including copying files over a network connection, or using a data migration tool.

What do I need to do after my data has been transferred to the new AlmaLinux system?

After your data has been transferred to the new AlmaLinux system, you will need to configure and test your applications and services to ensure that everything is working as expected. This includes setting up any necessary configuration files, installing any necessary packages and dependencies, and testing your applications and services to ensure that they are working properly.

Conclusion

Migrating from CentOS 8 to AlmaLinux can seem like a daunting task, but with the right preparation and a step-by-step approach, the process can be completed smoothly and efficiently. By following the steps outlined in this guide, you can ensure that your migration from CentOS 8 to AlmaLinux is successful and that your business remains up and running.

Scroll to Top