Add manual DB backup instructions
continuous-integration/drone/push Build is passing Details

This commit is contained in:
3wc 2022-11-30 08:31:28 -08:00
parent 18d1d6a108
commit e630ebc035
1 changed files with 23 additions and 0 deletions

View File

@ -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 <database> | gzip > ~/.abra/backups/foo.bar.com_db_`date +%F`.sql.gz
```
Postgres:
```
abra app run foo.bar.com db pg_dump -u root <database> | 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)" <database>' | gzip > ~/.abra/backups/foo.bar.com_db_`date +%F`.sql.gz
```