Technical – Converting CentOS 8 web server to Oracle Linux
Technical – Oracle Linux “OL”) Drop In Replacement For CentOS 8.
Last month we blogged the news that RHEL has decided to prematurely end support for CentOS 8 on 31 Dec 2021. This has left IT departments scrambling to find a replacement before the end of the year. There are several options, and most of them including switching to a Red Hat support license require a complete reinstall of your server, applications, and the migration of data. Compounded with the time testing and fixing any issues that may arrive stress levels are on the rise as the clock is ticking.
There is one option that does not require you to reinstall everything, and that is to convert to Oracle Linux 8, which is also a rebranded RHEL 8, and offers an easy script to convert your system from RHEL / CentOS 8 to OL 8. The script will automatically reconfigure the system to download and install the needed kernel and other files. Simply reboot after the conversion is complete. The conversion installs the Oracle Unbreakable Kernel by default but If you need 100% code compatibility with RHEL 8, you can switch to use the RHEL Kernel.
So how does this work? Is it really as easy as advertised? I converted Brent’s World To Oracle Enterprise Linux on Jan 01 2021, and I can honestly say for me it was! The entire process took about 4 hours, with the complete backup of the VM and its associated disks taking up the majority of that time.
Here are the steps I took.
I made of copy of the VMWARE folder, and placed it on a separate drive, This was mostly done in the event the conversion was not successful, not of losing a drive in the process.
I downloaded the centos2ol.sh script from GitHub
I copied the test from GitHub, put it in a text editor on the server and gave it executable permissions.
The easiest way however is to download it using curl.
From a shell prompt $ curl -O sudo https://raw.githubusercontent.com/oracle/centos2ol/main/centos2ol.sh
Grant execution privileges to the script using chmod.
# chmod 776 centos2ol.sh
Verify the script is now executable by listing the directory with the -l option or use the ll alias.
We are now ready to execute the script
I would recommend stopping any web or database services before the install. I did on my production box, but not before starting the install on the demo box for this blog. At the very least this will keep users from connecting to your web applications and database during the install and reboot.
Unless the script was downloaded into a location that is in your system path, execute the script by typing sudo ./centos2ol.sh
The script will now run. Note the kernel version BEFORE the script is run.
What the script will do is redirect YUM to the Oracle repositories and replace the Kernel and necessary files.
When the script is complete go ahead and reboot your Linux server, note the different Kernel information after the reboot.
We are done!! How easy was that?
The script installed Oracles Unbreakable Kernel, if you or your application or organization require a 100% RHEL compliant Kernel. Follow the steps below to switch to using the RHEL kernel.
Let is take a look at the kernels available to us on our newly installed Oracle Linux.
At the command prompt, enter the following command.
# sudo grubby -–info=ALL | grep ^kernel
This will list all of the Linux kernels currently present on your workstation/server.
You can verify which kernel is currently the default kernel by issuing the following command.
# sudo grubby -–default-kernel
It should show what we already know, that we are using Oracles UEK kernel.
It does, so let us now switch to the RHEL kernel. We need to first find the absolute path to the kernel. We do that by first copying information between the quotes of the kernel directive of the second item on the list of installed kernels. Then enter the following command.
# sudo grubby –set-default <paste>
If the command is successful, you should see the following output.
Now reboot the system to load the newly selected RHEL kernel.
# reboot
When the system is back up, login and check the kernel version with the uname command.
# sudo uname -r
We should now see that we are using the RHEL kernel.
That is all there is to converting a CentOS 8 system to Oracle Enterprise Linux! I hope you found this blog informative, and that you will come back for next month’s technical blog.
Some notes on this blog.
It is considered poor practice to use the root account to perform maintenance on a NIX server. The best practice is to use a user account with granular privileges granted in the SUDOERS file, and perform the commands using sudo (Super User do). I configured a demo VM for the purpose of getting screenshots and used root for expedience only!
DISCLAIMER: I am not responsible for loss of data, or downtime incurred by using the steps and procedures in this blog! Follow best practices and your employer’s policies if attempting this upgrade.
I am not affiliated with Oracle in any way, the steps outlined here should in no way substitute for official Oracle installation best practices or support.
Thank you for visiting Brent’s World. If you find this content helpful and wish to be notified when new content is posted, please consider registering to receive an email notification when new content is posted. You register by clicking HERE!
Comments
Technical – Converting CentOS 8 web server to Oracle Linux — No Comments
HTML tags allowed in your comment: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>