TrueNAS Scale - Import "ix-apps" data into new dataset
Hiya! Im having some issues that are driving me crazy. First I will give some context.
The server is a TrueNAS Scale version Fangtooth 25.04
- Main server motherboard died, gave me some issues with the LAN port
- Uninstalled immich thinking it was an issue of the program (Huge mistake)
- Changed the motherboard and LAN works perfecty
[ Instert here endless hours trying to debug why installing it on the IXVolume doesn't work ]
- I try installing Immich but instead of installing it on the /mnt/.ix-apps folder I made a new dataset as the docs suggests https://immich.app/docs/install/truenas
The server is working again, but my issue is that I have like... 20gb of pictures saved on a backup, but i cannot access them... and I would really love to be able to import them back to the server because there are plenty of them that will be lost forever.
I've been working on it about... +10 hours during this whole week and im out of resources to work with.
- Old path: /home/truenas_admin/immich-old
- Folders inside:
backups data library postgres_data profile thumbs uploads video
- New Path: /mnt/RAIDZ2/immich-data/
- Folders inside: data pgData immich-old
[ immich-old is the backup ]214 Replies
:wave: Hey @MonsBaan,
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.
Successfully submitted, a tag has been added to inform contributors. :white_check_mark:Some good news, i've being able to import images.
Bad news, they dont load

Im going to wait a few minutes, lets see if giving it some more time, fixes it
This just looks like the thumbnails not loading
What if you regenerate them on one?
How can i do that?
Im rn afk, i guessed that It needed time to load all the thumbnails and images
Because It only loaded a few videos without thumbnail
Still generating them then
WELL! Im right back at home
I thought you restored a backup but you just re-uploaded?
It generated them
But the dates are all broken
I never had a backup... I restored the whole folder because when i uninstalled it, i didnt delete the storage things
But as i said, the timeline died a bit hahahah

The backup was right inside of
backups
Though 👀oh
well, im going to try that right now
that's a database backup, you need the files in UPLOAD_LOCATION too fyi
Either way im going to make a pretty explanation about what happened to me, maybe someone will have the same problem as me (and how to fix it, obviously)
Is there a shell command that may bring that info? To speed up the process
oh nevermind, found it
Well, im having some issues
It seems like its not creating the directories

I checked the link that appears in the log, but I cant find anything that may help
https://immich.app/docs/administration/system-integrity/#folder-checks
Restoring the backup includes restoring the folder structure and .immich files
I think i understand, but i dont really understand what you mean
Basically if you restore the database, it will expect all other files to be in place
This means anything under UPLOAD_LOCATION
oh, so i just dump all the folders in there
Yeah that'll do it
great, thanks!
So... this is what i had as a backup, it still misses some files
and the error still appears
I've tried reinstalling it from scratch and it still appears :/
is the file in place?
Does the container have permissions to read it
It should have i gave the data folder a chown to 568:568 and to the pgdata a chown to 999:999
The backup? Is there a place where it should be?
(im thinking maybe the "backup" folder)
No, I meant the .immich file
it's over at wherever you mounted /data/encoded-video
Uh... im not aware of that file
data folder is empty for some reason
Because you're supposed to restore it from UPLOAD_LOCATION like I said
Did you try to copy/paste the postgres folder instead?
Yeah
Did you read the link at all? 😛
Yeah, but the "UPLOAD_LOCATION" confuses me
oh the webpage is down, maybe because of the update
The database dumps do NOT contain any pictures or videos, only metadata. They are only usable with a copy of the other files in UPLOAD_LOCATION as outlined below.
/home/truenas_admin/immich-old
this is your old upload_location
The new one is /mnt/RAIDZ2/immich-data/data
I ... think because truenas does weird things sometimesyeah...
Instead of docker compose down, i have to uninstall it completely and install it
Because ✨ trueNAS ✨
Well, I have no idea why but the data folder is empty
Sorry if im too thickskulled, im still learning homeservers
You're doing fine by not deleting your old data 😛
I just don't know that much about truenas really
There's a #truenas channel too
oh, didn't know
SO, I have some questions, maybe they are stupid, but my brain is not braining
When you say "Because you're supposed to restore it from UPLOAD_LOCATION"
I go to the old location and do this stuff?

You could try and mount the old locations and do that yes, but typically if you have the space you make a new location, copy/past everything inside the data directory from old to new, that'd be data, encoded-video, library, backups ... everything except the postgres folder.
Then you'd follow the guide there, so mounting a backup to the postgres container and using the CLI command to restore it
Oh hey XIticks is typing
He's the resident truenas expert 👀
MY HERO!
yeah sorry, I'm a little busy atm (in 40 minutes I should be ok)
but yeah to restore it's this command, but
1) you have to adapt it for trueNAS
2) you'll have to reinstall Immich, because you needed to restart it with an env varibale
Because now the command won't run
In advance... Im a baby with server stuff and TrueNAS, every help that you provide even if its dumbed down, i would accept it
restoring a backup is a true learning experience
Dont worry, i can wait. Here in spain is getting late, but if i have to stay up all night, I WILL
You also learn not to reinstall too fast :3
Yeah, i have that issue normally HAHAHAHAH
"Oh it doesnt work" presses the nuke button
But so, now, you have the new structure with a data folder (datasets) with all folders, except th phBackup? and a second for postgress database?
I have a Dataset with 2 folders, data for immich data and pgdata, nothing more nothing less
To be clear

