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.
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
: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.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?
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.
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?
Sure thing. Here's a screenshot.

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
Sure, here is the new server's pgData structure:

New servers' datasets

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?Here you go

no cd again in a directory (upload for example)
and do the ll there

Yep
What did I do? lol
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?
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.

Maybe I just goofed the Remote path.
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
ok, immich stopped. ok, so like this?

yes, for each





Should be it, backups, encoded-video, library, profile, thumbs, upload.
yes, these are correct,
it's just that you have nested folders
but no worries
so now, can you cd back into pgData please
sure
pgdata

ok, run this
and then do ll again

Oh well ok
so now do
mv ./pgData/* ./
and redo a llGotcha

ok, now do
rm -r pgData
done
ok, so now cd back into data
and do
Ok done

Well mb on that
should have been this, sorry
Ok, so just run the second one then?
yes, run that
Ok, I ran that and went back into backups

what the?
ok now, while inside backups do
rm -r ./backups
Ok, it removed backups

that is correct
so go back into data
And do this one

Nice, so we keep going
Gotcha
(keep sharing the output, so I'm sure it worked correctly)
Ok, I get most of what's going on here, lol.

well that shouldn't be this output
Ya, I figured.
cd into library (only once) and do ll

cd again into library and do ll again?
like the nested library

That make sense then, as it's "empty"
so go back into data and simply run
ok, done

```
now this
It might also throw an error
Ya, same

yeah so simply
I rather do the first to be sure that we keep everything


Looks like the nested profile is gone now.
yeah, it's fine
Cool
Now this one

Noice
So now for the latest and most important:

yeah you forgot to delete the ~ at the end
but that is fine
Now
you can start your Immich app
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
truenas shell again, can you
sudo tail /var/log/app_lifecycle.log

Could you edit your Immich app
And check the box "automatic permissions" below postgres Data storage
sure
It's already checked
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?
Mean this?


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
Sure thing.
Also apply permissions to child datasets?
no need to
I can see my photos!
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)
Ah, gotcha, so the data was one level deeper than immich was looking for.
Yep
but you had the issue for ALL folders
Makes sense.
But so here, it's already on your new server?
Yup, that was launching from the new server, so should all b good.
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!
Awesome, ya, I figured I should do the folder migration since I'm moving to a new server anyhow.
Well the old has been dprecated so you would have been forced to
Ya, couldn't update the old server any more. I try to update pretty often.
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)
Awesome! Thank you so much! You are a life saver.
No problem 🙂
This thread has been closed. To re-open, use the button below.