How to upgrade Oracle Linux 7 to Oracle Linux 8

With the CentOS changes, everyone in the community was afraid of the changes imposed after years on the distribution by IBM, so this week the company decided to migrate all servers that currently use Centos 7 to Oracle Linux 8 influenced by my technical arguments and consolidated information from years using Oracle Linux for database, so I’m writing the script in a simple way
the migration process from Centos 7 to Oracle Linux 7 and upgrade to Oracle Linux 8. Always remember to approve all services, packages and applications before migrating the production servers, only in this way will it be possible to measure the impact on the production environment, we will use for this migration the Leapp utility.

The Leapp utility is a framework for updating and upgrading operating systems as well as applications. The utility’s component packages enable the creation of different workflows into profiles for updating software.

Leapp operations consist of two phases: a preupgrade phase that runs checks on the system to determine if the software can be upgraded. The second phase is the actual upgrade itself, whose process is based on configuration files that map packages between previous and current versions of the software.

Note

Currently, the Leapp utility is used to upgrade the operating systems only, specifically, from the current Oracle Linux 7 release to the current Oracle Linux 8 version. The procedures in this document do not apply to and are unsupported on any other operating systems or versions.

1 – Confirming that our Oracle Linux version is 7.

[root@srvv001 ~]# cat /etc/*-release | grep PRETTY
PRETTY_NAME="Oracle Linux Server 7.9"

2 – Survey all services or applications currently used in the environment.

[root@srvv001 ~]# systemctl list-unit-files --state=enabled
UNIT FILE                                   STATE
auditd.service                              enabled
autovt@.service                             enabled
chronyd.service                             enabled
crond.service                               enabled
dbus-org.freedesktop.NetworkManager.service enabled
dbus-org.freedesktop.nm-dispatcher.service  enabled
dmraid-activation.service                   enabled
getty@.service                              enabled
irqbalance.service                          enabled
libstoragemgmt.service                      enabled
lvm2-monitor.service                        enabled
microcode.service                           enabled
NetworkManager-dispatcher.service           enabled
NetworkManager-wait-online.service          enabled
NetworkManager.service                      enabled
ol-consolebaud.service                      enabled
postfix.service                             enabled
rhel-autorelabel.service                    enabled
rhel-configure.service                      enabled
rhel-dmesg.service                          enabled
rhel-domainname.service                     enabled
rhel-import-state.service                   enabled
rhel-loadmodules.service                    enabled
rhel-readonly.service                       enabled
rngd.service                                enabled
rsyslog.service                             enabled
smartd.service                              enabled
sshd.service                                enabled
sysstat.service                             enabled
systemd-readahead-collect.service           enabled
systemd-readahead-drop.service              enabled
systemd-readahead-replay.service            enabled
tuned.service                               enabled
waagent-network-setup.service               enabled
waagent.service                             enabled
dm-event.socket                             enabled
lvm2-lvmetad.socket                         enabled
lvm2-lvmpolld.socket                        enabled
rpcbind.socket                              enabled
default.target                              enabled
multi-user.target                           enabled
remote-fs.target                            enabled
runlevel2.target                            enabled
runlevel3.target                            enabled
runlevel4.target                            enabled


[root@srvv001 ~]# systemctl list-units --type=service --state=running
UNIT                       LOAD   ACTIVE SUB     DESCRIPTION
auditd.service             loaded active running Security Auditing Service
chronyd.service            loaded active running NTP client/server
crond.service              loaded active running Command Scheduler
dbus.service               loaded active running D-Bus System Message Bus
getty@tty1.service         loaded active running Getty on tty1
hypervkvpd.service         loaded active running Hyper-V KVP daemon
irqbalance.service         loaded active running irqbalance daemon
libstoragemgmt.service     loaded active running libstoragemgmt plug-in server daemon
lvm2-lvmetad.service       loaded active running LVM2 metadata daemon
network.service            loaded active running LSB: Bring up/down networking
NetworkManager.service     loaded active running Network Manager
polkit.service             loaded active running Authorization Manager
postfix.service            loaded active running Postfix Mail Transport Agent
rngd.service               loaded active running Hardware RNG Entropy Gatherer Daemon
rsyslog.service            loaded active running System Logging Service
serial-getty@ttyS0.service loaded active running Serial Getty on ttyS0
smartd.service             loaded active running Self Monitoring and Reporting Technology (SMART) Daemon
sshd.service               loaded active running OpenSSH server daemon
systemd-journald.service   loaded active running Journal Service
systemd-logind.service     loaded active running Login Service
systemd-udevd.service      loaded active running udev Kernel Device Manager
tuned.service              loaded active running Dynamic System Tuning Daemon
waagent.service            loaded active running Azure Linux Agent
webmin.service             loaded active running LSB: web-based administration interface for Unix systems

