KB Article #190642
Multi API Portal upgrade with single Database
Problem
Environments that have two or more API Portal nodes connected to the same database and have to be upgraded to a newer version will likely fail when upgrading the second node.
This is because both nodes are connected to the same database and upgrading the first node will make schema changes on the database resulting in the second node not functioning with the new schema.
Resolution
Before upgrading any of the nodes:
1.Back up everything - Node 1 and Node 2 file system and the Database
2.Switch off the mysqli_enc driver - edit the `configuration.php` file and change these fields with the following values :
public $dbtype = 'mysqli'; public $password = 'DB_PASSWORD_IN_PLAIN_TEXT'
And save the file (no restart of any service is needed). Should be done for both Node 1 and Node 2.
3.Disable HA mode - clone the Database on another instance (you may use the backup already made) and connect Node 2 to it.
Use the same Database user and Database name. After that you should have Node 1 connected to the original Database and Node 2 connected to cloned Database.
Example: Node 1 > Database_main, Node 2 > Database_main_clone
4.The upgrade can be now executed safely on both nodes.
After that, you should have your 2 nodes upgraded to the same version.
5.Connect Node 2 to the original database instance (the one that Node 1 is currently connected to). This can be done by editing the `configuration.php` file:
6. Enabling mysql encryption on both nodes:
Enable database password encryption - on Node 1, locate the script called `apiportal_db_pass_encryption.sh` and execute it from your upgrade package .
This script will configure the database password encryption and the correct database driver for you :
$ sudo ./apiportal_db_pass_encryption.sh
When prompted for the DB password, give it in plain text. After that you'll be prompted to type and re-type a passphrase .
Repeat step 6 on Node 2. Make sure to use the exact same passphrase on Node 2 when prompted