Introduction
This document provides the steps for performing an in-place upgrade from CentOS 7.x to RockyLinux 8.x and ensures JetPatch still runs after OS upgrade.
Pre-Requisites
- A system running CentOS 7.x.
- Administrator access.
- Internet connection.
The following sections demonstrate CentOS 7.x to Rocky Linux 8.x migration using the ELevate project and the Leapp framework. The two projects support migration between different RHEL-based distributions.
This article contains the following topics:
- Step 1: Create a Backup
- Step 2: Install Migration Packages
- Step 3: Disable PostgreSQL Repository and Stop PostgreSQL Service
- Step 4: Run Pre-Upgrade Checks
- Step 5: Run Upgrade
- Step 6: Post-Upgrade Steps
Step 1: Create a Backup
1.1 Take the snapshot of your centos server
Before migrating any system, the best practice is to create backups and snapshots of the system.
Take a Snapshot of your centos machine before performing the in-place upgradation
1.2 Backup system Configuration Files (Optional):
Note : If snapshot is taken you can skip System configuration files backup
sudo tar -czvf config_backup.tar.gz /etc /var /opt /usr/local
1.3 Backup your DB
su - postgres
pg_dump intiguadb > dbbackup.sql;
Exit from Postgres
exit
1.4 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
1.5 Backup Installed Packages List:
rpm -qa > installed_packages.txt
1.6 Backup the Application configuration files (Optional)
Note : If snapshot is taken you can skip System configuration files backup
Backup the following directories:
- /usr/share/tomcat/default/conf/*
- /usr/share/intigua/*
cd /usr/share/tomcat/default/conf/
tar -czvf /root/tomcat_backup.tar.gz *
cd /usr/share/intigua/
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. Install the elevate-release package from the repository for the latest version
sudo yum install -y http://repo.almalinux.org/elevate/elevate-release-latest-el$(rpm --eval %rhel).noarch.rpm
2. Install the Leapp migration data packages for RockeyLinux and the upgrade utility with the following:
sudo yum install -y leapp-upgrade leapp-data-rocky
Step 3: Disable PostgreSQL Repository and Stop PostgreSQL Service
sudo sed -i -e '/\[pgdg-common\]/,/\[.*\]/{s/enabled=1/enabled=0/}' -e '/\[pgdg15\]/,/\[.*\]/{s/enabled=1/enabled=0/}' -e '/\[pgdg14\]/,/\[.*\]/{s/enabled=1/enabled=0/}' -e '/\[pgdg13\]/,/\[.*\]/{s/enabled=1/enabled=0/}' -e '/\[pgdg12\]/,/\[.*\]/{s/enabled=1/enabled=0/}' /etc/yum.repos.d/pgdg-redhat-all.repo
systemctl stop postgresql-<version>.service
Step 4: Run Pre-Upgrade Checks
Run a pre-upgrade to do a system check before upgrading
sudo leapp preupgrade
Usually you will get java packages conflict error like below
Check the list of java packages installed in the system using the below command
rpm -qa | grep javapackages-tools*
Remove javapackages-tools listed using below command
sudo rpm -e --nodeps <javapackages-tools-name-from-list>
Run a pre-upgrade again before upgrading
sudo leapp preupgrade
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 CentOS 7 are:
1. Removing the pata_acpi kernel module:
sudo rmmod pata_acpi
2. Updating the SSH config file to permit root login:
echo PermitRootLogin yes | sudo tee -a /etc/ssh/sshd_config
3. 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
The system is ready for upgrade when the "Upgrade Inhibited" message disappears.
Step 5: 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
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 Rocky Linux entries.
The entries indicate a successful upgrade from CentOS 7 to Rocky Linux 8. The system automatically boots into the upgraded version.
Step 6: Post-Upgrade
6.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 rocky linux version using the command
cat /etc/rocky-release
The output above shows that your CentOS 7.x has been successfully upgraded to RockyLinux 8.10
4.Install the javapackages-tools
sudo yum install javapackages-tools
6.2.Use baseurl Instead of mirrorlist in Rocky Linux repositories:
The mirrorlist URL for Rocky Linux is not working currently , so you can use baseurl by running the below command
Rocky-AppStream.repo
sudo sed -i -e 's/^mirrorlist/#mirrorlist/' -e 's/^#baseurl/baseurl/' /etc/yum.repos.d/Rocky-AppStream.repo
Rocky-BaseOS.repo
sudo sed -i -e 's/^mirrorlist/#mirrorlist/' -e 's/^#baseurl/baseurl/' /etc/yum.repos.d/Rocky-BaseOS.repo
Rocky-Extras.repo
sudo sed -i -e 's/^mirrorlist/#mirrorlist/' -e 's/^#baseurl/baseurl/' /etc/yum.repos.d/Rocky-Extras.repo
6.3.Remove the Existing Postgresql Data folder
sudo rm -rf /var/lib/pgsql/<version>/*
6.4.Install the Postgresql for Rocky linux
6.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
6.4.2 Disable the built-in PostgreSQL module
sudo dnf -qy module disable postgresql
6.4.3 Change the gpgkey file name in pgdg-redhat-all.repo using the following command
sudo sed -i 's/RHEL7/RHEL/' /etc/yum.repos.d/pgdg-redhat-all.repo
6.4.4 Enable PostgreSQL Repository
sudo sed -i -e '/\[pgdg-common\]/,/\[.*\]/{s/enabled=0/enabled=1/}' -e '/\[pgdg15\]/,/\[.*\]/{s/enabled=0/enabled=1/}' -e '/\[pgdg14\]/,/\[.*\]/{s/enabled=0/enabled=1/}' -e '/\[pgdg13\]/,/\[.*\]/{s/enabled=0/enabled=1/}' -e '/\[pgdg12\]/,/\[.*\]/{s/enabled=0/enabled=1/}' /etc/yum.repos.d/pgdg-redhat-all.repo
6.4.5 Install PostgreSQL:
sudo dnf install -y postgresql<version>-server
6.4.6 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>
6.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.6.Restore the postgresql backup
psql -d intiguadb -f dbbackup.sql
Note: Please ensure that the database backup restoration command executes without any errors.
6.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
exit
6.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/
6.9 validate the Intigua RPMs
rpm -qa | grep intigua
6.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.