Product Version: 10.6
Last Modified: 16 March 2022
Problem
The old version of PostgreSQL database does not work with NAKIVO Backup & Replication installed on NAS devices.
Background
The older version of the PostgreSQL database must be upgraded to work with NAKIVO Backup & Replication installed on NAS devices. Note that this is only applicable to 64-bit ARM CPU-based NAS devices.
Solution
To perform the upgrade, do the following:
Notes
- The upgrade process requires the same amount of free space as the SaaS repository size, located on the NAS.
- The provided examples are for Synology NAS.
Copy the old version of PostgreSQL (postgresql-arm-x64-10.15-1.gz) to the java folder on NAS. Please contact support to get this package. Example: /volume1/@appstore/NBR/transporter/java.
Extract and rename the directory into psql.old.
Create a new database cluster (using the new version of initdb). Example of the command:
mkdir /volume1/path_saas/NakivoBackup.new chown -R u_bhsvc:g_bhsvc /volume1/path_saas/NakivoBackup.new cd /tmp sudo -su u_bhsvc /volume1/@appstore/NBR/transporter/java/pgsql/bin/initdb -D /volume1/path_saas/NakivoBackup.new -U bhsvc -E UTF8 -A trust --locale=C
Shut down the postmaster servicing the old cluster. Example of the command:
cd /tmp sudo -su u_bhsvc /volume1/@appstore/NBR/transporter/java/pgsql.old/bin/pg_ctl -D /volume1/path_saas/NakivoBackup stop
Shut down the postmaster servicing the new cluster. Example of the command:
cd /tmp sudo -su u_bhsvc /volume1/@appstore/NBR/transporter/java/pgsql/bin/pg_ctl -D /volume1/path_saas/NakivoBackup.new stop
Run pg_upgrade:
pg_upgrade -d oldCluster/data -D newCluster/data -b oldCluster/bin -B newCluster/bin
Example of the command:
cd /tmp sudo -su u_bhsvc /volume1/@appstore/NBR/transporter/java/pgsql/bin/pg_upgrade -d /volume1/path_saas/NakivoBackup -D /volume1/path_saas/NakivoBackup.new -b /volume1/@appstore/NBR/transporter/java/pgsql.old/bin -B /volume1/@appstore/NBR/transporter/java/pgsql/bin -U bhsvc
Start the new server and generate optimizer statistics. Example of the command:
cd /tmp sudo -su u_bhsvc /volume1/@appstore/NBR/transporter/java/pgsql/bin/pg_ctl -D /volume1/path_saas/NakivoBackup.new -o "-p5432" start /volume1/@appstore/NBR/transporter/java/pgsql/bin/vacuumdb -U bhsvc --all --analyze-in-stages -p 5432 sudo -su u_bhsvc /volume1/@appstore/NBR/transporter/java/pgsql/bin/pg_ctl -D /volume1/path_saas/NakivoBackup.new stop
Run the following script to delete the old cluster's data files::
./delete_old_cluster.sh
Rename new NakivoBackup into the old name:
mv /volume1/path_saas/NakivoBackup.new /volume1/path_saas/NakivoBackup