Migrating Immich from one TrueNAS Server to Another

I have two truenas servers, trying to migrate from one to another. The old truenas server is set up with the old directory structure. (ie library, upload, thumbs, profile, video, and backups all in their own folders) I want to set up the new truenas server (truenas2) with the newer directory format (data (with the folders above included) and pgdata) I've set up Immich on the new server and ran rsync commands to move the data to the newer directory format but Immich does not show any pictures when opening to webUI. Got the initial setup screens, but nothing appears in the photos, map, etc screens. I did notice the old server had the user ID and group ID as 0, I have set up the new server with the 568 user ID and group ID.
Any ideas why it's coming up blank? I initially spent a good 6 to 8 hours setting up the library (dumping duplicates and renaming things), so I'd love to be able to get the old library migrated over so that I don't have to go through the whole thing manually all over again.
97 Replies
Immich
Immich•4d ago
:wave: Hey @Witherful_Life, 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. :blue_square: verified I'm on the latest release(note that mobile app releases may take some time). 2. :blue_square: read applicable release notes. 3. :blue_square: reviewed the FAQs for known issues. 4. :blue_square: reviewed Github for known issues. 5. :blue_square: tried accessing Immich via local ip (without a custom reverse proxy). 6. :blue_square: uploaded the relevant information (see below). 7. :blue_square: 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.
Xiticks
Xiticks•4d ago
Did you also rsync the database? because it looks like you did not, if nothing shows up through Immich webUI Did you also have to recreate an account?
Witherful_Life
Witherful_LifeOP•4d ago
I did rsync the pgdata folder, if that's where the DB is stored. It did ask me to create an account when I signed in, used the same credentials as the original one.
Xiticks
Xiticks•4d ago
Yeah so looks like you did not rsync the pgData Can you show your old dataset/directory structure ? If you still have it on your system?
Witherful_Life
Witherful_LifeOP•4d ago
Sure thing. Here's a screenshot.
No description
Xiticks
Xiticks•4d ago
Ok, so can you, from TrueNAS shel, cd into your new pgData and do a ll there and share the output? and (optional) share the new datastes info? + if you can, the exact rsync command you ran you might need to login as sudo to do so, so sudo su
Witherful_Life
Witherful_LifeOP•4d ago
Sure, here is the new server's pgData structure:
No description
Witherful_Life
Witherful_LifeOP•4d ago
New servers' datasets
No description
Xiticks
Xiticks•4d ago
I think we've found the issue What if you cd into data then in any folder inside data (let's say upload) and do ll again?
Witherful_Life
Witherful_LifeOP•4d ago
Here you go
No description
Xiticks
Xiticks•4d ago
no cd again in a directory (upload for example) and do the ll there
Witherful_Life
Witherful_LifeOP•4d ago
No description
Xiticks
Xiticks•4d ago
Yep
Witherful_Life
Witherful_LifeOP•4d ago
What did I do? lol
Xiticks
Xiticks•4d ago
so you did not do the rsync commands correcly likely forgot a trailing / in all of them but that's fine, it's fixable and won't take as much time as the original rsync command can you do that for each folder in /data ? So I can give you the correct instrcutions Or are you familiar enough with linux so I can just explain what to do and you'll be able to do?
Witherful_Life
Witherful_LifeOP•4d ago
I'm fairly familiar, lol. I'm suing the truenas rsync task, I wonder if that has anything to do with it. I set up a series of them, this is the profile copy for eexample.
No description
Witherful_Life
Witherful_LifeOP•4d ago
Maybe I just goofed the Remote path.
Xiticks
Xiticks•4d ago
well kinda you should have added a / at the end in source, or not write it for destination that's the issue but so go into terminal and share me that for each folders in data I'll give the command to do to fix that and also stop your Immich app
Witherful_Life
Witherful_LifeOP•4d ago
ok, immich stopped. ok, so like this?
No description
Xiticks
Xiticks•4d ago
yes, for each
Witherful_Life
Witherful_LifeOP•4d ago
No description
Witherful_Life
Witherful_LifeOP•4d ago
No description
Witherful_Life
Witherful_LifeOP•4d ago
No description
Witherful_Life
Witherful_LifeOP•4d ago
No description
Witherful_Life
Witherful_LifeOP•4d ago
No description
Witherful_Life
Witherful_LifeOP•4d ago
Should be it, backups, encoded-video, library, profile, thumbs, upload.
Xiticks
Xiticks•4d ago
yes, these are correct, it's just that you have nested folders but no worries so now, can you cd back into pgData please
Witherful_Life
Witherful_LifeOP•4d ago
sure
Witherful_Life
Witherful_LifeOP•4d ago
pgdata
No description
Xiticks
Xiticks•4d ago
ok, run this
find . -mindepth 1 -maxdepth 1 ! -name pgData -exec rm -rf {} + && mv pgData/* pgData/.* . 2>/dev/null && rmdir pgData
find . -mindepth 1 -maxdepth 1 ! -name pgData -exec rm -rf {} + && mv pgData/* pgData/.* . 2>/dev/null && rmdir pgData
and then do ll again
Witherful_Life
Witherful_LifeOP•4d ago
No description
Xiticks
Xiticks•4d ago
Oh well ok so now do mv ./pgData/* ./ and redo a ll
Witherful_Life
Witherful_LifeOP•4d ago
Gotcha
No description
Xiticks
Xiticks•4d ago
ok, now do rm -r pgData
Witherful_Life
Witherful_LifeOP•4d ago
done
Xiticks
Xiticks•4d ago
ok, so now cd back into data and do
mv ./backups/backups/* ./backups && rm ./backups/backups && ll ./backups
mv ./backups/backups/* ./backups && rm ./backups/backups && ll ./backups
Witherful_Life
Witherful_LifeOP•4d ago
Ok done
No description
Xiticks
Xiticks•4d ago
Well mb on that
mv ./backups/backups/* ./backups && rm -r ./backups/backups && ll ./backups
mv ./backups/backups/* ./backups && rm -r ./backups/backups && ll ./backups
should have been this, sorry
Witherful_Life
Witherful_LifeOP•4d ago
Ok, so just run the second one then?
Xiticks
Xiticks•4d ago
yes, run that
Witherful_Life
Witherful_LifeOP•4d ago
Ok, I ran that and went back into backups
No description
Xiticks
Xiticks•4d ago
what the? ok now, while inside backups do rm -r ./backups
Witherful_Life
Witherful_LifeOP•4d ago
Ok, it removed backups
No description
Xiticks
Xiticks•4d ago
that is correct so go back into data
mv ./encoded-video/video/* ./encoded-video && rm -r ./encoded-video/video && ll ./encoded-video
mv ./encoded-video/video/* ./encoded-video && rm -r ./encoded-video/video && ll ./encoded-video
And do this one
Witherful_Life
Witherful_LifeOP•4d ago
No description
Xiticks
Xiticks•4d ago
Nice, so we keep going
Witherful_Life
Witherful_LifeOP•4d ago
Gotcha
Xiticks
Xiticks•4d ago
mv ./library/library/* ./library && rm -r ./library/library && ll ./library
mv ./library/library/* ./library && rm -r ./library/library && ll ./library
(keep sharing the output, so I'm sure it worked correctly)
Witherful_Life
Witherful_LifeOP•4d ago
Ok, I get most of what's going on here, lol.
No description
Xiticks
Xiticks•4d ago
well that shouldn't be this output
Witherful_Life
Witherful_LifeOP•4d ago
Ya, I figured.
Xiticks
Xiticks•4d ago
cd into library (only once) and do ll
Witherful_Life
Witherful_LifeOP•4d ago
No description
Xiticks
Xiticks•4d ago
cd again into library and do ll again? like the nested library
Witherful_Life
Witherful_LifeOP•4d ago
No description
Xiticks
Xiticks•4d ago
That make sense then, as it's "empty" so go back into data and simply run
rm -r ./library/library && ll ./library
rm -r ./library/library && ll ./library
Witherful_Life
Witherful_LifeOP•4d ago
ok, done
No description
Xiticks
Xiticks•4d ago
```mv ./profile/profile/* ./profile && rm -r ./profile/profile && ll ./profile
```mv ./profile/profile/* ./profile && rm -r ./profile/profile && ll ./profile
``` now this It might also throw an error
Witherful_Life
Witherful_LifeOP•4d ago
Ya, same
No description
Xiticks
Xiticks•4d ago
yeah so simply
rm -r ./profile/profile && ll ./profile
rm -r ./profile/profile && ll ./profile
I rather do the first to be sure that we keep everything
Witherful_Life
Witherful_LifeOP•4d ago
No description
Witherful_Life
Witherful_LifeOP•4d ago
No description
Witherful_Life
Witherful_LifeOP•4d ago
Looks like the nested profile is gone now.
Xiticks
Xiticks•4d ago
yeah, it's fine
Witherful_Life
Witherful_LifeOP•4d ago
Cool
Xiticks
Xiticks•4d ago
rm -r ./thumbs/185a6ed8-db33-4e1c-8c49-3bf98752dbd2 && mv ./thumbs/thumbs/* ./thumbs && rm -r ./thumbs/thumbs && ll ./thumbs
rm -r ./thumbs/185a6ed8-db33-4e1c-8c49-3bf98752dbd2 && mv ./thumbs/thumbs/* ./thumbs && rm -r ./thumbs/thumbs && ll ./thumbs
Now this one
Witherful_Life
Witherful_LifeOP•4d ago
No description
Xiticks
Xiticks•4d ago
Noice So now for the latest and most important:
rm -r ./upload/185a6ed8-db33-4e1c-8c49-3bf98752dbd2 && mv ./upload/upload/* ./upload && rm -r ./upload/upload && ll ./upload
rm -r ./upload/185a6ed8-db33-4e1c-8c49-3bf98752dbd2 && mv ./upload/upload/* ./upload && rm -r ./upload/upload && ll ./upload
Witherful_Life
Witherful_LifeOP•4d ago
No description
Xiticks
Xiticks•4d ago
yeah you forgot to delete the ~ at the end but that is fine Now you can start your Immich app
Witherful_Life
Witherful_LifeOP•4d ago
Looks like it failed to start: Traceback (most recent call last): File "/usr/lib/python3/dist-packages/middlewared/job.py", line 515, in run await self.future File "/usr/lib/python3/dist-packages/middlewared/job.py", line 562, in __run_body rv = await self.middleware.run_in_thread(self.method, *args) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/middlewared/main.py", line 627, in run_in_thread return await self.run_in_executor(io_thread_pool_executor, method, *args, kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/middlewared/main.py", line 624, in run_in_executor return await loop.run_in_executor(pool, functools.partial(method, *args, kwargs)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/concurrent/futures/thread.py", line 58, in run result = self.fn(self.args, **self.kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/middlewared/api/base/decorator.py", line 101, in wrapped result = func(args) ^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/middlewared/plugins/apps/app_scale.py", line 62, in start compose_action(app_name, app_config['version'], 'up', force_recreate=True, remove_orphans=True) File "/usr/lib/python3/dist-packages/middlewared/plugins/apps/compose_utils.py", line 61, in compose_action raise CallError(err_msg) middlewared.service_exception.CallError: [EFAULT] Failed 'up' action for 'immich' app. Please check /var/log/app_lifecycle.log for more details
Xiticks
Xiticks•4d ago
truenas shell again, can you sudo tail /var/log/app_lifecycle.log
Witherful_Life
Witherful_LifeOP•4d ago
No description
Xiticks
Xiticks•4d ago
Could you edit your Immich app And check the box "automatic permissions" below postgres Data storage
Witherful_Life
Witherful_LifeOP•4d ago
sure It's already checked
Xiticks
Xiticks•4d ago
can you show me the storage path in th econfig also? as well as here, if you click on pgData, can you show me the permissiosn?
Witherful_Life
Witherful_LifeOP•4d ago
Mean this?
No description
Witherful_Life
Witherful_LifeOP•4d ago
No description
Xiticks
Xiticks•4d ago
can you click on edit, next to permissions Then tick the boxes on the left side? so 'apply owner', 'apply group' and 'apply permissions recursively', then click on save? after which you try to start your Immich app again
Witherful_Life
Witherful_LifeOP•4d ago
Sure thing. Also apply permissions to child datasets?
Xiticks
Xiticks•4d ago
no need to
Witherful_Life
Witherful_LifeOP•4d ago
I can see my photos!
Xiticks
Xiticks•4d ago
so apply perms doesn't apply perms the way I thought it did, that's good to know Nice! So just to explain what happened Instead of rsync sourceFolder to destinationFolder, you rsynced sourceFOlder to destinationFolder/destinationFolder So Immich was acting like a brand new install as it was not able to read a single file/content (especially on the database side)
Witherful_Life
Witherful_LifeOP•4d ago
Ah, gotcha, so the data was one level deeper than immich was looking for.
Xiticks
Xiticks•4d ago
Yep but you had the issue for ALL folders
Witherful_Life
Witherful_LifeOP•4d ago
Makes sense.
Xiticks
Xiticks•4d ago
But so here, it's already on your new server?
Witherful_Life
Witherful_LifeOP•4d ago
Yup, that was launching from the new server, so should all b good.
Xiticks
Xiticks•4d ago
Yes! Migration should be a one time off, so you should be good for multiple versions! And you seem to be updating quite often, so that is good!
Witherful_Life
Witherful_LifeOP•4d ago
Awesome, ya, I figured I should do the folder migration since I'm moving to a new server anyhow.
Xiticks
Xiticks•4d ago
Well the old has been dprecated so you would have been forced to
Witherful_Life
Witherful_LifeOP•4d ago
Ya, couldn't update the old server any more. I try to update pretty often.
Xiticks
Xiticks•4d ago
Well I'm going off for the day, so glad I could help and we solved the issue Have a good day/night! (you can /close the ticket if you want to)
Witherful_Life
Witherful_LifeOP•4d ago
Awesome! Thank you so much! You are a life saver.
Xiticks
Xiticks•4d ago
No problem 🙂
Immich
Immich•4d ago
This thread has been closed. To re-open, use the button below.

Did you find this page helpful?