Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

How to Migrate CentOS to AlmaLinux on the Fly?

CentOS 8 has reached its end of life. In fact, the Centos Linux 8 repositories have been offline since January 31, 2022. You might have tried CentOS 8 Stream instead, which in essence, is a nightly build and may not fill you with confidence, unlike the stability that CentOS Linux had.

An excellent alternative is the Almalinux operating system. AlmaLinux is a clone of RHEL with one-to-one binary compatibility, enterprise-grade, and it’s free! There’s a convenient migration path for you if you’re currently running CentOS Linux 8.4, 8.5, or CentOS Stream 8.

Pre-Migration

Before you migrate your computer from CentOS to AlmaLinux, let’s ensure the system is in its optimal state.

Backup Your System and Data

Like any migration process, there’s always a risk of data loss. Before you migrate CentOS to AlmaLinux, back up your current system and data. Doing so ensures that you have a restoration point if the migration fails. The backup procedure differs from system to system.

  • If your computer is a physical machine, you may need to back up using a third-party solution.
  • If you have a virtual machine, you can back up the virtual hard disk, the entire VM, or take a snapshot.
  • If you have a cloud-hosted VM, like an Azure VM or AWS EC2, you can create a snapshot or copies of your storage.

Also, you can choose to forgo the backup and convert CentOS to AlmaLinux straight away. The choice is yours.

Check the CentOS Version

Ensure that your current operating system is CentOS Linux 8.4+ or CentOS Stream 8. This post will use a deployment script that will work only on these CentOS versions.

cat /etc/centos-release

This computer runs on CentOS 8.5, which fits the deployment script requirement.

Update the System

If your CentOS Linux version falls below the required version for the migration, you must update it first.

Since the CentOS Linux 8 repositories are now offline, run the below commands to point the repositories to valid sources.

sudo sed -i -e "s|mirrorlist=|#mirrorlist=|g" /etc/yum.repos.d/CentOS-* 
sudo sed -i -e "s|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g" /etc/yum.repos.d/CentOS-*

Next, run an update to have the latest packages before the migration.

sudo dnf upgrade -y

Wait for the update to finish. The process may take a while, depending on the volume of updates available. The system is fairly recent in this example, and the update took about 10 minutes.

Migrate CentOS to AlmaLinux

When you’ve done your pre-migration checks, follow these steps to migrate CentOS 8 to AlmaLinux.

Download the Migration Script

First, download the almalinux-deploy script to the current working directory. This command saves the script as ./almalinux-deploy.sh.

curl -O https://raw.githubusercontent.com/philrandal/almalinux-deploy/master/almalinux-deploy.sh

Next, make the almalinux-deploy.sh executable.

chmod +x ./almalinux-deploy.sh 
ls -l ./almalinux-deploy.sh

Execute the Migration

Execute the migration script like so:

sudo bash almalinux-deploy.sh

The script begins by running some pre-checks, such as root access and OS version compliance.

Then, it downloads and installs the packages for AlmaLinux, which could take several minutes depending on your system and internet speed.

You’ll see a status message saying that Migration to AlmaLinux is completed at the end of the migration. Now, reboot the computer.

sudo reboot

When the boot manager shows up, select to boot AlmaLinux from the list.

You can see that the login screen now shows the AlmaLinux logo. Enter your credentials and log in.

And now you have AlmaLinux!

Open a terminal session and run this command to confirm the AlmaLinux version.

cat /etc/system-release

As of this post, the latest AlmaLinux release is 8.6 (Sky Tiger).

Finally, confirm that the computer boots using the AlmaLinux kernel.

sudo grubby --info DEFAULT | grep AlmaLinux

Conclusion

The demonstration on how to migrate CentOS to AlmaLinux used in this post went smoothly and finished in roughly an hour. But. it’s not always the case in the real world.

Your migration experience may differ, and there’s no guarantee that the migration will be successful the first time. Therefore, you must consider backing up your system before making any changes.



This post first appeared on GadgetRevo.com, please read the originial post: here

Share the post

How to Migrate CentOS to AlmaLinux on the Fly?

×

Subscribe to Gadgetrevo.com

Get updates delivered right to your inbox!

Thank you for your subscription

×