Question about Backup/Restore
I've checked older posts but didn't quite find anything that helped me out with this... I'm setting up Immich for the first time and as part of my setup I'm doing a restore > backup from system A to system B. Everything is working on System A. I stopped my docker-compose, ran the database dump, transferred it through my network share to System B, then pulled/created the Immich docker compose stack and only started the immich_postgres image. I then ran "gunzip" piped into the docker container and, once it finished, ran "docker compose up -d" to start the rest of the stack. Previous to running any of the docker commands, I pasted in my correct values in my .env file. The upload location is "different" on System A and B on the host filesystem, but they're accessing the same network share.
I received no errors during the entire process and was able to connect to the new Immich stack on System B and verified that all user accounts are how they should be. I mounted my network share on System B the exact same way I mounted it on System A (copied and pasted my commands). However, when I go to view my image library, I only get blurred thumbnails and a red exclamation point in the corner of each image. When I click on the image, I get a blank asset with just the upload filename in the corner. If I attempt to download the image it gives me an internal server 500 error.
All of my media is on my network share. It's also worth pointing out that my network share, worth 5TB of storage, is not showing in the user interface of System B, but is instead showing System B's local storage as its values, leading me to believe there may be a mount issue. However, I'm able to navigate around my network share normally.
What can I do to further troubleshoot this issue? I want to be confident in my backups before doing anything more with it.
58 Replies
You can provide the docker-compose, server logs and the .env so we can help taking a look
Absolutely, one moment please
Would you just want the immich_web logs? Or all of them?
Here are the docker-compose and .env files. I've done a stare-and-compare between A and B and haven't seen any issues.
Here are the server logs as generated by 'docker logs immich_server'.
I just grabbed a single line of the ExceptionsHandler error, but it's a ton of that. I also get some "cannot create read stream for asset xxxx \ getAssetThumbnail" as well.
Are the thumbnails on the nas storage as well or where were those located?
Ah. I didn't realize those were handled separate from the rest of the media. I assumed that changing the upload location would have it all in one spot. Let me check
That being said, I tried to generate new thumbnails on the new server... it acted like it would start and then just closed the job within a second or two. Would that be related to this?
I mean, you need originals from the old system accessible on the new system at the same path. In your situations thumbnails probably would be available at the same place as well. If they weren't you could regenerate them from the originals. It sounds like nothing is mounted correctly though.
Can you access the files from inside the container at
/usr/src/app/upload/library/*
? I am guessing there might be a problem with the storage mount on the new system.I've checked. I have thumbnails on my network storage.
I'll check the container now
In the immich_server container I ran an "ls -la" while within the /usr/src/app/upload/library/ directory and have nothing.
Well, I might be about to learn some neat new stuff! I have a couple of questions that might be useful or might not be that useful...
Does mounting a network share to /home/user/ cause any issues?
docker runs as root most likely so that can impact some stuff.
System A is a Raspberry Pi 4 running Raspbian, Server B is a NixOS desktop. I'm not crazy familiar with NixOS yet, so I just mounted to my home directory
I have a buddy who lives and breathes NixOS. I've asked him to help me properly mount a network share. I'll update here
Sounds good. I think it is just a matter of mounting the drive to nix and then making it available to docker correctly.
Alright, let me bug you again. I had some issues mounting in NixOS, so I grabbed my laptop running Arch and set it up with docker compose and all that fun stuff. Using the default docker-compose.yml and the appropriate .env I'm seeing the same thing
100% the mount is there
on the container there is nothing?
/usr/src/app/upload/library is empty
and the mount is UPLOAD_LOCATION:/usr/src/app/upload ?
I ran an rsync command to get my .env from System A to System C and then visually compared to be sure
and UPLOAD_LOCATION/library has stuff on the host side?
Yes. If I check the network share /mnt/networkshare/immich/storage I get the "encoded-video", "library", "thumbs", and "upload" directories. If I follow them all the way down I get to jpegs and mp4s and all that good stuff
and the value of UPLOAD_LOCATION is what?
can you send a screenshot of the env file maybe?
Wow
wrap it in 3 ticks
Ah
3 at the top and then new line then content and 3 at the bottom
Didn't realise markdown worked in Discord
/mnt/hetzner-backup/immich/storage is outdated?
I stripped my key and password, but they're good
No, that's correct
Oh your example was just not the actual values?
Sorry, I was using a placeholder in my previous messages
yeah
this file is called
.env
and it is in the directory with the docker-compose.yml file?
I guess you can always try docker compose config to see the final values of everythingCan you successfuly read/write directories and files to the mount?
Let me check
from the host obviously
Host being System A or C?
Idk I can't keep track lol.
Haha no worries
I know you have the storage on a NAS and you are mounting it onto another computer
System A, my original, working system, can run touch.txt with no issues. System C, my backup tester, cannot. It's probably a permissions issue at this point
Thank you for baby-stepping me to that. Less of an Immich issue and more of a user issue haha
Well, or a fstab misconfiguration
Oh or that maybe
Sometimes an invalid config means it can't actually get access and docker for some reason silently fails in those situations instead of reporting an issue.
mount not showing up in docker can mean = no permission to create the mount = no read/write on the host
Well, I may have skipped the fstab step in this whole process tbh. I assumed that a manual mount with no reboots would be good enough
Sorry, I love Linux but I'm still a noob with it all
no worries I am confused by it all the time still
without fstab then the mount won't be availble upon system reboot
That was my understanding, so I figured I was safe if I never rebooted during the testing
Since this is really just for testing
Got it
But let me add it and see if it does better here
Even with a manual mount it might not be available to docker though
Here is my fstab for your reference

these are all local drives though, right? not a network drive.
Looks that way to me. I'm just gonna copy my system A fstab
entry
makes sense
I think with network it will be smb:// and then credential as well, right?
I'm running a cifs in this case, but it's the same line of thinking
I think it goes //<ip-ad>/path/ /local/mount/path cifs <credentials> <permissions>
That looks right. You can add uid=1000 and guid=1000 etc as well
I think the <credentials><permissions> just become a list of key value properties which can include a bunch of different stuff.
Well, that was it. On my backup test System C I am now able to view non-blurred thumbnails, pull up images, and watch videos. It works exactly as it does on System A, my original host.
So the tl;dr of my issue was that I was unable to properly access assets and I just needed to properly mount my network share in both the CLI with a manually run command and in my /etc/fstab folder. It was a CIFS share for any future readers
@jrasm91 Thank you so much for your help today! Now that I'm comfortable with the backup and restore process I'm gonna start moving away from Google Photos!