Upgrading the PostgreSQL version for GNU/Linux¶
This page is an addition to the installation on GNU/Linux instructions and will help you upgrade the PostgreSQL database management system used in the scanner to version 16. This version includes the TimescaleDB extension necessary for correct operation of the service. If your PostgreSQL version matches the required one, you will only need to install the extension, if it is not installed yet.
List of affected versions¶
Follow these instructions when upgrading the scanner from version v25.9 and lower to version v25.10 and higher.
Migration¶
Notes
- In the instructions, migration is performed using the
pg_dumpbuilt-in PostgreSQL command. Other upgrade methods are also permitted. - All commands in the instructions are run by a user with the “administrator” role.
- When installing on Astra Linux, the
pg_dump,dropdb, andpsqlcommands must be executed by a user with the postgres role. For this, use the sudo -u postgres prefix.
-
Assign a directory for storing backups
-
Create a
solidpoint_backenddatabase backup. -
Create a
fuchsiadatabase backup. -
Delete the
solidpoint_backenddatabase. -
Delete the
fuchsiadatabase. -
Upgrade the PostgreSQL version to the required one.
-
Stop the old cluster.
-
Update the packages.
-
Identify the old and new versions of PostgreSQL, as well as the cluster name.
-
Use the
pg_upgradetool. -
Start a new cluster.
-
Delete the old cluster.
-
-
Recreate the deleted databases.
su postgres -c psql > CREATE DATABASE solidpoint_backend; > CREATE USER backend WITH PASSWORD '${POSTGRESQL_PASSWORD}'; > GRANT ALL PRIVILEGES ON DATABASE solidpoint_backend TO backend; > \c solidpoint_backend; > GRANT ALL ON SCHEMA public TO backend; > CREATE DATABASE fuchsia; > CREATE USER fuchsia WITH PASSWORD '${POSTGRESQL_PASSWORD}'; > GRANT ALL PRIVILEGES ON DATABASE fuchsia TO fuchsia; > \c fuchsia; > GRANT ALL ON SCHEMA public TO fuchsia; > quit -
Import the
solidpoint_backendbackup. -
Import the
fuchsiabackup. -
Restart PostgreSQL.
-
Assign a directory for storing backups
-
Create a
solidpoint_backenddatabase backup. -
Create a
fuchsiadatabase backup. -
Delete the
solidpoint_backenddatabase. -
Delete the
fuchsiadatabase. -
Upgrade the PostgreSQL version to the required one.
-
Stop the old cluster.
-
Update the packages.
-
Identify the old and new versions of PostgreSQL, as well as the cluster name.
-
Use the
pg_upgradetool. -
Comment out the unsupported configuration parameters.
-
Start a new cluster.
-
Delete the old cluster.
-
-
Recreate the deleted databases.
su postgres -c psql > CREATE DATABASE solidpoint_backend; > CREATE USER backend WITH PASSWORD '${POSTGRESQL_PASSWORD}'; > GRANT ALL PRIVILEGES ON DATABASE solidpoint_backend TO backend; > \c solidpoint_backend; > GRANT ALL ON SCHEMA public TO backend; > CREATE DATABASE fuchsia; > CREATE USER fuchsia WITH PASSWORD '${POSTGRESQL_PASSWORD}'; > GRANT ALL PRIVILEGES ON DATABASE fuchsia TO fuchsia; > \c fuchsia; > GRANT ALL ON SCHEMA public TO fuchsia; > quit -
Import the
solidpoint_backendbackup. -
Import the
fuchsiabackup. -
When installing on Astra Linux, ensure that the port number in the
/etc/postgresql/16/main/postgresql.conffile is set to5432(if not, set it to5432). -
Restart PostgreSQL.
Known issues¶
Error in the pg_upgradecluster command caused by locales¶
Example:
root@astra:~# pg_upgradecluster 15 main
Upgrading cluster 15/main to 16/main ...
Stopping old cluster...
Restarting old cluster with restricted connections...
Notice: extra pg_ctl/postgres options given, bypassing systemctl for start operation
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = (unset),
LC_ALL = (unset),
LC_ADDRESS = "en_GB.UTF-8",
LC_NAME = "en_GB.UTF-8",
LC_MONETARY = "en_GB.UTF-8",
LC_PAPER = "en_GB.UTF-8",
LC_IDENTIFICATION = "en_GB.UTF-8",
LC_TELEPHONE = "en_GB.UTF-8",
LC_MEASUREMENT = "en_GB.UTF-8",
LC_TIME = "en_GB.UTF-8",
LC_NUMERIC = "en_GB.UTF-8",
LANG = "en_US.UTF-8"
are supported and installed on your system.
perl: warning: Falling back to a fallback locale ("en_US.UTF-8").
Error: The locale requested by the environment is invalid:
LANG: en_US.UTF-8
LC_ADDRESS: en_GB.UTF-8
LC_IDENTIFICATION: en_GB.UTF-8
LC_MEASUREMENT: en_GB.UTF-8
LC_MONETARY: en_GB.UTF-8
LC_NAME: en_GB.UTF-8
LC_NUMERIC: en_GB.UTF-8
LC_PAPER: en_GB.UTF-8
LC_TELEPHONE: en_GB.UTF-8
LC_TIME: en_GB.UTF-8
Error: Could not create target cluster
Solution:
-
Use the following commands:
-
In the opened window, choose
en_GB.UTF-8 UTF-8using the Space key.
Error in the pg_upgradecluster command caused by configuration parameters¶
Example:
Error: /usr/lib/postgresql/16/bin/pg_ctl /usr/lib/postgresql/16/bin/pg_ctl start -D /var/lib/postgresql/16/main -l /var/log/postgresql/postgresql-16-main.log -s -o -c config_file="/etc/postgresql/16/main/postgresql.conf" -c hba_file=/tmp/pg_hba.JThoYx.conf exited with status 1:
2025-09-06 16:07:18.871 GMT [335627] LOG: unrecognized configuration parameter "ac_enable_maclabels_on_files" in file "/etc/postgresql/16/main/postgresql.conf" line 38
2025-09-06 16:07:18.871 GMT [335627] LOG: unrecognized configuration parameter "ac_ignore_maclabel" in file "/etc/postgresql/16/main/postgresql.conf" line 39
Solution:
-
Use the following command:
-
Comment out all parameters starting with
ac_by placing a#before them. - Save the file and exit.
-
Start the cluster
-
Check the cluster status