You can support us by downloading this article as PDF from the Link below. Download the guide as PDF

This article is created to aid in performing an in-place upgrade from RHEL 6 to RHEL 8 system. To be specific we will be upgrading a RHEL 6.10 to the latest RHEL, which as of this article writing is 8.3. Red Hat Enterprise Linux 6 is now in the Maintenance Support 2 phase of the product life cycle. In this phase there are no new functionality and hardware enablement planned for availability. The updates are limited to qualified critical security fixes and business-impacting urgent issues.

Red Hat Enterprise Linux subscriptions are not tied to a particular release of the operating system. As a customer with active subscription, you can update your Red Hat Enterprise Linux 6 infrastructure to Red Hat Enterprise Linux 7 or 8 at any time, free of charge, to take advantage of recent upstream innovations.

An in-place upgrade offers a way of upgrading a system to a new major release of Red Hat Enterprise Linux by replacing the existing operating system. We will perform this upgrade in phases – first to RHEL 7, then from RHEL 7 to RHEL 8.

WARNING!!!

THIS UPGRADE IS NOT RECOMMENDED FOR PRODUCTION SYSTEMS. BETTER TO INSTALL NEW RHEL 8 SERVER AND MIGRATE APPLICATIONS. THIS UPGRADE PROCESS COULD BREAK YOUR SYSTEM.

Upgrade Considerations and Limitations

The following are the general criteria a system must meet to upgrade from RHEL 6 to RHEL 8:

  • Server CPU architecture should be Intel 64 or IBM Z.
  • The FIPS mode should be disabled.
  • The system should not contain LUKS-encrypted partitions or volumes.
  • The system should have access to the repositories with RHEL 6, RHEL 7 and RHEL 8 content is provided.

For users running applications not provided by Red Hat, you have to confirm the packages will be compatible with the particular target version of RHEL 8. The package dependencies should also be confirmed to be available in a repository to which you have access to prevent any dependency issues which could break your applications.

Upgrading RHEL 6 To RHEL 8 Server

These are the sequence of events in the in-place upgrade from RHEL 6 to RHEL 8.

  1. Preparing your RHEL 6 system for the upgrade by updating to the latest version of RHEL 6 – which should be 6.10.
  2. Performing a pre-upgrade assessment on the RHEL 6 system to guarantee smooth upgrade to RHEL 8
  3. Initiating an in-place upgrade to from RHEL 6.10 to RHEL 7.9
  4. Preparing RHEL 7 system for the upgrade to RHEL 8 by updating the RHEL 7 system to the latest version of RHEL 7 – this is 7.9
  5. Performing a pre-upgrade assessment of the RHEL 7 and fixing any issues prior to upgrading
  6. Initiating an in-place upgrade from RHEL 7.9 to RHEL 8.3.
  7. Verify the state of the upgraded system

Let’s cover each process in detail.

Step 1: Prepare RHEL 6 System for Upgrade to RHEL 7

Confirm registration status of your RHEL 6 system.

$ sudo subscription-manager status

If not register and subscribe.

sudo subscription-manager register --auto-attach

Verify that you have the Red Hat Enterprise Linux Server subscription attached:

$ sudo subscription-manager list --installed

Ensure you’re running the latest minor release of RHEL 6. This can be achieved by updating the system.

sudo yum -y update

Reboot after and upgrade.

sudo reboot

Confirm you’re on the latest release or RHEL 6.

$ cat /etc/redhat-release 
Red Hat Enterprise Linux Server release 6.10 (Santiago)

Once the system is rebooted enable the Extras repository which contains the preupgrade-assistant, preupgrade-assistant-ui, preupgrade-assistant-el6toel7, preupgrade-assistant-el6toel7-data and redhat-upgrade-tool packages:

$ sudo subscription-manager repos --enable rhel-6-server-extras-rpms
Repository 'rhel-6-server-extras-rpms' is enabled for this system.

$ sudo subscription-manager repos --enable rhel-6-server-optional-rpms
Repository 'rhel-6-server-optional-rpms' is enabled for this system.

Then install the required packages:

sudo yum -y install redhat-upgrade-tool preupgrade-assistant preupgrade-assistant-el6toel7 preupgrade-assistant-ui

Step 2: Perform RHEL 6 System assessment

Next we assess the system for any potential problems that might be encountered during upgrade to Red Hat Enterprise Linux 7. The Preupgrade Assistant (preupg command) is used for this purpose.

