From 4cadae6cb25a22c7f36037043c8db77236c845a7 Mon Sep 17 00:00:00 2001 From: ippocratis <52239579+ippocratis@users.noreply.github.com> Date: Wed, 18 Jan 2023 00:24:47 +0200 Subject: [PATCH] added backup/restore to apps/photos/libre-photos Added backup and restore guide --- apps/photos/libre-photos.md | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/apps/photos/libre-photos.md b/apps/photos/libre-photos.md index 21dd8b6..7414203 100644 --- a/apps/photos/libre-photos.md +++ b/apps/photos/libre-photos.md @@ -143,3 +143,30 @@ services: container_name: librephotos-redis restart: unless-stopped ``` +## Librephotos backuo/restore + +Docker offers volumes so /data and /code/protected_media are safely mounted on host. Simply rsync backup of these dirs + +posstgres db backup + +Usefull to avoid a full scan + +`docker ps` + +Grab postgres container id e.g.40b12de38945 + +Backup + +`docker exec -t your-db-container pg_dumpall -c -U your-db-user > dump_$(date +%Y-%m-%d_%H_%M_%S).sql` + +A file like dump_20-11-2022_00_55_26.sql is created + +Restore + +`cat your_dump.sql | docker exec -i your-db-container psql -U your-db-user -d your-db-name` + +*Note the -U dbuser (default is docker for librephotos) +and the -d bdname (default librephotos for librephotos) + +Put that on a crontab +And there you go you have periodic db snapshots