How to restore my Immich server, lost all user data
I recently changed my server setup from TrueNAS to Proxmox with a TrueNAS VM. My server includes a 256GB internal SSD and a 32TB DAS connected to the server via USB-C. Before switching to Proxmox, I exported the settings from my TrueNAS installation.
After installing Proxmox on the server, I created a TrueNAS VM and passed the HDDs through to it. I then uploaded the settings I had exported from my previous TrueNAS installation. Most things transferred correctly, but none of the apps I had previously installed on my old TrueNAS instance were deploying properly. I suspect this is because my old TrueNAS instance was running the OS version just before ElectricEel, while my new instance is running ElectricEel, which switched to using Docker instead of Kubernetes.
Since I had backups of all my apps, I decided to start fresh with the apps and restore them one by one using the backup files. This process was straightforward for all apps except Immich.
For Immich, I had backed up all the folders from my previous TrueNAS instance, including library, upload, profile, pgBackup, pgData, etc. On my new TrueNAS instance, I reinstalled Immich and connected it to new, empty folders on TrueNAS. I then transferred all the photos from the old library folder into the new one. While none of my photos were lost, all previous server and user settings were gone.
With the folders inside the library folder there were user IDs that were associated with each account in my old Immich instance. So I created those same accounts in the new Immich instance and changed the user IDs of the folders in the library folder to match the new accounts. The Immich web UI is not showing those photos for each user account, but I can access those photos in the Immich container shell.
In the pgBackup and pdData folder from my old TrueNAS instance, I found multiple folder and files. Is there a way to use these files to restore my old Immich server?
I've attached screenshots of my folders to this post.


35 Replies
:wave: Hey @nicholas_davies,
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.I uploaded all the necessary information in the zip file. Hopefully that is enough information. One thing to note. The old Immich server folders are in: apps/immich
The new Immich server folders are in applications/immich
i tried deploying the new Immich using the old folders, but that did not work, which is why I created new ones.
Another thing to note. I do not want to add the photos in the library folder as an external library. I want them to go to each individual user so that they will be visible in the mobile app so each user doesn't have to re-upload their photos to the Immich server again.
Successfully submitted, a tag has been added to inform contributors. :white_check_mark:
did you also restore the pgsql database?
I honesty have no clue what exactly that is nor how to set it up. I don’t think I had that too begin with
Backup and restore based on db dumps is the way to go with immich
Ok, sorry for the dumb question. I’m a complete noob when it comes to this how would I do this on true nas? I’d I didn’t backup my old Immich instance then can I restore it using db dumps? I have no idea where to even start
I only had three users with my old Immich server. All the photos for these users where saved in the library folder/<user id>
With the new Immich server that I created yesterday, I recreated those three users. However their user ids had changed since I didn’t actually restore the Immich server.
What I did was drag the old folders with the user’s old user ids into the new library folder/<user id>
Then I renamed those folders to match the new user id for the new users that I had created.
However, after scanning the library Immich is not recognizing the photos in those folders (the ones that I renamed to match the new user ids). When I upload photos to each user they are stored in those folders that I transferred over so I know Immich can read/write to them. Just any old photos are not being recognized in Immich.
As a result of this, when I open up the mobile app on my phone it doesn’t recognize that my photos are already backed up and rebacks up my entire phone creating duplicates for everything.
If restoration of my old Immich server is not possible since I didn’t properly back it up, could I at least do something to make Immich recognize those photos in the users folders? That way those photos would be recognized for each individual user so when they open up the mobile all it’ll recognize that their photos are already backed up and won’t create duplicates.
It is possible, because we have built in database dumps in the backups folder. For this to work you would have to put the folders all back how they were though
Ok perfect. I do have backups of all the old folders so I just recreate immich on TrueNAS and point to the old folders? I tried this but Immich wouldn't deploy
You restore the database as outlined
Where is the dump.sql.gz file? Would that be in the pgData folder? How would I find the Postgres path?
Would I run those commands from the main shell or within the server shell?
It’s in the backups folder of upload location
Postgres path in env
If Linux, the commands are designed for the main shell
ok, found the dump.sql.gz file
I can't find the env file though. Is there typically a specific path on TrueNAS where it resides?
I used the find command, but I don't think any of these are correct?

I’m not sure but you need to clear out the database files wherever they are
Ok, instead of installing immich via the apps section of TrueNAS, I installed it via the main shell. I've provided screenshots of what I did, but when I went to Immich I was met with the "get started" page. It does not appear that the user settings were restored. Was there something I missed?




I used commands from here: https://immich.app/docs/install/docker-compose/
and here: https://immich.app/docs/administration/backup-and-restore/
Was I supposed to run "docker compose up -d" prior to following the backup/restore documentation?
That Postgres restore command should have a lot of output
Maybe run just the gunzip line and see what’s in the file
When I run this command: gunzip < "/mnt/tank/apps/immich/backup/dump.sql.gz"
Nothing happens
What’s the size of that file?
512 bytes....
Not good. That’s the only one you have in the backups folder?
There should be one per day
yep, there's just one file. I'm fairly certain I had it backing up everyday
in the pgBackup folder there are a bunch of sql files??
That’s not even the proper naming format

Not sure what that’s from, maybe you had a different database dump container setup
I followed a youtube video on how to set up the folders on immich which is why the folders are named wrong
They look pretty old though
hmmm, so if that file is too small then I can't restore it?
I mean the file has to contain actual data…
I can't uncompress it though
to see what's in it
Nevermind the file is literally empty
I just exported it to my computer
Ok, as I was saying before. I have a backup of UPLOAD_LOCATION/library/<userID> from my old Immich instance.
With my new Immich instance can I just move the folders from the old UPLOAD_LOCATION/library/<userID> location to the new one and change the user IDs as necessary?
No, not at all. You would need to reupload everything or use as an external library
The file structure in UPLOAD_LOCATION is useless without the matching database
ok, if I use an external library, will each user have to reupload their photos on the mobile app? Or will Immich recognize that those photos are already backed up?