Update backup_and_restore.md (#242)

This commit is contained in:
Shadow 2023-07-03 01:46:24 -07:00 committed by GitHub
parent 892abc1ef5
commit 825985e59c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -4,9 +4,9 @@
When using docker or ansible, there should be a `volumes` folder, which contains both the database, and all the pictures. Copy this folder to the new instance to restore your data. When using docker or ansible, there should be a `volumes` folder, which contains both the database, and all the pictures. Copy this folder to the new instance to restore your data.
### Incremental Database backup ### Full Database backup
To incrementally backup the DB to an `.sql.gz` file, you can run: To take a complete backup of the DB to a `.sql.gz` file, you can run:
```bash ```bash
docker-compose exec postgres pg_dumpall -c -U lemmy | gzip > lemmy_dump_`date +%Y-%m-%d"_"%H_%M_%S`.sql.gz docker-compose exec postgres pg_dumpall -c -U lemmy | gzip > lemmy_dump_`date +%Y-%m-%d"_"%H_%M_%S`.sql.gz