Database

This page is about the configuration and maintenance of the PostgreSQL database that xltrail uses.

NOTE: Always back up your data before doing any database maintenance.

Container-based installation (default)

Both installation types (Docker and Kubernetes), will install a container-based version of PostgreSQL by default. The data is stored under

  • Docker (bind mount): <DATA_DIR>/postgres (the default value for <DATA_DIR> is /var/lib/xltrail)
  • Kubernetes (PVC): xt-db-volume-xt-db-0

External database

For production, you may prefer to host your own installation of PostgreSQL by adjusting the configuration accordingly:

Docker installation: Upgrade PostgreSQL version

If you use the PostgreSQL container with Docker, the version will be pinned in the xltrail.conf file, under the key POSTGRES_VERSION.

  • If you'd like to upgrade your database version to a new minor version, e.g., from 16.0 to 16.1, you can edit the xltrail.conf file directly and simply restart the app via xltrail restart.

  • If you'd like to upgrade to a new major version, e.g., from 15.3 to 16.1, you have to upgrade the database as follows:

    1. While xltrail is running with the old version of PostgreSQL, run the following commands:

      xltrail backupdb
      xltrail stop
      
    2. Change POSTGRES_VERSION in xltrail.conf (if it doesn't exist, add it in a new line), e.g.:

      POSTGRES_VERSION=16.0
      
    3. Now upgrade the database like so:

      xltrail restoredb
      

    After a successful database upgrade, start xltrail again via xltrail start.

NOTE: Offline ("air-gapped") installations

The air-gapped bundles come with a specific version of PostgreSQL. Whenever you upgrade an xltrail installation via air-gapped bundle, you should run xltrail backupdb before upgrading your xltrail installation so you can upgrade the database if required.

results matching ""

    No results matching ""