Restore DB help
I was previously running immich using the https://github.com/imagegenius/docker-immich compose. I have the backup which used a different docker container name and postgres user.
I have now provisioned a new Docker LXC and have deployed the stock compose per https://documentation.immich.app/docs/install/docker-compose using the default container names and postgres user. I ran the restore immediately after the initial install before opening the app per https://documentation.immich.app/docs/administration/backup-and-restore. When I then open the web app, I am able to log in with the user from my backed up db which I thought meant the restore worked. The issue is none of the thumbnails show and opening the image also doesn't work (just a black screen). The metadata looks in tack and all my albums are also available, again with no thumbnails though. I tried running the Generate Thumbnails job but that had no effect (even though it re-ran for All). Hoping someone can help me restore properly. Thanks in advance.
I have now provisioned a new Docker LXC and have deployed the stock compose per https://documentation.immich.app/docs/install/docker-compose using the default container names and postgres user. I ran the restore immediately after the initial install before opening the app per https://documentation.immich.app/docs/administration/backup-and-restore. When I then open the web app, I am able to log in with the user from my backed up db which I thought meant the restore worked. The issue is none of the thumbnails show and opening the image also doesn't work (just a black screen). The metadata looks in tack and all my albums are also available, again with no thumbnails though. I tried running the Generate Thumbnails job but that had no effect (even though it re-ran for All). Hoping someone can help me restore properly. Thanks in advance.

22 Replies
One potential clue (which I don't know how to solve), is the imagegenius version docker-compose used a volume. Looking at the immich_server logs, I see lots of errors like .
Again, not sure if related, but likely. Still looking for help/guidance as I don't know how to fix.
Again, not sure if related, but likely. Still looking for help/guidance as I don't know how to fix.
@martabal
Yes the assets paths in your database does not match the paths in the container
I suppose you have to change ./upload in your docker-compose.yml to /photos and add IMMICH_MEDIA_LOCATION=/photos in your .env
Thanks for the quick reply and direction.
I'll change to for both the immich-server and immich-microservices containers in the docker-compose.
The IMMICH_MEDIA_LOCATION variable doesn't exist in my .env nor is it referenced in the docker-compose. I can certainly add it to the .env, but where would I update the docker-compose to leverage?
also, do I just run the Restore steps again as per https://documentation.immich.app/docs/administration/backup-and-restore#:~:text=dump.sql.gz%22-,Restore,-docker%2Dcompose%20down once I've updated both the docker-compose and .env?
Backup and Restore | Immich
Database
The docker compose has a env_file thing which passes all the settings to the containers
Just bring the stack down and up with the env and it should update it
You should see it on the server and microservices containers
it worked! Thanks so much for the speedy and accurate support. I'm assuming I can delete the IMMICH_MEDIA_LOCATION variable added to the .env as I don't think it was used. No harm in leaving it there either... just prefer to keep things clean where possible.
It is 100% used and will stop working if you remove it.
I'm curious, where is it referenced if not in the docker-compose?
sorry, to clarify, I know the .env is used and required :). My question is specific to the IMMICH_MEDIA_LOCATION variable I added to the .env as per @martabal instructions. Is that specific variable used somewhere outside of the docker-compose and thus needed? I couldn't find any references for that variable in the compose (although I visually scanned so may have missed it).
It is used in the codebase yes
Environment Variables | Immich
To change environment variables, you must recreate the Immich containers.
got it. thanks again for all your help. Immich and the support are both awesome!
hmm... does that mean I should have not updated the docker-compose and adding the variable to .env was all I needed? Again, just looking to understand and ensure I haven't broken anything
So the path in the database that was restored start with /photos etc
To make it continue to work, you need the volume mount to be updated so the photos show up at /photos
For new files, unless you set the new env variable, the files will be stored at a new location, not the volume mount, which seems not what you want
I guess it's really the original /usr/src/app/upload, the previous value, not the new one, which you just added to change it to /photos
yup, that's the change I made for both containers from:
to
Yes that will fix existing files. The env change makes it so new files are written to that directory as well, instead of the default folder
amazing!!!