uweremer / annotation_pipeline

Sowi Stuttgart CSS Lab Annotation Pipeline
0 stars 1 forks source link

Backup database volumes #1

Open uweremer opened 1 year ago

uweremer commented 1 year ago

PostgreSQL data is located within persistent volume of docker container. Need to iImplement Backup strategy! https://docs.docker.com/storage/volumes/#back-up-a-volume

luerhard commented 1 year ago

The easiest way to extract a backup from a Postgres docker container is via the docker exec command:

docker exec CONTAINER_NAME pg_dump -Fc DBNAME > pg_backup.fc

For recurring backups, this could be just in a cronjob.

Another option would be to use a mounted volume (most easily done with docker-compose) to persist the folder in the host file system. After pausing the container, this folder can just be copied somewhere else.