CentOS 8 to Oracle Linux 8 Migration: A Step-by-Step Guide

This article will guide you through every step to migrate your current CentOS 8 installation to Oracle Linux 8.

With the focus shifting from the CentOS project to CentOS Stream, several distros have emerged on the Linux scene, competing for the position of preferred CentOS replacement.

One of the leading contenders is Oracle Linux. It is free to download, use, and distribute operating system, a 1:1 binary compatible fork of Red Hat Enterprise Linux (RHEL).

Since its first release in 2006, Oracle Linux has been 100% application binary compatible with the equivalent RHEL version. In that time, we have never had a compatibility bug logged.

Simon Coter, Director, Oracle Linux and Virtualization Product Management

Enterprises can use it in a production environment for free, with no obligation to Oracle. In other words, Oracle Linux is free to use, and you pay only if you need Oracle Linux Support.

On top of that, one of the main advantages is that it closely follows the RHEL release cycle using the modified UEK or “Unbreakable Enterprise Kernel” produced by Oracle.

Unbreakable Enterprise Kernel provides additional benefits over the mainline kernel in terms of stability and minimal backport packages, among other features.

So without further ado, let me show you how you can easily migrate your existing CentOS 8 installation to Oracle Linux 8.

Preliminary Statements

In its GitHub repository, Oracle Linux provides the script (centos2ol.sh) to migrate any current CentOS 6, 7, or 8 installations to the equivalent version of Oracle Linux.

You can migrate CentOS 7 to Oracle Linux 7 or CentOS 8 to Oracle Linux 8. Note that it is impossible to migrate directly from CentOS 7 to Oracle Linux 8.

For this to happen, you first need to migrate from CentOS 7 to Oracle Linux 7 and then perform an in-place upgrade from Oracle Linux 7 to Oracle Linux 8.

But let’s get back to our main task – the CentOS 8 to Oracle Linux 8 migration.

Step 1: Take System Backup

Before upgrading, please make sure you take the backup of all your essential data and, if possible, take a snapshot of the complete CentOS 8 system. This way, you will be on the right side of things if anything goes wrong.

Step 2: Upgrade the Current CentOS 8 System

The next step in the upgrade process is to ensure we have a wholly upgraded system. Update existing software with the following command:

sudo dnf update
Upgrading the Current CentOS 8 System

Once all the packages are updated (if any), reboot your system to apply the changes.

Now letโ€™s verify our current operating system version. Here is our CentOS 8 system before beginning the migration process.

CentOS 8 GNOME Desktop

Step 3: Download the Migration Script

Download the migration script from the Oracle GitHub repo. The simplest way to get it is to use cURL:

curl -O https://raw.githubusercontent.com/oracle/centos2ol/main/centos2ol.shCode language: JavaScript (javascript)
Download CentOS to Oracli Linux migration script

This downloads the migration script centos2ol.sh, as indicated.

Step 4. Migrate CentOS 8 to Oracle Linux 8

Once downloaded, we can start the migration process. To switch to Oracle Linux 8, run the script as shown below.

sudo bash centos2ol.shCode language: CSS (css)
Migrate CentOS 8 to Oracle Linux 8

The default kernel will be upgraded to Oracle’s Unbreakable Enterprise Kernel (UEK) as part of the process. On top of that, the script will not only swap the CentOS 8 repository with Oracle Linux 8, but it will also reinstall the packages to ensure compatibility.

This will take some time, depending on your Internet connection speed. When the migration is finished, you will be prompted to restart your CentOS system.

CentOS 8 to Oracle Linux 8 migration succeeded

Before rebooting, use the grubby tool to confirm that UEK is the current default boot kernel option.

sudo grubby --default-kernelCode language: JavaScript (javascript)
Confirm that UEK is the current default boot kernel option

To add the finishing touch, let’s update the server hostname to match Oracle Linux 8.

sudo hostnamectl set-hostname ol8Code language: JavaScript (javascript)

Finally, reboot the server so it boots using this kernel.

sudo reboot

The Oracle Linux Server 8 entry will be the first on the list, so press Enter to boot into your newly Oracle Linux 8 distro.

Oracle Liunux 8 GRUB Menu

Step 4: Confirm CentOS 8 to Oracle Linux 8 Successful Migration

Oracle Linux 8 GNOME Desktop

You’ll probably want to run some tests to ensure that you are satisfied with the result. For example, let’s try to update our package base.

Updating Oracle Linux 8 packages after migration from CentOS 8

As we can see, everything works smoothly.

Conclusion

Congratulations! You have successfully migrated CentOS 8 to Oracle Linux 8.

Without a doubt, Oracle Linux 8 is most certainly a viable option for your server. Itโ€™s lightning-fast, rock-solid stable, and easy to use as any RHEL-based operating system.

I hope you found this helpful guide. Thanks for using it! Feel free to share your thoughts in the comments box below.

Here are more guides that will be of interest to you:

Bobby Borisov

Bobby Borisov

Bobby, an editor-in-chief at Linuxiac, is a Linux professional with over 20 years of experience. With a strong focus on Linux and open-source software, he has worked as a Senior Linux System Administrator, Software Developer, and DevOps Engineer for small and large multinational companies.

Think You're an Ubuntu Expert? Let's Find Out!

Put your knowledge to the test in our lightning-fast Ubuntu quiz!
Ten questions to challenge yourself to see if you're a Linux legend or just a penguin in the making.

1 / 10

Ubuntu is an ancient African word that means:

2 / 10

Who is the Ubuntu's founder?

3 / 10

What year was the first official Ubuntu release?

4 / 10

What does the Ubuntu logo symbolize?

5 / 10

What package format does Ubuntu use for installing software?

6 / 10

When are Ubuntu's LTS versions released?

7 / 10

What is Unity?

8 / 10

What are Ubuntu versions named after?

9 / 10

What's Ubuntu Core?

10 / 10

Which Ubuntu version is Snap introduced?

The average score is 69%