3 – Stop all existing workload like database or web servers.

[root@srvv001 ~]# systemctl stop mysql
[root@srvv001 ~]# systemctl status mysql

[root@srvv001 ~]# systemctl stop zabbix-server
[root@srvv001 ~]# systemctl status zabbix-server

4 – Disable Secure Boot if it is running.

[root@srvv001 ~]# sudo bootctl status
System:
   Machine ID: 97da09219a2d42489c8b8f748e6d2fb7
      Boot ID: 0047229b30834535b9a87057d59677c7


No suitable data is provided by the boot manager. See:
  http://www.freedesktop.org/wiki/Software/systemd/BootLoaderInterface
  http://www.freedesktop.org/wiki/Specifications/BootLoaderSpec
for details.

## OR ##
...
Secure Boot: disabled
...

[root@srvv001 ~]# sudo mokutil --sb-state
SecureBoot disabled

5 – Verify that the locale is set to en_US.UTF-8.

[root@srvv001 ~]# cat /etc/locale.conf
LANG="en_US.UTF-8"

# If necessary, edit the file to set the locale accordingly.
sudo localectl set-locale LANG=en_US.UTF-8

6 – If your system has network mounted file systems, unmount them and comment out related entries in the /etc/fstab file.

[root@srvv001 ~]# umount /BACKUP

7 – If you installed the yum-plugin-versionlock package, clear any packages with locked versions.

[root@srvv001 ~]# yum versionlock clear

8 – Obtain the latest Oracle Linux 7 packages.

[root@srvv001 ~]# yum update -y
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
No packages marked for update

9 – Restart the server after updates.

[root@srvv001 ~]# sudo reboot

10 – Install the Leapp utility while enabling certain repositories, as follows:

[root@srvv001 ~]# sudo yum install -y leapp --enablerepo=ol7_leapp,ol7_latest

Installed:
  leapp.noarch 0:0.12.1-1.0.1.el7_9

11 – Running the Preupgrade, Edit PermitRootLogin to yes.

[root@srvv001 yum.repos.d]# cat /etc/ssh/sshd_config | grep PermitRootLogin
##PermitRootLogin yes
## the setting of "PermitRootLogin without-password".
 PermitRootLogin yes # <============================

