Closed finevine closed 2 years ago
From this repositories introduction text: This is not a tool that can clone and backup data from running databases. You should always stop all containers running on your data before doing backups. Always make sure you're not a victim of unexpected data corruption.
What your setup does not do:
What your setup will not do even following the manual:
You can stop the database and make a backup of it: Look for postgres specific advice on what folder to backup.
You can command postgres to dump the running database and then backup the dump: Go to postgres manuals on how to achieve this.
Thank you so much @blacklabelops ! I've added a cron service to my docker compose
myprojectpreprodcron:
build:
context: ../../
dockerfile: Docker/Dockerfiles/Dockerfile.cron
container_name: myprojectPreProdCron
networks:
- intern
volumes:
- myprojectpreproddb:/var/lib/postgresql/data
- '../../db_backup:/db_backup'
labels:
- traefik.enable=false
depends_on:
- myprojectpreproddb
The cron task makes a pgdump of my running DB each day. This db_backup
volume is added to my volumerize source!
Cheers
Hello, I have manage to backup a media folder and /var/lib/postgresql/data With this docker command, I manage to restore correctly the media folder locally. But I'm in trouble populating my postgres DATABASE_URL
Restore command
Here is the command that I use and that restore correctly the
media
file:Then I connect to the container running postgresql and run
connect myproject -u vft
but:My question: How to restore correctly a psql named volume?
Backup dockercompose
Here is the end of my docker-compose file: