Immich — the photo library, its database, and the one trap in it¶
8,039 assets (5,852 photos, 2,187 videos, 29 albums, 233 people, 2021–2026). Four containers; data on the pool; DB dumped nightly. The originals are irreplaceable; the database is what makes them a library.
Why this shape¶
Originals are plain files under library/ and upload/ so every copy mechanism (parity, rsnapshot, precious) sees them as files. Albums, faces, favourites and edits exist only in Postgres, so the dump is copied everywhere the originals are.
Shape¶
- Containers:
immich-server(ghcr.io/immich-app/immich-server:release),immich-machine-learning,immich-postgres(postgres:14-vectorchord0.4.3-pgvectors0.2.0),immich-redis(valkey 8). Compose config under~/torrentvpn/immich/. - Data:
/mnt/storage/immich/{library,upload,profile}originals ·backups/nightly dumpimmich-db-backup-<ts>-v2.4.1-pg14.19.sql.gzat 02:00, 14 kept ·thumbs/,encoded-video/regenerable. - Postgres superuser is
immich, notpostgres(restore gotcha in~/precious/RESTORE.txt). - Motion-photo trap: 13 Samsung motion photos have their only original as
-MP.mp4underencoded-video/. Any copy that excludesencoded-video/as "regenerable" silently drops 13 originals.precious-sync.shderives the list from the DB each run. - 34 files on disk with no DB row were SHA-1'd (09-02): all byte-identical duplicates of assets already in the library — leftovers of uploads Postgres correctly rejected. Harmless.
Connected to¶
- owned-by: torrentvpn-stack
- joins: storage/datasets, storage/precious-copy (needs
immich-postgresup at 02:20 to query the motion-photo list), processes/rsnapshot (backup /mnt/storage/immich/hourly, excludingpostgres/thumbs/*.db-shm/wal)
If you change this¶
- Hits: precious-sync (DB query + source paths) · rsnapshot excludes · the nightly dump timing vs precious-sync (02:00 → 02:20, keep that order) ·
docker-backup.shskips theimmichdir by name — data is on the pool, not in the config dir. - Does not hit: parity rules (all under an included tree) · other containers.
Surfaces¶
| Surface | Role |
|---|---|
| Immich app / web | the users |
docker exec immich-postgres psql -U immich |
the DB, read for verification |
See¶
- Source:
~/torrentvpn/docker-compose.yml:438-500·/usr/local/bin/precious-sync.sh:10-21