Upgrading to MySQL v8

From AgileApps Support Wiki
Revision as of 08:33, 10 November 2023 by Wikidevuser (talk | contribs) (Created page with "==Pre-requisites== Follow the below steps to upgrade from MySQL v5.7 to MySQL v8: 1. Ensure that you are using the AgileApps version 10.16.x. If you use any lower version, upg...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Pre-requisites

Follow the below steps to upgrade from MySQL v5.7 to MySQL v8: 1. Ensure that you are using the AgileApps version 10.16.x. If you use any lower version, upgrade the AgileApps version to 10.16.x version using:

Notepad.png

Note: After upgrade, ensure that "set scrollTolerantForwardOnly" flag is true in the "com.softwareag.catalina.resource.pid-agileappsRN.properties"and "com.softwareag.catalina.resource.pid-agileappsRN.properties" files at "$INSTALL_DIR\profiles\IS_{instance_name}\configuration\com.softwareag.platform.config.propsloader" folder.

2. Validate that the applications are working fine.
3. Perform the following checks in the MySQL utilities

-$ mysqlcheck -u root -pLongjump@123 --all-databases --check-upgrade
→ db1000.INTEGRATION_CONNECTOR_LICENSE_USER_ACTION   OK
→ db1000.INTEGRATION_STAGES                          OK

4. -$ mysqlsh root@localhost:3306 -e "util.checkForServerUpgrade();" The MySQL server at localhost:3306, version 5.7.43 - Check the MySQL Community Server (GPL) for compatibility issues for upgrading to MySQL 8.0.34

5. The following needs to be verified and changed before the MySQL 8.x upgrade.
show GLOBAL variables like '%character_set%'
6. Check if backup is taken for all the databases, otherwise take a backup of the data directory using a backup or export utility such as mysqldump.
7. Check whether mysqlsh is installed with below command
$ mysqlsh --version 8. If output is similar to below
-bash: mysqlsh: command not found

Then, perform the manual installation. $ yum install libyaml -y $ wget https://dev.mysql.com/get/Downloads/MySQL-Shell/mysql-shell-8.0.34-1.el7.x86_64.rpm $ rpm -ivh mysql-shell-8.0.34-1.el7.x86_64.rpm

MySQL upgrade approaches

Approach Downtime Cost Supports lower case table names Suitable for large DBS Suitable for large number of tenants in single MySQL instance Possibility of Tenant wise upgrade
In-place upgrade High Low No No Yes No
Data Export/Import High High Yes No No Yes
Replica Low High Yes Yes Yes No

Notepad.png

Note:

  • The chosen approach for production should be tested in all lower environments, and lower environments should be upgraded the same way as production.
  • The tenant-wise migration may take longer but is a safer approach, limiting the risk of upgrade issues to a particular set of tenants.

In-place upgrade to MySQL v8

1. 1) Download and install mysql 8.

$ rpm -Uvh https://repo.mysql.com/mysql80-community-release-el7-3.noarch.rpm
$ sed -i 's/enabled=1/enabled=0/' /etc/yum.repos.d/mysql-community.repo
$ yum --enablerepo=mysql80-community install mysql-community-server -y