Introduction
This document provides the steps for performing an in-place upgrade from RHEL 7.x to RHEL 8.x.
Pre-Requisites
- A system running RHEL 7.x.
- Administrator access.
- Internet connection.
Step 1: Create a Backup(Mandatory)
Before migrating any system, the best practice is to create backups and snapshots of the system
Take snapshot of your RHEL7 server
Take a Snapshot of your RHEL7 machine before performing the in-place upgradation
Backup your DB
Command to switch to postgres user:
su - postgres
Postgres command for taking the intigua database backup :
pg_dump intiguadb > dbbackup.sql;
Exit from Postgres
exit
Backup postgres Configuration Files:
mkdir <backup_path>/config
cp /var/lib/pgsql/<version>/data/pg_hba.conf <backup_path>/config
cp /var/lib/pgsql/<version>/data/postgresql.conf <backup_path>/config
Backup the Application configuration files
Backup the following directories:
- /usr/share/tomcat/default/conf/*
- /usr/share/intigua/*
Navigate to the tomcat configuration directory
cd /usr/share/tomcat/default/conf/
Command for taking tomcat configuration backup :
tar -czvf /root/tomcat_backup.tar.gz *
Navigate to the Intigua directory
cd /usr/share/intigua/
Command for taking Intigua connector backup :
tar -czvf /root/intigua_backup.tar.gz *
Copy all the backup files to the backup server using preferred method
Example
scp /var/lib/pgsql /dbbackup.sql root@newserver_ip:/var/lib/pgsql
scp /root/tomcat_backup.tar.gz root@newserver_ip:/root/
scp /root/intigua_backup.tar.gz root@newserver_ip:/root/
Step 2: Install Migration Packages
1.Enable the Leapp repository:
sudo subscription-manager repos --enable rhel-7-server-extras-rpms
2. Install the Leapp utility:
sudo yum install leapp leapp-repository
Step 3: Pre-Upgrade Assessment
Note:You can use target upgrade version 8.10 OR 8.8
Before proceeding with the upgrade, perform a pre-upgrade assessment to identify potential issues.
sudo leapp preupgrade --target=8.10
Pre-upgrade will take some time. When completed, it will generate files in the /var/log/leapp/ directory that contain all potential upgrade issues and how to fix them. The below files contain important information:
- answer file - Contains questions that require a true or false answer to proceed with the upgrade.
- leapp-report.txt - Contains all possible problems and fixes to perform before or after the upgrade.
- leapp-preupgrade.log - The complete pre-upgrade log and debug output.
The upgrade will be inhibited the first time due to the following problem.
Inhibitor: Missing required answers in the answer file
Check the pre-upgrade report for details and possible remediation.
Check the first two files and perform all required pre-upgrade actions. Some common pre-upgrade fixes when migrating from RHEL 7 are:
Implement solution 1 and solution 2 one after another.
Solution 1:
Leapp preupgrade getting "Inhibitor: Detected loaded kernel drivers which have been removed in RHEL 8. Upgrades cannot proceed." : https://access.redhat.com/solutions/6971716
Support for these device drivers has been removed in RHEL 8. Remove these drivers before proceeding with the upgrade:
sudo rmmod floppy pata_acpi
Solution 2:
Leapp upgrade fails with error "Inhibitor: Detected loaded kernel drivers which have been removed in RHEL 8. Upgrade cannot proceed.": https://access.redhat.com/solutions/5436131
1.Backup the initramfs being currently used for booting
cp /boot/initramfs-$(uname -r).img /boot/initramfs-$(uname -r).img.backup
2.Build a generic initramfs containing all drivers
dracut -N -f
3.Stop the system
shutdown
4.On the VMWare Hypervisor side, change the SCSI Controller type
Change to "VMware Paravirtual". A warning is displayed. Click on "Change Type".
5.Boot the system and once booted run following,
dracut -f --regenerate-all
Diagnostic Steps
After two solutions have been given ,check whether floppy and pata_acpi drivers modules are removed or not .
Verify the leapp report file /var/log/leapp/leapp-report.txt and check the risk factor message:
Risk Factor: high (inhibitor) Title: Detected loaded kernel drivers which have been removed in RHEL 8. Upgrade cannot proceed. Summary: Support for the following RHEL 7 device drivers has been removed in RHEL 8: - floppy - pata_acpi
And check that the module is really not in use:
lsmod | grep floppy
floppy 69432 0
lsmod | grep pata_acpi
pata_acpi 13053 0
If still floppy and pata_acpi module drivers are not removed, execute the command in solution 1 again
Confirming the removal of the PAM PKCS#11 module:
sudo leapp answer --section remove_pam_pkcs11_module_check.confirm=True
The command updates the answer file, confirming the removal.
Address all fixes and rerun the pre-upgrade command to confirm everything is fixed:
sudo leapp preupgrade --target=8.10
The system is ready for upgrade when the "Upgrade Inhibited" message disappears.Ensure that 0 Errors and 0 Inhibitors in Reports summary
Step 4: Run Upgrade
When no more suggested actions exist, the system is ready to upgrade. Proceed with the OS upgrade steps below:
1. Run the Leapp upgrade command:
sudo leapp upgrade --target=8.10
Wait for the upgrade to complete. If the upgrade fails, return to the previous step and address any issues missed in the pre-upgrade check.
2. When the process completes successfully, reboot the machine:
reboot
3. The GRUB menu shows a new entry called ELevate-Upgrade-Initramfs.
After a few seconds, the system automatically boots into this selection and continues the upgrade process.
4. The system restarts twice more after the upgrades. When the restarts are complete, the GRUB menu shows the Redhat Linux entries.
The entries indicate a successful upgrade from Redhat 7 to Redhat 8. The system automatically boots into the upgraded version.
Step 5: Post-Upgrade Steps
1.Validate the upgradation
1.After the reboot you can login to the server using same username and password
2.Check the OS details using the command
cat /etc/os-release
3.Check the redhat linux version using the command
cat /etc/redhat-release
The output above shows that your RHEL 7.x has been successfully upgraded to RHEL 8.10
3.Remove the Previous Postgresql Data folder
sudo rm -rf /var/lib/pgsql/<version>/*
4.Install the Postgresql for Redhat linux
4.1 Install the repository RPM:
sudo dnf install -y https://download.postgresql.org/pub/repos/yum/reporpms/EL-8-x86_64/pgdg-redhat-repo-latest.noarch.rpm --nogpgcheck
4.2 Disable the built-in PostgreSQL module
sudo dnf -qy module disable postgresql --nogpgcheck
4.3 Install PostgreSQL:
sudo dnf install -y postgresql<version>-server --nogpgcheck
4.4 Initialize the database and enable automatic start:
sudo /usr/pgsql-<version>/bin/postgresql-<version>-setup initdb
sudo systemctl enable postgresql-<version>
sudo systemctl start postgresql-<version>
5.Create intiguadb ,intigua user and granting all privileges in postgresql
Switch to postgres user
su - postgres
psql
create database intiguadb;
create user intigua with password '<db_password_in_intigua.properties>';
grant all privileges on database intiguadb to intigua;
exit
6.Restore the postgresql backup
psql -d intiguadb -f dbbackup.sql
Note:Please ensure that the database backup restoration command executes without any errors.
7.Grant Schema Level permissions on public schema in intiguadb for intigua user
After restoring the backup, to avoid permission error on public schema in intiguadb for intigua user
Grant below permissions to the intigua user
Connect to PostgreSQL:
psql -U postgres -d intiguadb
Granting Schema-Level Permissions
GRANT USAGE ON SCHEMA public TO intigua;
GRANT CREATE ON SCHEMA public TO intigua;
GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA public TO intigua;
GRANT ALL PRIVILEGES ON ALL SEQUENCES IN SCHEMA public TO intigua;
GRANT ALL PRIVILEGES ON ALL FUNCTIONS IN SCHEMA public TO intigua;
Exit from intiguadb and postgres user
exit
8.Restore The postgres Configuration Files
sudo cp -f ./config/pg_hba.conf /var/lib/pgsql/<version>/data/
sudo cp -f ./config/postgresql.conf /var/lib/pgsql/<version>/data/
9 validate the Intigua RPMs
rpm -qa | grep intigua
10. Restart the PostgreSQL service and tomcat service
systemctl restart postgresql-<version>.service
systemctl restart tomcat
Existing users and plans are restored now . You can now log in to the jetpatch manager using the same credentials.
Comments
0 comments
Please sign in to leave a comment.