Run the preupg command to assess your RHEL 6 system

sudo preupg

When asked if you want to continue answer y.

The Preupgrade Assistant is a diagnostics tool
and does not perform the actual upgrade.
Do you want to continue? [Y/n]
y

The performed test results are printed to the command line standard output, followed by its result.

....
Gathering logs used by the Preupgrade Assistant:
All installed packages                                 : 01/10 ...finished (time 00:00s)
All changed files                                      : 02/10 ...finished (time 00:47s)
Changed config files                                   : 03/10 ...finished (time 00:00s)
All users                                              : 04/10 ...finished (time 00:00s)
All groups                                             : 05/10 ...finished (time 00:00s)
Service statuses                                       : 06/10 ...finished (time 00:00s)
All installed files                                    : 07/10 ...finished (time 00:02s)
All local files                                        : 08/10 ...finished (time 00:03s)
All executable files                                   : 09/10 ...finished (time 00:00s)
Red Hat signed packages                                : 10/10 ...finished (time 00:00s)
Assessment of the system, running checks / SCE scripts:
001/140 ...done    (Configuration files to be reviewed) (time: 00:02s)
002/140 ...done    (File lists for the manual migration) (time: 00:00s)
003/140 ...done    (Bacula Backup Software) (time: 00:00s)
004/140 ...done    (MySQL configuration) (time: 00:00s)
005/140 ...done    (MySQL data stack) (time: 00:00s)
006/140 ...done    (Changes related to moving from MySQL to MariaDB) (time: 00:00s)
007/140 ...done    (PostgreSQL) (time: 00:00s)
008/140 ...done    (GNOME desktop environment) (time: 00:00s)
009/140 ...done    (KDE desktop environment) (time: 00:00s)
010/140 ...done    (POWER6 processors) (time: 00:00s)
.....

Assessment report file will be stored under /root/preupgrade/result.html:

....
|Moving openssh-keycat                                                                         |needs_inspection  |
|Changed configuration files                                                                   |needs_inspection  |
|Changes in utilities                                                                          |needs_inspection  |
|Obsolete RPM packages                                                                         |needs_inspection  |
|httpd                                                                                         |needs_inspection  |
|Binaries to be rebuilt                                                                        |needs_inspection  |
|Libraries with their soname bumped                                                            |needs_inspection  |
|Removed .so libraries                                                                         |needs_inspection  |
|Ethernet interface naming                                                                     |needs_inspection  |
|Python packages                                                                               |needs_inspection  |
|Repositories for Kickstart                                                                    |needs_inspection  |
|Incorrect usage of reserved UIDs and GIDs                                                     |needs_inspection  |
|Configuration files to be reviewed                                                            |needs_action      |
|MySQL configuration                                                                           |needs_action      |
|Packages not signed by Red Hat                                                                |needs_action      |
|Removed RPM packages                                                                          |needs_action      |
|"not-base" channels                                                                           |needs_action      |
|Removing sandbox from SELinux                                                                 |needs_action      |
|GRUB to GRUB 2 migration                                                                      |needs_action      |
|Enabled and disabled services in Red Hat Enterprise Linux 6                                   |needs_action      |
|The /etc/rc.local and /etc/rc.d/rc.local files                                                |needs_action      |
|The cgroups configuration compatibility                                                       |needs_action      |
|GNOME desktop environment                                                                     |fail              |
-------------------------------------------------------------------------------------------------------------------
The tarball with results is stored in '/root/preupgrade-results/preupg_results-210129180616.tar.gz' .
The latest assessment is stored in the '/root/preupgrade' directory.
Summary information:
We have found some critical issues. In-place upgrade or migration is not advised.
Read the file /root/preupgrade/result.html for more details.
Please ensure you have backed up your system and/or data
before doing a system upgrade to prevent loss of data in
case the upgrade fails and full re-install of the system
from installation media is needed.
Upload results to UI by the command:
e.g. preupg -u http://example.com:8099/submit/ -r /root/preupgrade-results/preupg_results-210129180616.tar.gz .

The report can be viewed from a web browser.

sudo firefox file:///root/preupgrade/result.html

To view EXTREME upgrade risks found use the command

sudo preupg --riskcheck --verbose

Resolve any issues found by the Preupgrade Assistant during the assessment before going to the next step.

