services: immich-server: container_name: immich_server image: ghcr.io/immich-app/immich-server:${IMMICH_VERSION:-v2.5.6} deploy: resources: reservations: devices: - driver: nvidia count: 1 capabilities: - gpu - compute - video volumes: - /mnt/datastore/configs/immich-new/data:/data - /etc/localtime:/etc/localtime:ro env_file: - .env ports: - 2283:2283 depends_on: - redis - database restart: unless-stopped healthcheck: disable: false immich-machine-learning: container_name: immich_machine_learning image: ghcr.io/immich-app/immich-machine-learning:${IMMICH_VERSION:-v2.5.6}-cuda deploy: resources: reservations: devices: - driver: nvidia count: 1 capabilities: - gpu volumes: - model-cache:/cache env_file: - .env restart: unless-stopped healthcheck: disable: false redis: container_name: immich_redis image: docker.io/valkey/valkey:8-bookworm@sha256:fea8b3e67b15729d4bb70589eb03367bab9ad1ee89c876f54327fc7c6e618571 healthcheck: test: redis-cli ping || exit 1 restart: unless-stopped database: container_name: immich_postgres image: ghcr.io/immich-app/postgres:14-vectorchord0.4.3-pgvectors0.2.0@sha256:bcf63357191b76a916ae5eb93464d65c07511da41e3bf7a8416db519b40b1c23 environment: POSTGRES_PASSWORD: ${DB_PASSWORD} POSTGRES_USER: ${DB_USERNAME} POSTGRES_DB: ${DB_DATABASE_NAME} POSTGRES_INITDB_ARGS: --data-checksums # Uncomment the DB_STORAGE_TYPE: 'HDD' var if your database isn't stored on SSDs # DB_STORAGE_TYPE: 'HDD' volumes: - /mnt/tank/configs/immich-new/db:/var/lib/postgresql/data shm_size: 128mb restart: unless-stopped volumes: model-cache: null networks: {} I have been trying to migrate my old Immich *(version v1.123.0, yes it is very old I know I need to do better)* to the docker compose setup. However, at the very end, when the new immich web UI asks you to restore from a backup, the sql databases have a compatibility mismatch. My old sql backups don't have a clean syntax for sql version 14, I think. When I try to restore from the sql file I get the following screenshot. So in the truenas shell I am trying to restore the backup manually but I am hung up on this "ERROR: database "template1" does not exist". trying to re syntax the .sql with the *sed* line doesn't work for me (found this solution on a forum) truenas_admin@truenas[/mnt/tank/stacks/immich-new]$ sudo gunzip --stdout /mnt/datastore/configs/immich-new/data/backups/immich-db-backup-1771322400014.sql.gz \ | sed -E 's/ WITH .*;//' \ | sudo docker exec -i immich_postgres psql -U postgres -d postgres --set ON_ERROR_STOP=on SET SET SET DROP DATABASE NOTICE: database "immich" does not exist, skipping DROP ROLE CREATE ROLE ALTER ROLE SET SET SET SET set_config ------------ (1 row) SET SET SET SET UPDATE 0 ERROR: database "template1" does not exist