I
Immich2w ago
Brazhh

Changing docker compose from root to non-root and now i don't have users and files

Hi everyone i was using immich with docker compose at my homelab but in root, i make a non-root user and move everything to them and change all the file permissions to the new non-root user, the problem is that now i don't have any user and any file at immich (they are not deleted, i have them in the upload folder) i managed to change the .env with the old data same as the root one but it just doesn't work my .env is UPLOAD_LOCATION=/mnt/raid/media/immich DB_DATA_LOCATION=/home/compadre/docker/immich/databases DB_PASSWORD= DB_USERNAME= DB_DATABASE_NAME=immich IMMICH_VERSION=release But i think i have deleted the docker volume from the databases when i change everything from root to non-root. My docker compose is the same as the one listed on github i really didn't change anything besides the .env, if there's no way to have the old users again, maybe there's a way to can "reupload" the same files or be detected for new users? Thanks!
36 Replies
Immich
Immich2w ago
:wave: Hey @Brazhh, Thanks for reaching out to us. Please carefully read this message and follow the recommended actions. This will help us be more effective in our support effort and leave more time for building Immich :immich:. References - Container Logs: docker compose logs docs - Container Status: docker ps -a docs - Reverse Proxy: https://immich.app/docs/administration/reverse-proxy - Code Formatting https://support.discord.com/hc/en-us/articles/210298617-Markdown-Text-101-Chat-Formatting-Bold-Italic-Underline#h_01GY0DAKGXDEHE263BCAYEGFJA Checklist I have... 1. :ballot_box_with_check: verified I'm on the latest release(note that mobile app releases may take some time). 2. :ballot_box_with_check: read applicable release notes. 3. :ballot_box_with_check: reviewed the FAQs for known issues. 4. :ballot_box_with_check: reviewed Github for known issues. 5. :ballot_box_with_check: tried accessing Immich via local ip (without a custom reverse proxy). 6. :ballot_box_with_check: uploaded the relevant information (see below). 7. :ballot_box_with_check: tried an incognito window, disabled extensions, cleared mobile app cache, logged out and back in, different browsers, etc. as applicable (an item can be marked as "complete" by reacting with the appropriate number) Information In order to be able to effectively help you, we need you to provide clear information to show what the problem is. The exact details needed vary per case, but here is a list of things to consider: - Your docker-compose.yml and .env files. - Logs from all the containers and their status (see above). - All the troubleshooting steps you've tried so far. - Any recent changes you've made to Immich or your system. - Details about your system (both software/OS and hardware). - Details about your storage (filesystems, type of disks, output of commands like fdisk -l and df -h). - The version of the Immich server, mobile app, and other relevant pieces. - Any other information that you think might be relevant. Please paste files and logs with proper code formatting, and especially avoid blurry screenshots. Without the right information we can't work out what the problem is. Help us help you ;) If this ticket can be closed you can use the /close command, and re-open it later if needed. Successfully submitted, a tag has been added to inform contributors. :white_check_mark: https://immich.app/docs/administration/backup-and-restore
Mraedis
Mraedis2w ago
Export DB as root install, import as non-root
Brazhh
BrazhhOP2w ago
Done everything but gives me Migrations failed
Mraedis
Mraedis2w ago
How old was your immich version?
Brazhh
BrazhhOP2w ago
I don't remember, i think haven't updated (in the root one) since febrary
Mraedis
Mraedis2w ago
You need to get to IMMICH_VERSION=v1.133.0 first and apply its breaking changes https://github.com/immich-app/immich/discussions?discussions_q=label%3Achangelog%3Abreaking-change+sort%3Adate_created afterwards you can upgrade right to release again
Brazhh
BrazhhOP2w ago
After that i can import the database of the root one? I have done all the both guides you give me but the error stays the same, Migrations Failed I mean, it works but when i import the databases it crash again
Mraedis
Mraedis2w ago
No you have to import first before you upgrade, or you have to upgrade the root version and then export/import
Brazhh
BrazhhOP2w ago
I try to upgrade root but it gives me that error, migration failed I think the problem was i updated both before importing the backup, theres a way to downgrade to an older folder to see if the backup works? because right now only works the update without that backup
Mraedis
Mraedis2w ago
Yes it's setting the version like I've mentioned
Brazhh
BrazhhOP2w ago
Yes when i use that it gives me failed migration when i import the database
Brazhh
BrazhhOP2w ago
compadre@Ranchito:~/docker/immich$ cat docker-compose.yml name: immich services: immich-server: container_name: immich_server image: ghcr.io/immich-app/immich-server:${IMMICH_VERSION:-release} volumes: - ${UPLOAD_LOCATION}:/usr/src/app/upload - /etc/localtime:/etc/localtime:ro env_file: - .env 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:${IMMICH_VERSION:-release} volumes: - immich_model_cache:/cache env_file: - .env restart: always healthcheck: disable: false redis: container_name: immich_redis image: docker.io/redis:6.2-alpine@sha256:148bb5411c184abd288d9aaed139c98123eeb8824c5d3fce03cf721db58066d8 healthcheck: test: redis-cli ping || exit 1 restart: always database: container_name: immich_postgres image: ghcr.io/immich-app/postgres:14-vectorchord0.3.0-pgvectors0.2.0
environment: POSTGRES_PASSWORD: ${DB_PASSWORD} POSTGRES_USER: ${DB_USERNAME} POSTGRES_DB: ${DB_DATABASE_NAME} POSTGRES_INITDB_ARGS: '--data-checksums' DB_STORAGE_TYPE: 'HDD' volumes: - immich_postgres_data:/var/lib/postgresql/data restart: always volumes: immich_model_cache: immich_postgres_data:
Mraedis
Mraedis2w ago
Try docker exec immich_postgres psql -U postgres -d immich -c 'select version, "createdAt" from version_history' to see what version it was before upgrading
Brazhh
BrazhhOP2w ago
version | createdAt
---------+------------------------------- 1.130.3 | 2025-08-24 22:55:13.072495+00 (1 row) compadre@Ranchito:~/docker/immich$ m version_history' version | createdAt
---------+------------------------------- 1.130.3 | 2025-08-24 22:55:13.072495+00 (1 row) root@Ranchito:~/immich# Gives me just that
Mraedis
Mraedis2w ago
That's alright, set the version to that and make sure to use the compose from that version (It's on the releases page), pull, wipe the DB, restore the backup and upgrade from there. Keep the compose in line with the version you're upgrading to
Brazhh
BrazhhOP2w ago
Okay, but i'm trying to figure how i should edit that docker compose because it gives me just image: ghcr.io/immich-app/immich-server:${IMMICH_VERSION:-r elease} How is the correct way to put 1.130.1 version? compadre@Ranchito:~/docker/immich$ cat docker-compose.yml name: immich services: immich-server: container_name: immich_server image: ghcr.io/immich-app/immich-server:1.130.1 volumes: - immich_upload:/usr/src/app/upload - /etc/localtime:/etc/localtime:ro env_file: - .env ports: - '2283:2283' depends_on: - redis - database restart: always healthcheck: test: ["CMD", "curl", "-f", "http://localhost:2283/health"] interval: 1m timeout: 10s retries: 5 immich-machine-learning: container_name: immich_machine_learning image: ghcr.io/immich-app/immich-machine-learning:1.130.1 volumes: - immich_model-cache:/cache env_file: - .env restart: always healthcheck: test: ["CMD", "curl", "-f", "http://localhost:2283/health"] interval: 1m timeout: 10s retries: 5 redis: container_name: immich_redis image: redis:6.2-alpine restart: always healthcheck: test: ["CMD", "redis-cli", "ping"] interval: 30s timeout: 10s retries: 5 database: container_name: immich_postgres image: docker.io/tensorchord/pgvecto-rs:pg14-v0.2.0 environment: POSTGRES_USER: ${DB_USERNAME} POSTGRES_PASSWORD: ${DB_PASSWORD} POSTGRES_DB: ${DB_DATABASE_NAME} POSTGRES_INITDB_ARGS: '--data-checksums' volumes: - immich_db:/var/lib/postgresql/data restart: always healthcheck: test: ["CMD-SHELL", "pg_isready -U $${POSTGRES_USER} -d $${POSTGRES_DB}"] interval: 30s timeout: 10s retries: 5 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 volumes: immich_upload: immich_model-cache: immich_db: compadre@Ranchito:~/docker/immich$ docker compose pull [+] Pulling 3/4 ! immich-server Interrupt... 0.8s ⠧ redis Pulling 0.8s ✔ database Pulled 0.6s ✘ immich-machine-learning Error manifest unknown 0.8s Error response from daemon: manifest unknown compadre@Ranchito:~/docker/immich$ ok i found it, was v1.130.1 right ok i'm kinda fucked... the backup i was using is from today is not from before i change to non-root and i dont have a backup from that time, is there a way... ? @Mraedis Theres a way to access my files from immich withou the past database i just lost? I have all the files but i can't access with immich
Mraedis
Mraedis2w ago
Are you sure you don't have a backup in UPLOAD_LOCATION/backups @Brazhh ?
Brazhh
BrazhhOP2w ago
They are from this month and the change was from before I didn't check it at that time because i was busy..
Mraedis
Mraedis2w ago
But if you did not upgrade in that time that will still be the old version
Brazhh
BrazhhOP2w ago
I mean, that backup don't have the user settings I still can't see the files and users i have before
Brazhh
BrazhhOP2w ago
This is the oldest backup i have but it doesn't help me to see the files
No description
Brazhh
BrazhhOP2w ago
So the only way it's gonna be copy/move all files to another user? Or it will break more things? That admin for example is new, none of the old users are listed
Mraedis
Mraedis2w ago
Can you tell me how exactly you are restoring these and with which install
Brazhh
BrazhhOP2w ago
i follow the guide you give me https://immich.app/docs/administration/backup-and-restore/ I import the most olded backup i have to the non-root user: gunzip --stdout /mnt/raid/media/immich/backups/immich-db-backup-1757210400433.sql.gz | docker exec -i immich_postgres psql --username=postgres --dbname=immich Everything good, not errors, but when i open immich it opens the login website and i type email and password of the admin (it was the same the old account and the new one) but then, theres nothing showing up This is the docker compose with 1.130.1 version name: immich services: immich-server: container_name: immich_server image: ghcr.io/immich-app/immich-server:v1.130.1 volumes: - /mnt/raid/media/immich:/usr/src/app/upload - /etc/localtime:/etc/localtime:ro env_file: - .env ports: - '2283:2283' depends_on: - redis - database restart: always healthcheck: test: ["CMD", "curl", "-f", "http://localhost:2283/health"] interval: 1m timeout: 10s retries: 5 immich-machine-learning: container_name: immich_machine_learning image: ghcr.io/immich-app/immich-machine-learning:v1.130.1 volumes: - immich_model-cache:/cache env_file: - .env restart: always healthcheck: test: ["CMD", "curl", "-f", "http://localhost:2283/health"] interval: 1m timeout: 10s retries: 5 redis: container_name: immich_redis image: redis:6.2-alpine restart: always healthcheck: test: ["CMD", "redis-cli", "ping"] interval: 30s timeout: 10s retries: 5 database: container_name: immich_postgres image: docker.io/tensorchord/pgvecto-rs:pg14-v0.2.0 environment: POSTGRES_USER: ${DB_USERNAME} POSTGRES_PASSWORD: ${DB_PASSWORD} POSTGRES_DB: ${DB_DATABASE_NAME} POSTGRES_INITDB_ARGS: '--data-checksums' volumes: - ./databases:/var/lib/postgresql/data restart: always healthcheck: test: ["CMD-SHELL", "pg_isready -U $${POSTGRES_USER} -d $${POSTGRES_DB}"] interval: 30s timeout: 10s retries: 5 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 volumes: immich_upload: immich_model-cache: immich_db: the .env (same as the root one) UPLOAD_LOCATION=/mnt/raid/media/immich DB_DATA_LOCATION=./databases IMMICH_VERSION=1.130.1 DB_PASSWORD=*** DB_USERNAME=postgres DB_DATABASE_NAME=immich
Brazhh
BrazhhOP2w ago
and the logs, dont see any error
Brazhh
BrazhhOP2w ago
The problem beings when i move everything to the new non-root folder, i didn't update till today
Mraedis
Mraedis2w ago
Did you do the part where you delete the old database folder first? Also this is wrong IMMICH_VERSION=1.130.1 it's IMMICH_VERSION=v1.130.1 the v is important
Brazhh
BrazhhOP2w ago
Yes i have done all of that, change the .env adding the v1.130.1 , deleted the databases folder of root and non-root, same error I still can't see any user from before so... whats is the easy way to copy/move past user files to new ones without breaking or losing everything? I really like the software and i have a lot of pictures that i really dont want to lost
Mraedis
Mraedis2w ago
You'd use something like Immich-go or Immich-cli to recursively upload again from the old folders But you should really look into why the backup is not restoring read the logs from the restore, post the compose logs from startup
Brazhh
BrazhhOP2w ago
They are but the oldest is from september 8 and i have been using immich since january i think, there's no logs from that time The backup i need is from past month before i did the movement but there's no backup from that time
Mraedis
Mraedis2w ago
? you only have monthly backups?
Brazhh
BrazhhOP2w ago
I don't know
Brazhh
BrazhhOP2w ago
This is all i had
No description
cave monster
cave monster2w ago
'ls -l' will show the date for each file. Default interval for DB dumps is daily
Brazhh
BrazhhOP6d ago
yes i dont have backups from last month...
No description

Did you find this page helpful?