immich-app / immich

High performance self-hosted photo and video management solution.
https://immich.app
GNU Affero General Public License v3.0
52.37k stars 2.77k forks source link

Backup location #14245

Closed 1mfaasj closed 2 days ago

1mfaasj commented 2 days ago

The bug

Hi, I have set the automatic backup but nothing is written to the location I defined. am I doing it right?

in the documentation (https://immich.app/docs/guides/custom-locations/) it says to use BACKUP_LOCATION, but on another page (https://immich.app/docs/administration/backup-and-restore/) it says something else 'UPLOAD_LOCATION/backups'

which one should work?

The OS that Immich Server is running on

Ubuntu

Version of Immich Server

v1.120.2

Version of Immich Mobile App

latest

Platform with the issue

Your docker-compose.yml content

`services:
  immich-server:
    container_name: immich_server
    image: ghcr.io/immich-app/immich-server:v1.120.2
    volumes:
      - /share/images:/afbeeldingen:ro
      - /share/images/upload:/usr/src/app/upload
      - /share/backup:/usr/src/app/backup
      - /etc/localtime:/etc/localtime:ro
    environment:
      - UPLOAD_LOCATION=/usr/src/app/upload
      - BACKUP_LOCATION=/usr/src/app/backup
      - DB_PASSWORD=immich
      - DB_USERNAME=immich
      - DB_DATABASE_NAME=immich
    ports:
      - 2283:2283
    depends_on:
      - redis
      - database
    restart: always
    healthcheck:
      disable: false

  immich-machine-learning:
    container_name: immich_machine_learning
    image: ghcr.io/immich-app/immich-machine-learning:v1.120.2
    volumes:
      - /home/media/immich/cache:/cache
    restart: always
    healthcheck:
      disable: false

  redis:
    container_name: immich_redis
    image: redis:6.2-alpine
    healthcheck:
      test: redis-cli ping || exit 1
    restart: always

  database:
    container_name: immich_postgres
    image: docker.io/tensorchord/pgvecto-rs:pg14-v0.2.0
    environment:
      - POSTGRES_PASSWORD=immich
      - POSTGRES_USER=immich
      - POSTGRES_DB=immich
      - POSTGRES_INITDB_ARGS = '--data-checksums'
      - DB_DATA_LOCATION=./postgres
      - DB_PASSWORD=immich
      - DB_USERNAME=immich
      - DB_DATABASE_NAME=immich
    volumes:
      - /home/media/immich/db:/var/lib/postgresql/data
    healthcheck:
      test: pg_isready --dbname='immich' --username='immich' || exit 1; Chksum="$$(psql --dbname='immich' --username='immich' --tuples-only --no-align --command='SELECT COALESCE(SUM(checksum_failures), 0) FROM pg_stat_database')"; echo "checksum failure count is $$Chksum"; [ "$$Chksum" = '0' ] || exit 1
      interval: 5m
      start_interval: 30s
      start_period: 5m
    command: ["postgres", "-c", "shared_preload_libraries=vectors.so", "-c", 'search_path="$$user", public, vectors', "-c", "logging_collector=on", "-c", "max_wal_size=2GB", "-c", "shared_buffers=512MB", "-c", "wal_compression=on"]
    restart: always
`

Your .env content

none, I have defined the environment variables in the docker-compose file (mentioned above)

Reproduction steps

I enabled the backup like this: image

Relevant log output

none

Additional information

No response

zackpollard commented 2 days ago

Backups are written to /usr/src/app/upload/backups as specified in the documentation you linked. Updated your compose to point to that location and you will see backups start to be written correctly.

Looking at your setup currently, if you check /share/images/upload/backups on your host filesystem, you should find the backups located there.