Skip to content

Upgrading the PostgreSQL version for Docker Compose

This guide 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.

List of affected versions

Follow these instructions when upgrading the scanner from version v25.9 and lower to version v25.10 and higher.

Migration

Note

In the instructions, migration is performed using the pg_dump built-in PostgreSQL command. Other upgrade methods are also permitted.

  1. Launch the fuchsiad-database and backend-database services if they are not already running.
  2. Get the username and database name for the backend-database service using the following commands:

    BACKEND_POSTGRES_USER=$(cat .env | grep BACKEND_POSTGRES_USER | cut -c23-)
    BACKEND_POSTGRES_DB=$(cat .env | grep BACKEND_POSTGRES_DB | cut -c21-)
    
  3. Create a backend-database backup.

    docker compose exec backend-database pg_dump -U $BACKEND_POSTGRES_USER -d $BACKEND_POSTGRES_DB > backend_dump.sql
    
  4. Get the username and database name for the fuchsiad-database service using the following commands:

    FUCHSIAD_POSTGRES_USER=$(cat .env | grep FUCHSIAD_POSTGRES_USER | cut -c24-)
    FUCHSIAD_POSTGRES_DB=$(cat .env | grep FUCHSIAD_POSTGRES_DB | cut -c22-)
    
  5. Create a fuchsiad-database backup.

    docker compose exec fuchsiad-database pg_dump -U $FUCHSIAD_POSTGRES_USER -d $FUCHSIAD_POSTGRES_DB > fuchsiad_dump.sql
    
  6. Shut down the Docker Compose service.

    docker compose down
    
  7. Delete the backend-pgdata and fuchsiad-pgdata volumes.

    docker volume rm `basename $(pwd)`_backend-pgdata `basename $(pwd)`_fuchsiad-pgdata
    
  8. Upgrade SolidPoint Compose to the latest version.

  9. Launch the database services.

    docker compose up -d backend-database fuchsiad-database
    
  10. Import the backend-database backup.

    docker compose exec --no-TTY backend-database psql -U $BACKEND_POSTGRES_USER < backend_dump.sql
    
  11. Import the fuchsiad-database backup.

    docker compose exec --no-TTY fuchsiad-database psql -U $FUCHSIAD_POSTGRES_USER < fuchsiad_dump.sql
    
  12. Restart all services.

    docker compose down
    docker compose up -d