This article will guide you through every step to migrate your current CentOS 8 installation to Oracle Linux 8.
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.
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
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.
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.sh
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.sh
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.
Before rebooting, use the
grubby tool to confirm that UEK is the current default boot kernel option.
sudo grubby --default-kernel
To add the finishing touch, let’s update the server hostname to match Oracle Linux 8.
sudo hostnamectl set-hostname ol8
Finally, reboot the server so it boots using this kernel.
Oracle Linux Server 8 entry will be the first on the list, so press
Enter to boot into your newly Oracle Linux 8 distro.
Step 4: Confirm CentOS 8 to Oracle Linux 8 Successful Migration
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.
As we can see, everything works smoothly.
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: