Site icon CentLinux

How to migrate CentOS 8 to Oracle Linux

Share on Social Media

In this Linux tutorial, you will learn how to migrate CentOS 8 to Oracle Linux, which is another CentOS alternative from the third largest software company in the world. #centlinux #linux #oracle

What is Oracle Linux?

Oracle Linux is a Linux distribution based on Red Hat Enterprise Linux (RHEL) and is developed, maintained, and supported by Oracle Corporation. It is designed to be fully compatible with RHEL, making it a suitable alternative for enterprises that require a stable, secure, and high-performance operating system. Oracle Linux is optimized to run Oracle software and hardware, but it is also widely used for general-purpose enterprise computing.

Key Features of Oracle Linux

RHEL Compatibility:
Oracle Linux is 100% compatible with RHEL, allowing users to run RHEL applications without modification. It uses the same package management system (YUM/DNF) and adheres to the same versioning and release cycle as RHEL.

Unbreakable Enterprise Kernel (UEK):
Oracle Linux offers two kernel options:

Enterprise-Grade Support:
Oracle provides robust support services, including patches, updates, and security fixes, making it a reliable choice for mission-critical environments.

Integration with Oracle Products:
Oracle Linux is tightly integrated with Oracle’s ecosystem, including Oracle Database, Oracle Cloud, and other enterprise applications, ensuring optimal performance and ease of management.

Cost-Effective:
Oracle Linux is free to download and use, with optional paid support subscriptions available for enterprises requiring professional assistance.

Security and Stability:
Like RHEL, Oracle Linux emphasizes long-term stability and security, making it suitable for enterprise environments.

How to migrate CentOS 8 to Oracle Linux

Use Cases

History

Oracle Linux was first released in 2006 as part of Oracle’s strategy to provide a complete stack of enterprise software and hardware solutions. Over the years, it has gained popularity for its performance optimizations and strong support for Oracle products.

In summary, Oracle Linux is a robust, enterprise-grade operating system that combines RHEL compatibility with Oracle-specific enhancements, making it an excellent choice for organizations leveraging Oracle technologies or seeking a reliable RHEL alternative.

Recommended Training: Complete Linux Training Course to Get Your Dream IT Job 2025 from Imran Afzal

Environment Specification

We are using a minimal CentOS 8 virtual machine with following specifications.

Checking Current Linux OS

By using a SSH client, connect with centos-8.centlinux.com as root user.

Execute following commands to check the version of your Linux OS.

# cat /etc/os-release
NAME="CentOS Linux"
VERSION="8"
ID="centos"
ID_LIKE="rhel fedora"
VERSION_ID="8"
PLATFORM_ID="platform:el8"
PRETTY_NAME="CentOS Linux 8"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:centos:centos:8"
HOME_URL="https://centos.org/"
BUG_REPORT_URL="https://bugs.centos.org/"
CENTOS_MANTISBT_PROJECT="CentOS-8"
CENTOS_MANTISBT_PROJECT_VERSION="8"

# cat /etc/centos-release
CentOS Linux release 8.3.2011

Check the version of current Linux Kernel.

# uname -r
4.18.0-240.1.1.el8_3.x86_64

Migrate CentOS 8 to Oracle Linux

Oracle has made the migration process from CentOS Linux to Oracle Linux straightforward and efficient by providing a dedicated bash script called centos2ol.sh on their official GitHub repository. This script is specifically designed to facilitate the seamless transition of systems running CentOS Linux versions 6, 7, and 8 to Oracle Linux. However, it is important to note that the script does not support CentOS Stream, as CentOS Stream follows a different release model and is not directly compatible with the migration process intended for traditional CentOS versions.

To get started with the migration, you can easily download the centos2ol.sh script from Oracle’s GitHub repository using common command-line tools like wget or curl. These tools allow you to fetch the script directly from the repository and save it to your local system. Once downloaded, the script can be executed to automate the migration process, ensuring that your system is properly converted to Oracle Linux with minimal manual intervention. This approach simplifies the migration and reduces the risk of errors, making it an ideal solution for administrators and IT professionals looking to transition from CentOS to Oracle Linux.

