From e630ebc035a2065adaf63589a6c95753cc41afbc Mon Sep 17 00:00:00 2001 From: 3wc <3wc@doesthisthing.work> Date: Wed, 30 Nov 2022 08:31:28 -0800 Subject: [PATCH] Add manual DB backup instructions --- docs/operators/handbook.md | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/docs/operators/handbook.md b/docs/operators/handbook.md index 03cbbb5..d5d3756 100644 --- a/docs/operators/handbook.md +++ b/docs/operators/handbook.md @@ -331,3 +331,26 @@ If you're app [supports backup/restore](/handbook/#how-do-i-configure-backuprest With `abra`, you can simply run `abra app backup ...` & `abra app restore ...`. Pass `-h` for more information on the specific flags & arguments. + +## How do I take a manual database backup? + +MySQL / MariaDB: + +``` +abra app run foo.bar.com db mysqldump -u root | gzip > ~/.abra/backups/foo.bar.com_db_`date +%F`.sql.gz +``` + +Postgres: + +``` +abra app run foo.bar.com db pg_dump -u root | gzip > ~/.abra/backups/foo.bar.com_db_`date +%F`.sql.gz +``` + +If you get errors about database access: +- Make sure you've specified the right database user (`root` above) and db name +- If you have a database password set, you might need to load it from a secret, + something like this: + +``` +abra app run foo.bar.com db bash -c 'mysqldump -u root -p"$(cat /run/secrets/db_oot_password)" ' | gzip > ~/.abra/backups/foo.bar.com_db_`date +%F`.sql.gz +```