Use docker exec to create database backups#29
Use docker exec to create database backups#29jannikw wants to merge 3 commits intoZettaIO:masterfrom
Conversation
|
This sounds great and would solve the pg_dump version mismatch issue for modern Postgres versions. Why has this not been merged or implemented yet? The pg_dump bundled in the 0.7.1 release from January 2024 only supports Postgres up to version 11, which is quite outdated for most modern setups running Postgres 12 and above. The appeal of restic-compose-backup is that it is a fully automated backup solution. Also, the readme does not state any limitations around Postgres dbs and I only found out about this after spending quite some time integrating it into my stacks. Or is this repo not in active development anymore? |
|
Hi @herrschmidt, this repo seems to be no longer maintained. I maintain a fork of this project called stack-back if you want to give that a try. I've fixed multiple bugs and added a few enhancements. You can review the release notes in my fork for details. |
|
I have not implemented this functionality in my fork yet, but I can look into it. It would simplify some of the code that has to do with network management of the backup runner as well. |
|
@lawndoc Thank you so much for reaching out! When I read your release notes correctly, your fork contains pg_dump v17. I think this solves my problem 🥳. |
|
The contents of this PR were used in lawndoc/stack-back#72 over in my fork. stack-back now uses docker exec for container backups and has removed all code having to do with docker networks. |
This is an alternative implementation for doing database backups using the docker exec functionalities. Database pings to check for availability and database dumps are done by executing the respective programs inside the database containers.
For the database dumps, the low level docker api has to be used, because it otherwise not possible to retrieve an exit code and use streaming of the commands output to stdout and stderr.
I tested this with the provided
docker-compose.ymland with the database containers running in different projects and therefore belonging to different networks.Fixes #28