0
Fork 0
mirror of https://github.com/immich-app/immich.git synced 2025-01-21 00:52:43 -05:00

feat(docs): additional corruption checks (#15102)

corruption checks
This commit is contained in:
Matthew Momjian 2025-01-05 13:03:53 -05:00 committed by GitHub
parent 6a9d57ad33
commit a81fb73faf
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -447,6 +447,24 @@ docker exec -it immich_postgres psql --dbname=immich --username=<DB_USERNAME> --
</details>
You can also scan the Postgres database file structure for errors:
<details>
<summary>Scan for file structure errors</summary>
```bash
docker exec -it immich_postgres pg_amcheck --username=postgres --heapallindexed --parent-check --rootdescend --progress --all --install-missing
```
A normal result will end something like this and return with an exit code of `0`:
```bash
7470/8832 relations (84%), 730829/734735 pages (99%)
8425/8832 relations (95%), 734367/734735 pages (99%)
8832/8832 relations (100%), 734735/734735 pages (100%)
```
</details>
If corruption is detected, you should immediately make a backup before performing any other work in the database.
To do so, you may need to set the `zero_damaged_pages=on` flag for the database server to allow `pg_dumpall` to succeed.
After taking a backup, the recommended next step is to restore the database from a healthy backup before corruption was detected.