[root@srvv001 yum.repos.d]# systemctl restart sshd
[root@srvv001 leapp answer --section remove_pam_pkcs11_module_check.confirm=True --add

12 – Generating report for analysis and validation before upgrading from Oracle Linux 7 to Oracle Linux 8.

12.1 – Preupgrade check On Premise Sytem

leapp preupgrade --oraclelinux

12.2 – Preupgrade check OCI

leapp preupgrade --oci

12.3 – Preupgrade check Repositories

leapp preupgrade --enablerepo
[root@srvv001 yum.repos.d]# leapp preupgrade --oraclelinux
Transaction Summary
===================================================================================================================
Install    187 Packages
Upgrade    500 Packages
Remove      60 Packages
Downgrade   15 Packages

Total size: 687 M
Total download size: 610 M
Downloading Packages:
Check completed.
==> Processing phase `Reports`
====> * verify_check_results
        Check all dialogs and notify that user needs to make some choices.
====> * verify_check_results
        Check all generated results messages and notify user about them.

============================================================
                     UPGRADE INHIBITED
============================================================

Upgrade has been inhibited due to the following problems:
    1. Inhibitor: Missing required answers in the answer file
Consult the pre-upgrade report for details and possible remediation.

============================================================
                     UPGRADE INHIBITED
============================================================


Debug output written to /var/log/leapp/leapp-preupgrade.log

============================================================
                           REPORT
============================================================

A report has been generated at /var/log/leapp/leapp-report.json
A report has been generated at /var/log/leapp/leapp-report.txt

============================================================
                       END OF REPORT
============================================================

Answerfile has been generated at /var/log/leapp/answerfile

13 – Read the report output files to understand which packages, libraries or applications might be affected or possible issues that should be evaluated before the summer upgrade.

============================================================
                     UPGRADE INHIBITED
============================================================

Upgrade has been inhibited due to the following problems:
    1. Inhibitor: Missing required answers in the answer file
Consult the pre-upgrade report for details and possible remediation.

14 – Apply recommended fixes.

[root@srvv001 leapp]# leapp answer --section remove_pam_pkcs11_module_check.confirm=True --add

15 – Applying the upgrade from Oracle Linux 7 to Oracle Linux 8.

[root@srvv001 yum.repos.d]# leapp upgrade --oraclelinux --verbose

--------------------------------------------------------------------------------
Total                                            33 MB/s | 610 MB     00:18
Running transaction check
Transaction check succeeded.
Running transaction test
The downloaded packages were saved in cache until the next successful transaction.
You can remove cached packages by executing 'dnf clean packages'.

16 – If your session goes down, follow the logs generated in the directory.

[root@srvv001 leapp]# cd /var/log/leapp/
[root@srvv001 leapp]# ls -lat
total 1872
-rw-r--r--.  1 root root  153514 Oct 23 14:53 leapp-report.txt
drwx------.  3 root root     170 Oct 23 14:53 .
-rw-r--r--.  1 root root  160300 Oct 23 14:53 leapp-report.json
-rw-r--r--.  1 root root 1571178 Oct 23 14:53 leapp-upgrade.log
-rw-r--r--.  1 root root      49 Oct 23 14:53 answerfile.userchoices
-rw-r--r--.  1 root root     501 Oct 23 14:53 answerfile
-rw-r--r--.  1 root root    8593 Oct 23 14:51 dnf-plugin-data.txt
drwxr-xr-x.  2 root root      86 Oct 23 14:27 archive

17 – Evaluate and analyze reports after version migration.

============================================================
                       END OF ERRORS
============================================================


Debug output written to /var/log/leapp/leapp-upgrade.log

============================================================
                           REPORT
============================================================

A report has been generated at /var/log/leapp/leapp-report.json
A report has been generated at /var/log/leapp/leapp-report.txt

============================================================
                       END OF REPORT
============================================================

18 – When performing the validation I found the errors below, to solve it I had to remove the sysvinit-tools package.

STDERR:
Warning: Packages marked by Leapp for install not found in repositories metadata: rpcgen
RPM: warning: Generating 6 missing index(es), please wait...
Error: Transaction test error:
  file /usr/sbin/pidof from install of procps-ng-3.3.15-6.0.1.el8.x86_64 conflicts with file from package sysvinit-tools-2.88-14.dsf.el7.x86_64
  file /usr/bin/last from install of util-linux-2.32.1-27.el8.x86_64 conflicts with file from package sysvinit-tools-2.88-14.dsf.el7.x86_64
  file /usr/bin/mesg from install of util-linux-2.32.1-27.el8.x86_64 conflicts with file from package sysvinit-tools-2.88-14.dsf.el7.x86_64
  file /usr/bin/wall from install of util-linux-2.32.1-27.el8.x86_64 conflicts with file from package sysvinit-tools-2.88-14.dsf.el7.x86_64
  file /usr/share/man/man1/last.1.gz from install of util-linux-2.32.1-27.el8.x86_64 conflicts with file from package sysvinit-tools-2.88-14.dsf.el7.x86_64
  file /usr/share/man/man1/mesg.1.gz from install of util-linux-2.32.1-27.el8.x86_64 conflicts with file from package sysvinit-tools-2.88-14.dsf.el7.x86_64
  file /usr/share/man/man1/wall.1.gz from install of util-linux-2.32.1-27.el8.x86_64 conflicts with file from package sysvinit-tools-2.88-14.dsf.el7.x86_64
  

19 – Solution by removing the package.

[root@srvv001 leapp]# yum remove sysvinit-tools*
[root@srvv001 yum.repos.d]# leapp upgrade --oraclelinux --verbose

19 – Restart the server.

[root@srvv001 yum.repos.d]# sudo reboot

20 – Checking the current version of the installed kernel and OS version.

[root@srvv001 ~]# cat /etc/*-release | grep PRETTY
PRETTY_NAME="Oracle Linux Server 8.4"

[root@srvv001 ~]# uname -r
5.4.17-2136.300.7.el8uek.x86_64

21 – Update and upgrade of packages.

[root@srvv001 ~]# dnf update -y
[root@srvv001 ~]# dnf upgrade -y

22 – Links:

https://www.oracle.com/br/linux/
https://docs.oracle.com/en/operating-systems/oracle-linux/8/leapp/chap-leapp-prep.html
https://docs.oracle.com/en/operating-systems/oracle-linux/8/leapp/about-leapp.html#features
https://docs.oracle.com/en/operating-systems/oracle-linux/8/leapp/chap-leapp-upgrade.html#leapp-answerfile
https://docs.oracle.com/en/operating-systems/oracle-linux/8/leapp/about-leapp.html#kernel-support

Categorias Linux

Um comentário em “How to upgrade Oracle Linux 7 to Oracle Linux 8

Deixe um comentário

search previous next tag category expand menu location phone mail time cart zoom edit close