MySQL 5.7 to MySQL 8 Upgrade

Last modification: August 2026. Version: 109 OUM

Prerequisites

To migrate from MySQL 5.7 to MySQL 8, you must be upgraded to at least Pandora ITSM version 104.

  • Open a terminal window with the root user and enter the following command:
mysql --version

You will get a response similar to the following:

mysql  Ver 14.14 Distrib 5.7.33, for Linux (x86_64) using EditLine wrapper
  • Perform a data backup procedure of the database, hereinafter referred to as <pandora_itsm_db_name>.

Rocky Linux 8/AlmaLinux 8/RHEL 8

  • Stop the Apache web server:
systemctl stop httpd.service

Alternatively:

/etc/init.d/httpd stop
  • Make a special backup of the database that is compatible with MySQL 8:
mysqldump -u root -p <pandora_itsm_db_name> \
  --skip-add-drop-table \
  --complete-insert \
  --no-create-info> backup_pandora_itsm.sql
  • Make a backup as it is done in MySQL 5.7 (additional insurance in case you have to revert to this version):
mysqldump -u root -p <pandora_itsm_db_name> > backup_pandora_itsm_5.7.sql
  • Make a backup of the MySQL configuration file (my.cnf):
cp /etc/my.cnf /tmp/my.cnf.BACK
  • Delete the Percona 5 repositories:
rpm -qa | grep Percona-Server | xargs rpm -e --nodeps
  • Install the Percona 8 repositories:
dnf install https://repo.percona.com/yum/percona-release-latest.noarch.rpm -y
  • Enable the repositories from the previous step:
percona-release setup ps80
  • Install Percona 8:
dnf install percona-server-server
  • Restore the my.cnf file:
mv /tmp/my.cnf.BACK /etc/my.cnf
  • Modify the my.cnf file to dispense with query_cache_*:
sed -i -e "s/^query_cache_type.*/#query_cache_type/g" /etc/my.cnf
sed -i -e "s/^query_cache_size.*/#query_cache_size/g" /etc/my.cnf
sed -i -e "s/^query_cache_min_res_unit.*/#query_cache_min_res_unit/g" /etc/my.cnf
sed -i -e "s/^query_cache_limit.*/#query_cache_limit/g" /etc/my.cnf
  • Start the MySQL service:
systemctl start mysql

or

service mysqld start
  • Verify the installed version with:
mysql --version

You will get a response similar to the following:

mysql  Ver 8.0.28-19 for Linux on x86_64
(Percona Server (GPL), Release 19, Revision 31e88966cd3)

Use MySQL's own command line:

  • Delete the database <pandora_itsm_db_name>.
  • Create a new database <pandora_itsm_db_name>.
  • Open the database <pandora_itsm_db_name> and import the schema found in the PFMS Web Console.
  • Import the data found in the special backup compatible with MySQL 8.
mysql -u root -p <pandora_itsm_db_name>
DROP DATABASE <pandora_itsm_db_name>;
CREATE DATABASE <pandora_itsm_db_name>;
USE <pandora_itsm_db_name>;
SOURCE /var/www/html/pandoraitsm/integria_db.sql;
SOURCE backup_pandora_itsm.sql;
  • The necessary permissions (grants) must be added again; if not connected to mysql as the root user (replace <password> with the corresponding password) run:
mysql -uroot -p <password>
  • Once connected as root execute the following commands:
  • Disable the password validation plugin (optional).
UNINSTALL COMPONENT 'file://component_validate_password';
  • If it does not exist, create the connection user:
CREATE USER "<DBUSER>"@'%' IDENTIFIED BY "<DBPASS>";

If you want to restrict the connection IP address to the database, you must change the % to the IP address of the connection source.

  • Assign the native password for mysql:
ALTER USER "<DBUSER>"@'%' IDENTIFIED WITH mysql_native_password BY "<DBPASS>";
  • Grant the grants on the Pandora ITSM database (<pandora_itsm_db_name>):
GRANT ALL PRIVILEGES ON <pandora_itsm_db_name>.* TO "<DBUSER>"@'%';
  • Save the changes and exit:
FLUSH privileges;
exit

Once the work with the database is finished, perform the following steps:

  • Start the Apache web server:
systemctl start httpd.service

Alternatively:

/etc/init.d/httpd start

←Return to the Pandora ITSM documentation index