Update backup.md

updated with functional code
This commit is contained in:
nough 2022-07-07 10:16:52 +01:00 committed by GitHub
parent 0697116a21
commit 9d38186404
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -35,12 +35,13 @@ You can back up from docker even when the tandoor container is failing, so long
To back up:
```
Sudo docker exec -t db_recipes -c -U djangouser
sudo docker exec -t docer_db_recipes_1 pg_dumpall -U djangouser > pgdump.sql
```
To restore:
```
Cat dump.sql | docker exec -i psql postgres -U djangouser
cat pgdump.sql | docker exec -i psql postgres -U djangouser
```
This connects to the postgres table instead of the actual dgangodb table, as the import function needs to delete the table, which can't be dropped off you're connected to it.