Complete Guide to Migrate from CentOS 7 to AlmaLinux 8 Step by Step

If you’re looking for a simple and efficient way to migrate from CentOS 7 to AlmaLinux 8, you’ve come to the right place! In this article, we’ll show you how to do it step by step and in detail. So, without further ado, let’s get started!

Why migrate from CentOS 7 to AlmaLinux 8?

CentOS 7 has been one of the most widely used Linux distributions for businesses and developers, thanks to its stability and long-term support. However, in December 2020, it was announced that CentOS would shift to a development model more focused on CentOS Stream, making it less ideal for many users.

In response to this situation, AlmaLinux emerged as a reliable and stable alternative for those seeking a Linux distribution with long-term support and a similar focus to CentOS. That’s why it’s a good idea to migrate from CentOS 7 to AlmaLinux 8.

Preparing for the migration

Before starting the migration, make sure you meet the following requirements:

  • Have access to the CentOS 7 server via SSH, with administrator (root) privileges.
  • Have a stable internet connection to download the necessary packages.
  • Creating a full backup

The first step you should take is to create a full backup of your CentOS 7 system. This is crucial to avoid data loss in case something goes wrong during the migration. You can use tools like rsync or tar to back up your important files and directories.

Updating the CentOS 7 system

Before proceeding with the migration, make sure your CentOS 7 system is up to date. To do this, run the following commands in the terminal:

sudo yum update -y
sudo yum upgrade -y

This will update all the packages installed on your system to their latest versions.

Afterwards, reboot the system:

sudo reboot -f

Conversion to AlmaLinux 8

Now that your system is updated and ready for migration, you can proceed with the conversion to AlmaLinux 8. Follow these steps:

Install elevate-release-latest

Now that your system is updated, download and install the elevate-release package to prepare for migration:

sudo yum install -y http://repo.almalinux.org/elevate/elevate-release-latest-el7.noarch.rpm

Install the Leapp tool

Next, install the Leapp tool, which will help you with the migration process to AlmaLinux 8:

sudo yum install -y leapp

Perform a pre-upgrade check with Leapp

Before you start the migration, run a pre-upgrade check with Leapp to identify any possible issues:

sudo leapp preupgrade

Review the generated report and solve any issues found before continuing. If you have any doubts, search forums or specialized communities to find solutions.

Start the migration to AlmaLinux 8

Once you have solved all the issues identified in the pre-upgrade check, you are ready to start the migration:

sudo leapp upgrade

Leapp will begin the migration process, and this may take some time depending on the number of installed packages and the speed of your Internet connection. Take a coffee break while you wait, as it could take a while.

Reboot the system

After the migration has finished, reboot your system:

sudo reboot

Post-migration: Verification and Cleanup

After rebooting your system, follow these steps to verify that the migration was successful and clean up unnecessary files:

Verify that you are running AlmaLinux 8:

cat /etc/os-release

If the migration was successful, you will see information related to AlmaLinux instead of CentOS.

Update system packages:

Now that you are on AlmaLinux 8, update system packages by running:

sudo dnf update -y

Clean up temporary files and packages:

Finally, clean up temporary files and packages that are no longer needed with the following command:

sudo dnf clean all

Additional configuration and adjustments

Even though you have successfully migrated to AlmaLinux 8, you may need to make additional adjustments based on your environment and the applications you are running on your server. Some packages or services may require configuration changes or specific updates to work correctly on AlmaLinux 8.

I recommend that you regularly review system logs and security policies to maintain a secure and reliable environment. It is also useful to familiarize yourself with the differences between CentOS 7 and AlmaLinux 8, as well as the new features introduced in version 8.

Leave a Reply