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

migrate centos 8 to rocky linux 8

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.

how to migrate from centos

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

Rocky Linux release 8.4 Green Obsidian

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

migrate centos 8 to alma linux 8

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.

how to migrate from centos to alma linux

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

AlmaLinux release 8.4 Electric Cheetah

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.

join red hat developer program

After your developer account is created, you need to go to https://www.redhat.com/wapps/sso/login.html to complete your profile.

red hat subscription manager

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

convert centos to rhel

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

Convert CentOS 8 to CentOS Stream

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 🙂

Rate this tutorial
[Total: 2 Average: 5]

2 Responses to “How to Migrate From CentOS 8 to Rocky Linux 8/Alma Linux 8

Leave a Comment

  • Comments with links are moderated by admin before published.
  • Your email address will not be published.
  • Use <pre> ... </pre> HTML tag to quote the output from your terminal/console.
  • Please use the community (https://community.linuxbabe.com) for questions unrelated to this article.
  • I don't have time to answer every question. Making a donation would incentivize me to spend more time answering questions.

The maximum upload file size: 2 MB. You can upload: image. Links to YouTube, Facebook, Twitter and other services inserted in the comment text will be automatically embedded. Drop file here