Skip to content

Instantly share code, notes, and snippets.

@Nikongen
Last active October 4, 2025 00:05
Show Gist options
  • Select an option

  • Save Nikongen/daead15203a8c0c648384c7115b0a989 to your computer and use it in GitHub Desktop.

Select an option

Save Nikongen/daead15203a8c0c648384c7115b0a989 to your computer and use it in GitHub Desktop.
Restore Immich Backup in TrueNAS Scale 25.04.2.4

Restore Immich Backup in TrueNAS Scale 25.04.2.4

Switching from a NixOS instance to the TrueNAS Scale app. All data was in ZFS pools immich-pg and immich-data

Problem

App or docker compose stack will not start due to a issue with postgres container Container ix-immich-pgvecto-1 Error in /var/log/app_lifecycle.log.

Solution

Make sure to check permissions https://docs.immich.app/administration/system-integrity/#folder-checks and follow these instructions https://docs.immich.app/install/truenas/

  1. SSH into truenas
  2. docker compose ls to find location of compose file. /mnt/.ix-apps/app_configs/immich/versions/1.10.4/templates/rendered/docker-compose.yaml in my case
  3. cd in that dir
  4. Follow immich docs https://docs.immich.app/administration/backup-and-restore/
  5. Container name is different here: docker start rendered-pgvecto-1 instead of docker start immich_postgres
  6. Check compose file for database name cat docker-compose.yaml. Name and user are immich.
  7. Run docker ps to find postgres container id. 2abeccd00195 for ghcr.io/immich-app/postgres:15-vectorchord0.4.3-pgvectors0.2.0in my case.
  8. Run restore command from immich docs.
gunzip --stdout "/mnt/pool1/services/immich/immich-data/backups/immich-db-backup-1759449600005.sql.gz" \
| sed "s/SELECT pg_catalog.set_config('search_path', '', false);/SELECT pg_catalog.set_config('search_path', 'public, pg_catalog', true);/g" \
| docker exec -i immich_postgres psql --dbname=immich --username=immich 
  1. docker compose up -d no error, all healthy. Nice!
  2. Kill again and start from truenas dashboard! docker compose down -v
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment