How to Migrate From CentOS 8 to Rocky Linux 8/Alma Linux 8
As you may already know, Red Hat decided to abandon the vanilla CentOS 8 project, which will reach end-of-life on December 31, 2021, and shift its focus to CentOS Stream. This tutorial is going to show you how to migrate from CentOS 8 to Rocky Linux 8/Alma Linux 8.
CentOS 8 Alternatives
There are several CentOS 8 alternatives, the most popular of which are
- Rocky Linux: A project led by one of the original creators of CentOS.
- Alma Linux: Created by CloudLinux, which is a Linux hosting software company.
Both of them are 100% open-source and are ready for production environment. Which one is better, you might think? Rocky Linux has better appeal in the open-source community, but development in Alma Linux is much faster than that of Rocky Linux.
Although the methods in this article are tested successfully, it’s always a good idea to make a backup before doing the migration.
If the migration to Rocky Linux fails, you can try migrating to Alma Linux, and vice versa.
Migrate From CentOS 8 to Rocky Linux 8
First, update existing software with the following command.
sudo dnf update -y
Then download the official migration script from Github.
wget https://raw.githubusercontent.com/rocky-linux/rocky-tools/main/migrate2rocky/migrate2rocky.sh
Add execution permission to this script.
chmod +x migrate2rocky.sh
Next, run the migration script.
sudo ./migrate2rocky.sh -r
It will replace the CentOS repository with Rocky Linux repository and also replace the software packages. The script will take care of everything. You don’t need to intervene in this process.
At the end of this process, you will be told to reboot your system.
sudo shutdown -r now
After reboot, check your Rocky Linux version.
cat /etc/rocky-release
Migrate From CentOS 8 to Alma Linux 8
First, update existing software with the following command.
sudo dnf update -y
Then download the official migration script from Github.
wget https://raw.githubusercontent.com/AlmaLinux/almalinux-deploy/master/almalinux-deploy.sh
Add execution permission to this script.
chmod +x almalinux-deploy.sh
Next, run the migration script.
sudo bash almalinux-deploy.sh
It will replace the CentOS repository with Alma Linux repository and also replace the software packages. The script will take care of everything. You don’t need to intervene in this process.
At the end of this process, you will be told to reboot your system.
sudo shutdown -r now
After reboot, check your Rocky Linux version.
cat /etc/almalinux-release
Convert CentOS 8 to RHEL 8
Red Hat Enterprise Linux (RHEL) is now free to use (up to 16 instances). You can also convert CentOS 8 to RHEL 8.
Note: You can’t use third-party kernel modules such as WireGuard in RHEL.
First, download the Red Hat GPG key.
wget https://www.redhat.com/security/data/fd431d51.txt
Move it to /etc/pki/rpm-gpg/
directory.
sudo mv fd431d51.txt /etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
Download the convert2rhel.repo
file.
wget https://ftp.redhat.com/redhat/convert2rhel/8/convert2rhel.repo
Move it to /etc/yum.repos.d/
directory.
sudo mv convert2rhel.repo /etc/yum.repos.d/convert2rhel.repo
Install the convert2rhel
utility.
sudo dnf -y install convert2rhel
Then you need to join the Red Hat Developer Program , which costs $0. It allows you to use RHEL for free.
After your developer account is created, you need to go to https://www.redhat.com/wapps/sso/login.html to complete your profile.
Next, go to Red Hat Customer Portal to obtain your organization ID and create an activation key.
Now you can start the convert.
sudo convert2rhel --org organization_id --activationkey activation_key
Once it finishes, reboot your system.
sudo shutdown -r now
Convert CentOS 8 to CentOS Stream
If none of the above works, you might want to convert CentOS 8 to CentOS Stream, which tracks just ahead of Red Hat Enterprise Linux (RHEL) development. You can think of it as RHEL beta.
It’s very easy. Simply run the following two commands.
sudo dnf swap centos-linux-repos centos-stream-repos sudo dnf distro-sync
Then check your version number.
cat /etc/redhat-release
Wrapping Up
I hope this tutorial helped you migrate from CentOS 8 to Rocky Linux 8 or Alma Linux 8. As always, if you found this post useful, subscribe to our free newsletter to get more tips and tricks 🙂
Am getting the below error with version 0.22:
CRITICAL – Conversion of UEFI systems is currently not supported, see https://bugzilla.redhat.com/show_bug.cgi?id=1898314 for more information.
No changes were made to the system.