Brief Upgrade Guide
This section describes a basic scenario for upgrading QHB using the qhb_upgrade utility. For more information, see its help page.
If your server is already stopped, you can skip the first step.
To stop the database server, type:
qhb_ctl -D $PGDATA stop
or, if it was started via the service:
sudo systemctl stop qhb
Note
The configuration and data files used by the DBMS are typically stored in a single directory, called PGDATA (similar to the environment variable name). In our examples, we will use /opt/qhb/data.old as the path to the old database cluster data directory, and /opt/qhb/data as the path to the new database cluster data directory. The /usr/local/qhb.old/bin directory is where the executable files of the old QHB version are stored, and the /usr/local/qhb/bin directory is where the executable files of the new QHB version are stored.
Relocate the old cluster:
sudo mv /opt/qhb/data /opt/qhb/data.old
Relocate the current QHB installation directory so that it does not interfere with the new QHB installation:
sudo mv /usr/local/qhb /usr/local/qhb.old
Install new QHB packages using the command from user with superuser privileges:
yum [ install | upgrade ] <path to the package directory/package names>
Note
Depending on the OS, the installation command may vary. If you are installing packages from the QHB repository, you can use Step-by-Step Guides for Initial Download, Installation and Launch.
Again create a folder for the database:
sudo mkdir -p /opt/qhb/data
Allow user qhb to access it:
sudo chown -R qhb /opt/qhb/data
Then, it is recommended to switch to the qhb user and execute the
commands as it. Otherwise, you must use sudo -u qhb for all subsequent commands
if you are working as a user with sudo privileges.
Initialize the database cluster using the command:
qhb_bootstrap -D /opt/qhb/data
Upgrade QHB using the qhb_upgrade utility:
qhb_upgrade \
--old-bindir=/usr/local/qhb.old/bin/ \
--new-bindir=/usr/local/qhb/bin/ \
--old-datadir=/opt/qhb/data.old \
--new-datadir=/opt/qhb/data --verbose
Note
If the update fails, you must ensure that the user qhb has access permissions to all specified directories.
Also, the user qhb must have write permissions in the directory from which theqhb_upgradecommand is run.
Expected result:
Upgrade Complete
To start the database server, type:
qhb_ctl -D /opt/qhb/data start
or
sudo systemctl start qhb