upgrade rhel 6 to rhel 8 04

Step 3: Upgrade from RHEL 6 to RHEL 7

Before performing an upgrade of your system using Red Hat Upgrade Tool make sure you back up all of your data in order to avoid potential data loss.

Login to Red Hat Downloads portal and download RHEL 7 DVD ISO. We’ll use this as installation media during upgrade.

upgrade rhel 6 to rhel 8 01

Here is the location of my file.

upgrade rhel 6 to rhel 8 03

Backup some few important configuration files.

sudo mkdir /root/backups
sudo cp /etc/{shadow,gshadow} /root/backups
sudo cp /etc/grub.conf /root/backups

Run the redhat-upgrade-tool to download the packages needed to for upgrading to RHEL 7.

To upgrade the system using an ISO image, provide the path to the ISO image after the --iso option.

sudo redhat-upgrade-tool --iso ~/rhel-server-7.9-x86_64-dvd.iso

To complete the installation, you need to reboot the system

sudo reboot

Verify that the system was upgraded to RHEL 7:

$ cat /etc/redhat-release

If your RHEL 6 system had proper registration and subscription to RHSM, the upgrade process should have automatically resubscribed it for RHEL 7.

$ sudo yum repolist

Upgrading from GRUB Legacy to GRUB 2:

sudo yum remove grub
sudo yum install grub2

Check your boot device:

$ sudo lsblk

Generate grub2 configurations.

sudo grub2-install --grub-setup=/bin/true /dev/device
sudo grub2-mkconfig -o /boot/grub2/grub.cfg

Step 4: Upgrade from RHEL 7 to RHEL 8

Enable Base, Extras and Optional repositories:

sudo subscription-manager repos --enable rhel-7-server-rpms
sudo subscription-manager repos --enable rhel-7-server-extras-rpms
sudo subscription-manager repos --enable rhel-7-server-optional-rpms

Set the Red Hat Subscription Manager to consume the latest RHEL 7 content:

sudo subscription-manager release --unset

Clear package lock

sudo yum versionlock clear

Ensure you have the system locale set to en_US.UTF-8:

$ cat /etc/locale.conf

Update all packages to the latest RHEL 7 version:

sudo yum update
sudo reboot

Install the Leapp utility:

sudo yum install leapp leapp-repository

Download additional required data files (RPM package changes and RPM repository mapping) attached to the Knowledgebase article Data required by the Leapp utility for an in-place upgrade from RHEL 7 to RHEL 8 and place them in the /etc/leapp/files/ directory.

Perform the pre-upgrade phase:

sudo leapp preupgrade

Manually edit the /var/log/leapp/answerfile file, and uncomment the confirm line of the file by deleting the # symbol, and confirm your answer as True or False. Also examine the report in the /var/log/leapp/leapp-report.txt file and resolve all the reported problems before proceeding with the in-place upgrade from RHEL 7 to RHEL 8.

Start the upgrade process:

sudo leapp upgrade

Reboot the system after the upgrade:

sudo reboot

Verify that the current OS version is Red Hat Enterprise Linux 8:

$ cat /etc/redhat-release

Verify Product list and release version

$ sudo subscription-manager list --installed
$ sudo subscription-manager release

Unset Red Hat Subscription Manager to consume the latest RHEL content:

sudo subscription-manager release --unset

Update to latest RHEL release.

sudo  yum update

Reboot system.

sudo reboot

If you’re lucky you should have a working RHEL 8 system upgraded from RHEL 6. As stated earlier we highly recommend new installation of RHEL 8 and planning for applications migration instead of an in-place two step upgrade process. Many things could go wrong and the result in unbootable system. Take caution when performing operations in this article.

Similar articles on RHEL systems.

Install and Configure Virtualmin on RHEL 8

Enable CodeReady Linux Builder Repository on RHEL 8

Automate Icinga2 Configurations with Icinga Director on RHEL 8

Install Quipucords / QPC on CentOS RHEL 8

As an appreciation for the content we put out,
we would be thrilled if you support us!


As we continue to grow, we would wish to reach and impact more people who visit and take advantage of the guides we have on our blog. This is a big task for us and we are so far extremely grateful for the kind people who have shown amazing support for our work over the time we have been online.

Thank You for your support as we work to give you the best of guides and articles. Click below to buy us a coffee.

LEAVE A REPLY

Please enter your comment!
Please enter your name here