Database Backup should support multiple GITLAB_BACKUP_* overrides
Summary
GitLab provides a backup rake task that will take a backup of the database. This task supports multiple database setup.
However, we need to improve supporting overriding the Rails configuration using GITLAB_BACKUP_*
environment variables. This is needed if the application is using for example PgBouncer for the database connections: we want to create backups using direct connection to the primary PostgreSQL instance.
Currently, we do not support overrides per database. So it is not possible to use GITLAB_BACKUP_* overrides to specifiy a second database server for backing up ci
Solution
- We need to support multiple database setup for
GITLAB_BACKUP_*
variables. An proposed implementation, example isGITLAB_BACKUP_PGHOST
but it should work the same for all these variables- if we are on single database setup, we support
GITLAB_BACKUP_PGHOST
butGITLAB_BACKUP_MAIN_PGHOST
will also work - if we are on multiple databases, we support both
GITLAB_BACKUP_PGHOST
andGITLAB_BACKUP_MAIN_PGHOST
- if we are on single database setup, we support
- Update documentation https://docs.gitlab.com/ee/administration/backup_restore/backup_gitlab.html#environment-variable-overrides
Edited by Rutger Wessels