Upgrade Oracle Linux 8 to Oracle Linux 9 using Leapp

August 22, 2022 | 4 minute read
David Gilpin
Principal Product Manager
Text Size 100%:

A previous Oracle Linux blog discussed using Leapp to upgrade from Oracle Linux 7 to Oracle Linux 8. The Leapp utility is used to simplify an in-place upgrade to a major Oracle Linux release. This blog will demonstrate using Leapp to upgrade an Oracle Linux 8 web server to Oracle Linux 9. 

For this demonstration, an Oracle Linux 8 system was built with a "Basic Web Server" profile. An Oracle Linux user 'demo' was created and configured with sudo rights and was granted root SSH permissions in the /etc/ssh/sshd_config file. The Apache web daemon was enabled and configured to support CGI scripts. A small CGI script was copied to the system to produce a web page that includes the hostname, kernel version, Linux distribution version, disk and memory usage.

Preparing for the upgrade

You can find the details for this preparation in Chapter 2 of the Oracle Linux 9 Performing System Upgrades With Leapp. Here is an overview:

  • Set up a means to connect remotely. Virtual Network Computing (VNC) is one suggestion. If upgrading an instance in Oracle Cloud Infrastructure create a serial console connection.
  • Perform a backup. Always back up a system so that it can be restored to its former state if the upgrade fails.
  • Shut down all production workloads on the system, as the upgrade is intrusive and requires multiple reboots.
  • Disable Secure Boot if it is running.
  • Verify that the locale is set to en_US.UTF-8.
  • On Oracle Cloud Infrastructure instances, disable the OS Management Service agent.
  • If the system has network mounted file systems, unmount them and comment out related entries in the /etc/fstab file.
  • If yum-plugin-versionlock is installed, clear any packages with locked versions.
  • If the system is a KVM host, stop all of the virtual machines that are running.

Leapp requires that the system to be upgraded be completely up-to-date with the latest patches.

Update the Oracle Linux 8 machine to the latest patches available:

sudo dnf update

Reboot the system to make all the updates live:

sudo reboot

Log in as the 'demo' user and install the Leapp utility:

sudo dnf install leapp-upgrade --enablerepo=ol8_leapp,ol8_appstream,ol8_baseos_latest

Notice there are no spaces within the parameters passed to the --enablerepo command line switch.

Use a web browser to access the web page. Here is a screenshot before the Leapp upgrade, showing it is running on Oracle Linux 8:

Web page showing Oracle Linux 8.6

Running the preupgrade

You can find the details in Chapter 3 of the Oracle Linux 9 Performing System Upgrades with Leapp.

Run the preupgrade command.

sudo leapp preupgrade --oraclelinux

On the demo system, the preupgrade process took about 2 minutes to complete. This time is dependent on a number of variables including the number of packages installed, CPU speed, storage speed, etc.

Analyzing the Leapp report

Please read this section in the Oracle Linux 9 Performing System Upgrades with Leapp.

It is very important to understand any high-risk inhibitors. Once you clear some of your high-risk issues you can always run the preupgrade process again. Continue to clear issues and running preupgrade until you have no inhibitors or high-risk issues.

Performing the upgrade

Please read this section in the Oracle Linux 9 Performing System Upgrades with Leapp.

Run the upgrade command.

sudo leapp upgrade --oraclelinux

You will see a LOT of information as the upgrade continues. Some of the messages might say completed, but those are just completions of a particular step! This might be a good time to take a break while the upgrade progresses.  On the demo system, here are the three major "stages" of the Leapp process and the approximate time for each to complete:

  • Initial upgrade pass 8:37
  • Second upgrade pass: 7:42
  • Firstboot: about 1 minute

Verifying the upgrade

Upon completion, the upgrade process generates the same files as the preupgrade phase: a process log, a report, and the /var/log/leapp/answerfile.

Examine the /var/log/leapp/leapp-report.txt and fulfill any important recommendations to be completed after the upgrade process.

Refresh the browser pointing at the static CGI web page—and here are the results. The Apache web server was still "alive" and well. The CGI script was still working—and it shows it is now running on Oracle Linux 9!

Web page showing Oracle Linux 9.0

Look before you Leapp

Make sure to thoroughly review the Leapp documentation before using it to perform any Oracle Linux updates. Also remember it is highly recommended that you have an up-to-date and tested backup of a production server before attempting to upgrade the OS using Leapp.

Our Leapp documentation for Oracle Linux 8 and Oracle Linux 9 will continue to be updated as Leapp continues to be qualified and improved, so check these links often.

For the latest information on Oracle Linux, including Oracle Linux Support, visit https://www.oracle.com/linux/.

 

David Gilpin

Principal Product Manager


Previous Post

Oracle Linux and BPF

Alan Maguire | 7 min read

Next Post


New landing page for Oracle Linux and Virtualization product training

Craig McBride | 1 min read