# wget https://raw.githubusercontent.com/oracle/centos2ol/main/centos2ol.sh
--2021-07-10 19:37:18--  https://raw.githubusercontent.com/oracle/centos2ol/main/centos2ol.sh
Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 185.199.111.133, 185.199.110.133, 185.199.109.133, ...
Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|185.199.111.133|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 21609 (21K) [text/plain]
Saving to: ‘centos2ol.sh’

centos2ol.sh        100%[===================>]  21.10K  8.51KB/s    in 2.5s

2021-07-10 19:37:34 (8.51 KB/s) - ‘centos2ol.sh’ saved [21609/21609]

Grant execution permissions on centos2ol.sh to everyone.

# chmod +x centos2ol.sh

According to centos2ol.sh documentation, please check and adjust following prerequisites.

  1. Because of the GRUB2 BootHole vulnerability, our SecureBoot shim can only boot kernels signed by Oracle and we can only replace the default CentOS kernels. While this may not have an impact if SecureBoot is currently disabled, enabling it at a later date could render the system unbootable. For that reason, we strongly recommend removing all non-standard kernels, i.e. any kernel that is installed that is not provided by either the base or updates repo. This includes the centosplus kernels.
  2. Ensure your CentOS yum or dnf configuration is working, i.e. there are no stale repositories.
  3. Disable all non-CentOS repositories. You can re-enable the repos after the switch.
  4. Ensure you have at least 5GB of free space in /var/cache.
  5. All automatic updates, e.g. via yum-cron should be disabled.

When ready, execute centos2ol.sh script to start migration process for your Linux OS.

# ./centos2ol.sh
Checking for required packages...
Checking your distribution...
package epel-release is not installed
Checking for yum lock...
Checking for required python packages...
Identifying dnf modules that are enabled
Finding your repository directory...
Learning which repositories are enabled...
Repositories enabled before update include:
appstream
baseos
extras
Looking for yumdownloader...
Backing up and removing old repository files...
Removing CentOS-specific yum configuration from /etc/yum.conf
Downloading Oracle Linux release package...

The centos2ol.sh script list down the installed packages and then replaces the CentOS standard yum repositories with that of Oracle Linux.

centos2ol.sh downloading packages
centos2ol.sh installing packages

During the migration process your Linux OS packages has been replaced by the respective Oracle’s Linux supported software packages.

centos2ol completed migration

centos2ol.sh script has finished it’s work. Reboot your machine to start your operating system with new Linux Kernel.

# reboot

During system startup, the GRUB menu is now displaying two new entries for Linux Server. One for the standard Linux kernel, while the other is for the Unbreakable Enterprise Kernel (UEK).

Boot your Linux server with UEK.

oracle linux grub menu

After successful startup, you will reach at the Linux commandline (CLI) based login prompt.

oracle linux cli login

Login as root user.

Checking New Linux Operating System

Check the current operating system version by executing following commands.

# cat /etc/os-release
NAME="Oracle Linux Server"
VERSION="8.4"
ID="ol"
ID_LIKE="fedora"
VARIANT="Server"
VARIANT_ID="server"
VERSION_ID="8.4"
PLATFORM_ID="platform:el8"
PRETTY_NAME="Oracle Linux Server 8.4"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:oracle:linux:8:4:server"
HOME_URL="https://linux.oracle.com/"
BUG_REPORT_URL="https://bugzilla.oracle.com/"

ORACLE_BUGZILLA_PRODUCT="Oracle Linux 8"
ORACLE_BUGZILLA_PRODUCT_VERSION=8.4
ORACLE_SUPPORT_PRODUCT="Oracle Linux"
ORACLE_SUPPORT_PRODUCT_VERSION=8.4

# cat /etc/oracle-release
Oracle Linux Server release 8.4

Also check the version of your new Linux Kernel.

# uname -r
5.4.17-2102.202.5.el8uek.x86_64

Final Thoughts

Embarking on the journey to migrate from CentOS 8 to Oracle Linux is a strategic move towards stability and reliability. Our comprehensive guide ensures a smooth transition, safeguarding your data and maintaining operational continuity.

Struggling with AWS or Linux server issues? I specialize in configuration, troubleshooting, and security to keep your systems performing at their best. Check out my Fiverr profile for details.

Let me guide you through the migration journey, ensuring a seamless shift and empowering your system with enhanced performance and support.

Exit mobile version