nordic-institute/X-Road

Feature: Disable local database backups

DaniRamosCR opened this issue · 3 comments

Scenario:

  • X-Road version: 7.4.2-fi
  • Environment: Containerized deployment

The automatic database backup fails due to version mismatch:

**sudo -u xroad /usr/share/xroad/scripts/autobackup_xroad_proxy_configuration.sh**
ENCRYPT_BACKUP=false
GPG_KEYIDS=
CREATING DATABASE DUMP TO /var/lib/xroad/dbdump.dat
pg_dump: error: server version: 16.2; pg_dump version: 12.18 (Ubuntu 12.18-0ubuntu0.20.04.1)
pg_dump: error: aborting because of server version mismatch
Database backup failed! Please check the error messages and fix them before trying again!
Failed to back up the configuration of the X-Road security server

I did workaround it by adding -S in /usr/share/xroad/scripts/autobackup_xroad_proxy_configuration.sh to disable the automatic backup as we use an external database that handles also the snapshots externally, hence these backups are not needed:

#!/bin/bash

ID=$(source /usr/share/xroad/scripts/get_security_server_id.sh)
if [[ -n "${ID}" ]] ; then
  SCRIPT="/usr/share/xroad/scripts/backup_xroad_proxy_configuration.sh"
  FILENAME="/var/lib/xroad/backup/ss-automatic-backup-$(date +%Y_%m_%d_%H%M%S).gpg"
  ${SCRIPT} -s "${ID}" -f "${FILENAME}" **-S**
fi

Problem:

X-Road is running in a container, if restarted for whatever reason, the file content would revert to its original. Potentially a custom image could be created but this is not a feasible option in our case.

Ask:

Could these local database backups be disabled with a feature update that would allow easy disabling?

Hi @DaniRamosCR! The Security Server already supports disabling the automatic backups. The instructions are available here. However, disabling the automatic backups disables them completely, not only for the database. Unfortunately, disabling only the database backup is not supported.

Hey @petkivim!
Understood - We had read that through but we were hoping there could be a more convenient functionality for that in the future.
Thanks a lot!

Hi @DaniRamosCR! You're welcome! If you would like to see support for more fine grained configuration options of automatic backups in the future, feel free to submit an enhancement request.