... | ... | @@ -8,6 +8,7 @@ This page will tell you the short and to the point stuff you need to know about |
|
|
- [4. Backup restore](#4-backup-restore)
|
|
|
- [4.1. Daily backup](#41-daily-backup)
|
|
|
- [4.2. Restore](#42-restore)
|
|
|
- [4.3. Restore only BLOBs/Binary Large Object/Files in the database](#43-restore-only-blobsbinary-large-objectfiles-in-the-database)
|
|
|
- [5. Test locally using official (productional) backup](#5-test-locally-using-official-productional-backup)
|
|
|
|
|
|
|
... | ... | @@ -196,6 +197,17 @@ docker exec -t wyatt_${TARGET_ENV}_db pg_restore --verbose --create -Fc -U postg |
|
|
|
|
|
Afterwards you can safely start the application again. All should work now on the target environment but with a restored DB from that environment and that date.
|
|
|
|
|
|
> **Note**: the best most up to date scripts regarding this are now in our [scripts repo](https://gitlab.xlrit.com/xlrit/gears/scripts). Please check them out if you want to learn
|
|
|
|
|
|
## 4.3. Restore only BLOBs/Binary Large Object/Files in the database
|
|
|
|
|
|
So far this can only be done by first creating a Table Of Content (TOC) that only holds the references to the BLOBs. And than use that TOC to restore only the items in that TOC (which are the BLOBs in this example but can be any objects that you want to restore).
|
|
|
|
|
|
```bash
|
|
|
pg_restore --list db_20250427_cron.db | grep BLOB > BLOB_TOC.txt
|
|
|
pg_restore -h localhost -p 7432 -d app -U app -v -Fc --use-list=BLOB_TOC.txt db_20250427_cron.db
|
|
|
```
|
|
|
|
|
|
# 5. Test locally using official (productional) backup
|
|
|
|
|
|
These steps assume you have a path setup to the [standaard gears scripts](https://gitlab.xlrit.com/xlrit/gears/scripts/-/tree/main). Many scripts require parameters. Just run the script without any parameters to find out which you need to set.
|
... | ... | |