From 2c634ae1afad40f2a5ea9ddf0cafd728efccc649 Mon Sep 17 00:00:00 2001 From: kolaente Date: Thu, 15 Oct 2026 17:50:24 +0200 Subject: [PATCH] docs: add restore instructions --- README.md | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/README.md b/README.md index 735d419..b35552b 100644 --- a/README.md +++ b/README.md @@ -81,6 +81,31 @@ You can use this with other tools to monitor if backups are completed as they sh If set provided and set to `true`, all backups will be compressed using gzip. +## Restoring + +Backups are plain SQL files at `//.sql` (`.sql.gz` if compressed). +Pipe them into the database container. If compressed, use `gunzip -c |` instead of `< `. + +### Postgres + +Backups are made with `pg_dumpall` and contain all databases and roles. Restore into a fresh, empty container: + +``` +docker exec -i psql -U -d postgres < backups//.sql +``` + +An error that the `POSTGRES_USER` role already exists is expected and harmless. + +### MySQL / MariaDB + +If `MYSQL_DATABASE` is set on the container, only that database is dumped and you need to pass its name: + +``` +docker exec -i mysql -u -p < backups//.sql +``` + +Otherwise all databases are dumped; omit ``. On MariaDB 11+ images, use `mariadb` instead of `mysql`. + ## Building from source This project uses go modules, so you'll need at least go 1.11 to compile it.