And you already started your new Immich and pointed it to these 2 datasets or not?
Yeah, the data one pointing to data the postgress to pgData.

Mmh yeah, so delete the immich app, and recreate the pgDataset (if nothing is in it)
What do you mean "recreate the pgDataset"? (Feeling rn like 👶 )
Delete the pgData « folder » and create it again
perfect
thanks for making it for dummies🤣
I feel bad because you may be thinking: God this lad doesnt know shite
OH great everything's running

So... the next step should be...
restoring the old files
No no
What did you do?
nothing!
Stop immich first
Then recreate pgDara
ok
I just installed immich, then everything launched automatically
ok, so i recreate pgData, on it
You have to install it with a environment variable
Let me 5 min
sure thing
Thanks for your time
arf immich.app seems down ?
i didnt understand that one
the documentation website haha
Oh yeah
Died when the update announcement dropped
Im working with the wayback machine rn HAHAHA
So! I didn't do anything since this. I only stopped the service. Immich's still installed
So, you can reinstall Immich, but you add the variable DB_SKIP_MIGRATIONS
great
on it
and you set it's value to true
May i have an explanation on where you found that?? To understand it and process it
In the installation of the app, there is a section environment variable with an add button
I think it is at the beginning
Sending this just to be sure

I mean on the documentation :P
There is none
But yes I think this is correct
Ok, clicking install
oh, so... how you knew what to add? Im actually curious
Immich will not start (it is normal)
well it exists, in the backup process page that Mraedis linked
... i just saw that
well... it deployed
I stopped it as soon as i could
No let it run
I meant that you won't be able to access it on webui
oh
thats right, server- exited
This appears in the logs if it helps

Ok so I've the time now
Well, I think that is ok?
yeah, it seems like its ok (kinda)
So first, you can copy your old data to the new data dataset (the "folder")
its going to take a while
Do you still have all of theses folders somewhere? In immich old
backups data library postgres_data profile thumbs uploads video
Wait what is this structure ?
I do

what do you mean "structure"
Why is there data in there
on the old one?
Im not understanding sorry D:
so in Immich old, there is "data" I don't get what it is
oh, its empty
no idea
and is backups also empty?
Nope, backups exists from 2025 08 24 to 2025 09 06 (the day my server died)
and for postreg_data?
a bunch of files and folders

ok, so what you can do it
sudo rsync -av /home/truenas/immich-old/library/ /mnt/RAIDZ2/IMMICH/data/library/
sudo rsync -av /home/truenas/immich-old/backups/ /mnt/RAIDZ2/IMMICH/data/backups/
sudo rsync -av /home/truenas/immich-old/profile/ /mnt/RAIDZ2/IMMICH/data/profile/
sudo rsync -av /home/truenas/immich-old/uploads/ /mnt/RAIDZ2/IMMICH/data/upload/
mkdir /mnt/RAIDZ2/IMMICH/data/encoded-video && touch /mnt/RAIDZ2/IMMICH/data/encoded-video/.immich
mkdir /mnt/RAIDZ2/IMMICH/data/thumbs && touch /mnt/RAIDZ2/IMMICH/data/thumbs/.immich
on it
each command one after the other
Thanks for the commands!
go it, baby knows some stuff >:)
this way you'll copy all relevant folders (and their content) inside the data dataset (dataset and folder are alike but not the same)
I think i remember... rsync is like cp but with symbolic links?
Mmmh I'm not sure about that, I just know that it is aware of the destionation, so if the copy fails, rsync will only "copy" the missing files and not create duplicates
oooh, got it
Oh I forgot
you could add --info=progress2 just after the -av
so it gives you a progress bar
oh! dw
my processor decided to go ZOOM

did you already do the rsync before?
nope
first time doing it really
how sent is != from received then
I tried to do
It seems that "File exists", i suppose that's good
Oh yes, you started Immich
So they should exist
ooh that makes sense
sudo du -sh /mnt/RAIDZ2/IMMICH/data/library/
No idea really
could you do that? And
sudo du -sh /home/truenas/immich-old/library/
and share the resutls?sure thing


im as confused as you
Oh yeah, no, that might make sense, not sure it "copied" as it is in the system dataset and in a dataset, maybe it works differently
Everything ready for the next step then!
Well, anyway
So your last backup is the one where your server died?
yeah
So no media has been added afterwards, right?
it was impossible, the NIC decided to blow up
And because I love to press the big red button that says "NUKE" I reinstalled trueNAS
so, now that the website is back, it is how I know

But so now you can run the restore backup
gunzip --stdout "/path/to/backup/dump.sql.gz" | sed "s/SELECT pg_catalog.set_config('search_path', '', false);/SELECT pg_catalog.set_config('search_path', 'public, pg_catalog', true);/g" | docker exec -i immich_postgres psql --dbname=postgres --username=<DB_USERNAME>
But you have to change stuffDB Username right?
and the name of the container
Other things also
yes
and the path of the dump
immich_postgres should be something like ix-immich-postgres-1
do a docker ps in your terminal so it lists all the docker
the path of the dump is the backup file i suppose
ix-immich-pgvecto-1

