Skip to content

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 dump immich-db-backup-<ts>-v2.4.1-pg14.19.sql.gz at 02:00, 14 kept · thumbs/, encoded-video/ regenerable.
  • Postgres superuser is immich, not postgres (restore gotcha in ~/precious/RESTORE.txt).
  • Motion-photo trap: 13 Samsung motion photos have their only original as -MP.mp4 under encoded-video/. Any copy that excludes encoded-video/ as "regenerable" silently drops 13 originals. precious-sync.sh derives 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

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.sh skips the immich dir 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