yeah so it something like /mnt/RAIDZ2/IMMICH/data/backups/NAME_OF_LAST_BACKUP
perfect, what i supposed
Im not that lost then!
No, you already figured out you had to change the name of the container (which most people woudln't even have thought off)
I know a bit of stuff, mostly self taught. But when I happen to encounter something like this i collapse and need some "big rigs" of a brain to help me out
The docker stuff also on the gunzip shell?
wdym?
docker exec -i immich_postgres psql --dbname=postgres --username=immich
That is a single command
OH
makes sense then
I changed it
I looked like when you put this format
Yeah, I copied it from web, and there are the backslashes so it's a single command if you copy the whole thing
but so change the name immich_postgres
should i run this as sudo?
throws a permission denied
sudo su
then re run the command
WOAH, ITS MAKING STUFF
SQL STUFF
YAY
(It should lol)
Btw, did you set the same password as before in your Immich app config?
Please i hope this thing works... its being +14h of suffering
yup
OK, nice, we won't need to change it then
Lmk when the sql stuff is done
done
Ok, so now edit Immich, and remove the environment var you added previously and update the app
on it
Done
Deploying
hm, server exited
Can you try to see the logs when it restart
(might be tricky, but it would indicate what is wrong)
yeah it seems im an idiot
wrong password
2025-09-12 21:04:22.920131+00:00PostgresError: password authentication failed for user "immich"
Oh well, double check that
otherwise we can change it
I only have 2 passwords on server apps.. i hope it works
because otherwise im cooked
RUNNING
WE WIN
nah, as I said, we can change it anyway
I suppose you don't see any thumbnails?
or the'yre blurred
They are blurred and the image doesnt show
That is normal, can you try to download it? (It's just to be sure that images are available)
so on the 3 dots menu, there is dowload button somewhere
you don't need to see the image to do that
They download
Ok, so you can rerun the jobs to generate the thumbnails and encode the video
ok i know where that is
OK its working then

wait that ain't that
but yes
there is also another job att the bottom
Im going to start every single one of them
NUKE BUTTON
https://my.immich.app/admin/jobs-status
That is a better link
Should i see... something??

set a link to your immich instance and save it
oh
then the link will redirect to the thing I linked
Oh yeah, the page where i was at
YAY! Thumbnails working
But yes, so in theory now, all your data is in IMMICH/data and the database is in IMMICH/pgData
So you could delete your old data
Or at least, maybe store them in a "better" place
Y u p
Thank you so heckingmuch
I was losing hope
No problem!
Well TrueNAS does it things on its own, but it's not too hard to not mess up, as long as you don't delete data, you can resotre stuff most of the time
And thank you for the baby steps, i really appreciate it
And now, even you you nuke Immich, as everything are in host datasets, you could reinstall it and point the the existing dataset and it should work
Yeah!
No problem! It's also easier for me so I don't have to explain eveything or try to understand what you did 😄
With my dead motherboard I learned that restoring data is not as dificult as i thought
3 clicks
Well, you still must have backups
Because if it's not a dead mobo, but a dead pool, then you're screwed
Im going to set up the 3-2-1
thats for sure
As for backups for the whole server, im counting on the RaidZ2 to tank the heavy hits
Btw, if you plan on cloud backups (or even backups) you could ignore the encoded-video and thubmnails folders, as they can be regenerated
great!
Raid is not a backup (but is still better than nothing at all)
oh, fair enough
And on more advanced setup for Immich/TrueNAS you can have separate datasets (even on separate pools) to manage your backups and your data more efficiently
You lost me there
Brain not braining it seems
2sec,ill show my setup
sure!


DAMM
I just use my server to host immich, and AMP for the minecraft servers HAHAHAHAHA
This way my thumbnails and postgress are on SSD (load faster)
And with encoded-video also appart I can decide not to replicate it
I've a lot of apps on trueNAS, because I like the simple Update button and not have (most of the time) to worry with breaking changes
And how you separate it on the immich app? With external libraries?
and I've a second server that runs other dockers that are
kind of
It is in the Immich truenas documentation
You dont see me, but im doing mental backflips rn

Oooh i supposed right then!
https://immich.app/docs/install/truenas/#additional-storage-advanced-users
In the
Multiple Datasets for Immich Storage server section
This is similar for external libraries
ooooh
As long as the ACL permissions are set correctly, it works
Well... about ACL permissions, with this thing working...
now i can waste my time debugging why... SMB SHARE IS NOT SHARING
Maybe you can close this ticker
i will
and go to #truenas
for that
Yup! I was counting on it
(create a thread there too)
Thank you a lot, again
You too @Mraedis
Closing the ticket!
What did I do? :clueless:
(Next time, you can ping me lol)
You know what you did...
Hey it's weekend everywhere
And for me starts with a bang!!
This thread has been closed. To re-open, use the button below.