Immich Storage Location is Being Deprecated Issue

I’ve read the thread. I’ve managed to move over the data over to a new custom volume under the new storage configuration. However the database is still sitting in the old /mnt/.ix-apps/app_mounts/immich/pgData

When editing the settings for the Postgres Data Storage option inn the immich docker in the web interface its grayed out editing where the database sits. It says ixVolume (dataset automatically created by system)

The pgvecto image is mounting
/mnt/.ix-apps/app_mounts/immich/pgData to /var/lib/postgresql/data

Ah ok, I think the issue is that TrueNAS does not currently support moving a storage path for an existing app from an ix-volume to a host path. I’d forgotten about this restriction. This isn’t strictly related to the Immich app change but a side-effect of you having previously used ix-volumes for prod storage.

You’ll need to redeploy Immich to move to host path volumes, but I suggest creating a new thread about migrating your data so others can hopefully assist with making sure as much as possible is retained and restored.

thanks that explains a lot. In that case should I just do a backup / restore to the new app instance I install? Is it an actual problem for the future and does it for sure need me to migrate where the database sits?

Finally got it working. I think it goes faster if you exclude the --progress flag from the rsync commands. Also, in my case, may be the same for others, in the old storage config it was “uploads”, in the new it is “upload”. Thank you!

This is THE single most infuriating thing I’ve ever had to do in my entire life. I would not wish this upon my worst enemy. Why the eff do I need to learn about datasets and ACL permissions and doing a chown on the postgress-data which needs to be a dataset within a dataset, but “data” needs to be a folder, and ixvolumes etc. etc. etc. ?!? The nightmares induced by this operation will last with me for a long time. This is the complete opposite of user-friendly and will cause 99.99999% of people to do a fresh re-install of IMMICH or give up on it altogether. Please THINK before you make users perform this operation. What will the “user experience” be? Will you alienate your audience? Can this be done in a better way? And finally for eff’s sake why is this not a GUI operation in the jobs area of IMMICH?

For those also struggling, maybe my experiences can help others.
-I don’t upload anything into IMMICH.
-I use IMMICH exclusively as a photo gallery.
-I tell IMMICH that my photos are in an external library on an SMB share on my HTPC.
-I used all the default options during the installation on TrueNas Scale.
-One of those default options means using ixvolumes and not a host path. (Why is because I figured defaults are there for a reason and couldn’t imagine the nightmare it could become.)

Before doing this, I ran TrueNas in a virtual machine, so I backed up the entire VM so I can restore it if I screwed up. If you don’t have this luxury, find out how you can back up and then restore your config before you screw up trying to follow my instructions.
Given the above here’s what I had to do:

  1. Stop IMMICH (you don’t need to unset the pool under apps).
  2. Go to SYSTEM> Shell.
  3. Type: sudo -i
    and then enter your admin password.
  4. Type “zpool list”
    You should see a list of ZFS pools on your system, you need to identify the one that will have your IMMICH data. For me I had two pools - one called “HTPC” and another called “boot”. Obviously “boot” isn’t the one I want so it was “HTPC” for me as it’s the name I gave TrueNas when I pooled my disks in the first place.
  5. Next you’re going to list the datasets on the pool. Type in: “zfs list -r HTPC”
    (replace “HTPC” with the name of YOUR pool)
  6. You’ll see a breakdown of datasets. Look for the ones that have Immich in the name. For me I had Immich under “HTPC/ix-apps/app_mounts/Immich” and that had the mountpoint of “/mnt/.ix-apps/app_mounts/Immich”. Take a note of this, and better yet create a screenshot of the command from #5 above. Note that my mountpoint is .ix-apps - with a period. Pay attention to whatever your mountpoint is like.
  7. Go to TrueNas>Datasets.
  8. Identify a desired directory for Immich to “live” on. If you don’t have anything yet, under the root create a new dataset (preset = generic) and give it whatever name you like such as “Alex”. For me it was HTPC/Alex
  9. Next you’re going to begin to create a dataset for Immich under HTPC/Alex - use the dataset preset=“apps”. Result will be HTPC/Alex/Immich. This needs to be a dataset and not a folder even though in Windows Explorer they both appear as folders.
  10. The ACL permissions need to give the “netdata” user full control. (I also gave the “apps” user full control).
  11. Create another dataset under Immich called “postgres-data”, also use the “apps” preset. (Note the single “s” and the dash and not underscore.) Give it the same ACL permissions as the Immich dataset. Result should be “HTPC/Alex/Immich/postgres-data”.
  12. Create a “data” folder (NOT dataset) under Immich. Either do this from Windows Explorer (if you’ve set up SMB sharing) or run this from the Shell: mkdir -p /mnt/HTPC/Alex/immich/data/
  13. Then, you’ll make more folders (not datasets) inside data: “backups”, “encoded-video”, “library”, “profile”, “thumbs”, and “upload”. Either use Windows Explorer or use the following to create these: mkdir -p /mnt/HTPC/Alex/immich/data/{backups,encoded-video,library,profile,thumbs,upload}
  14. You will do the following commands one at a time from the shell (remember to do “sudo -i” if you get disconnected):
    rsync -a --info=progress2 /mnt/.ix-apps/app_mounts/immich/backups/ /mnt/HTPC/Alex/Immich/data/backups/
    rsync -a --info=progress2 /mnt/.ix-apps/app_mounts/immich/thumbs/ /mnt/HTPC/Alex/Immich/data/thumbs/
    rsync -a --info=progress2 /mnt/.ix-apps/app_mounts/immich/library/ /mnt/HTPC/Alex/Immich/data/library/
    rsync -a --info=progress2 /mnt/.ix-apps/app_mounts/immich/profile/ /mnt/HTPC/Alex/Immich/data/profile/
    rsync -a --info=progress2 /mnt/.ix-apps/app_mounts/immich/uploads/ /mnt/HTPC/Alex/Immich/data/upload/
    rsync -a --info=progress2 /mnt/.ix-apps/app_mounts/immich/video/ /mnt/HTPC/Alex/Immich/data/encoded-video/
    rsync -a --info=progress2 /mnt/.ix-apps/app_mounts/immich/postgres_data/ /mnt/HTPC/Alex/Immich/postgres-data/
  15. Given that I had 300+GB worth of data, this took a bit of time. The Shell does not time out for the current operation, but it will time out if no operation is running and it’s been ~3 minutes. If you’re not sure if the rsync has completed, simply re-run the command, it’ll verify the files are copied (happens very fast) and will resume if there’s anything that’s been missed. It’s safe to perform the rsync operation multiple times, you won’t create copies.
  16. You need to change ownership of the Immich/postgres-data dataset you created earlier by running the following command: chown -R 999:997 /mnt/HTPC/Alex/Immich/postgres-data (again, replace “HTPC” with whatever YOUR pool name is and the rest of the directory path with wherever you created Immich in)
  17. Under TrueNas>Apps>Immich>Edit - take a note of your Immich configuration as it is now - database/redis password, storage type (HDD/SSD), time zone, network configuration, “additional storage” configuration (I had SMB shares configured here), resource configuration. I took screenshots and saved on my computer.
  18. Now you need to uninstall (delete) the Immich app. Simply un-checking the checkbox for “Use Old Storage Configuration (Deprecated)” won’t work because the postgres data storage is greyed out.
  19. Begin installing Immich. (TrueNas>Apps>Discover Apps>Immich)
  20. First two things you should do are:
    Storage Configuration:
    Data Storage (aka Upload Location): use “host path” and point it to the data folder under immich that you created. In my case that’s /mnt/HTPC/Alex/Immich/data
    Second thing is Postgres Data Storage should be set to the Immich/postgress-data dataset you created earlier, in my case that’s /mnt/HTPC/Alex/Immich/postgres-data.
  21. I’m going to assume you did a chown as per step #17 above. Now - configure the “User and Group Configuration” section of the Immich install screen to “user ID = 999” and “Group ID = 997”. This step is because you did a “chown” on the postgres-data dataset and this essentially makes the “netdata” user the owner of it and also now you’re telling Immich to use that user as part of its operations. I don’t have patience anymore to find out what is user 568 (default user that Immich is asking for during install).
  22. Configure the rest of Immich with the settings you had noted as a part of step 18 above - postgres/redis passwords, additional storage, time zone, resource configuration, etc.
  23. Finish the install. Cross your fingers and toes.
  24. If this works, Immich is running - launch it to confirm all your stuff and settings are there. If not, ask Chat GPT - it’s what I had to use to figure all this out.

FYI I only went through this hell to save my computer from doing a month and a half of encoding at 100% CPU utilization (because VMWare Workstation does not allow neither my GTX 970 nor my i7-8700K’s iGPU to perform any GPU work on client machines despite “accelerate 3D graphics” being set). If it only took me less than a week to re-encode everything I would not be playing these “games”.

7 Likes

Huge props! helped tremendously, thank you!

This is why I recommend not using TrueNAS’s “community apps” version of Immich (or anything else really), and just installing it with docker-compose, as recommended in the Immich documentation. These community apps always have huge “gotchas” and problems because it’s just another layer of indirection on top of docker-compose and the underlying app. I had a bunch of problems with other community apps, like random changes to storage locations in app updates, before I finally gave up on the whole mess and installed Dockge and then installed all my apps inside that with plain ol’ docker-compose. It’s been smooth sailing ever since.

2 Likes

Hi all! Before I migrate to new Storage Config, can you tell me please will it be possible to set new pgdata (postgres-data) location in separate dataset? Because my immich data located on HDD dataset, but I want to store pgdata (postgres-data) on another SSD dataset so that all indexes with more IO works faster?

And second question - can I just move data to new location instead of copying it? My data size is pretty large :slight_smile:

I can answer your first question: yes you can, that’s how I have set up the new storage configuration.

1 Like

Regarding the second question - in theory I imagine you could, but make sure you have backups and I would recommend copying the files as described above out of sheer fear of losing anything.

Also, make sure you have backups. And, if you don’t already have them setup, make sure there are backups. :wink:

1 Like

Thank you! Moved everything successfully. But I’m getting error while starting immich:

2025-07-17 20:38:49.320415+00:00e[32m[Nest] 7  - e[39m07/17/2025, 11:38:49 PM e[32m    LOGe[39m e[33m[Microservices:StorageService]e[39m e[32mVerifying system mount folder checks, current state: {"mountChecks":{"thumbs":true,"upload":true,"backups":true,"library":true,"profile":true,"encoded-video":true}}e[39m
2025-07-17 20:38:49.325247+00:00e[31m[Nest] 7  - e[39m07/17/2025, 11:38:49 PM e[31m  ERRORe[39m e[33m[Microservices:StorageService]e[39m e[31mFailed to read upload/library/.immich: Error: ENOENT: no such file or directory, open 'upload/library/.immich'e[39m
2025-07-17 20:38:49.332232+00:00microservices worker error: Error: Failed to read "<UPLOAD_LOCATION>/library/.immich - Please see https://immich.app/docs/administration/system-integrity#folder-checks for more information.", stack: Error: Failed to read "<UPLOAD_LOCATION>/library/.immich - Please see https://immich.app/docs/administration/system-integrity#folder-checks for more information."
2025-07-17 20:38:49.332277+00:00at StorageService.verifyReadAccess (/usr/src/app/dist/services/storage.service.js:84:19)
2025-07-17 20:38:49.332289+00:00at async /usr/src/app/dist/services/storage.service.js:38:21
2025-07-17 20:38:49.332302+00:00at async /usr/src/app/dist/repositories/database.repository.js:385:27
2025-07-17 20:38:49.332311+00:00at async /usr/src/app/node_modules/kysely/dist/cjs/kysely.js:535:20
2025-07-17 20:38:49.332320+00:00at async DefaultConnectionProvider.provideConnection (/usr/src/app/node_modules/kysely/dist/cjs/driver/default-connection-provider.js:12:20)
2025-07-17 20:38:49.332393+00:00at async /usr/src/app/dist/repositories/database.repository.js:382:13
2025-07-17 20:38:49.343908+00:00microservices worker exited with code 1
2025-07-17 20:38:49.344069+00:00Killing api process

My new data structure contains data dataset with proper folders:

truenas_admin@T-Storage[/]$ ls -l /mnt/Main/immich/data
total 15
drwxrwxr-x 2 root root 17 Jul 17 02:00 backups
drwxrwxr-x 3 root root  4 Dec  9  2024 encoded-video
drwxrwxr-x 3 root root  3 Jul 17 23:22 library
drwxrwxr-x 3 root root  4 Dec 10  2024 profile
drwxrwxr-x 3 root root  4 Dec  9  2024 thumbs
drwxrwxr-x 3 root root  4 Dec  9  2024 upload

And app settings points to /mnt/Main/immich/data:

Data Storage (aka Upload Location):
Host Path (Path that already exists on the system)

Host Path:
/mnt/Main/immich/data

Any ideas? Thank you.

I believe I had the same issue, for several of the subfolders. I kept thinking it was a permission issue but I couldn’t put my finger on it. Out of ideas, I tried going to the subfolder specified in the error message (/mnt/Main/immich/data/library in your case) using the TrueNAS shell, to then execute the command touch .immich. And it worked!

I don’t know if this is a bug, but it doesn’t seem like something I’d have to do. I still won’t entirely rule out that this is indeed a permission issue, but Immich has been running fine for me ever since I did that in all the affected subfolders.

1 Like

Thank you all! I’ve successfully migrated, and Immich is now running.
For anyone facing similar challenges, here’s a summary of my process that might help:

Initial Setup Before Migration:

Library was stored on an HDD dataset named immich with the following child datasets:

/mnt/Main/immich/backups
/mnt/Main/immich/library
/mnt/Main/immich/profile
/mnt/Main/immich/thumbs
/mnt/Main/immich/upload
/mnt/Main/immich/video

Postgres data was stored on an SSD dataset named immich for faster I/O, with the child dataset:

/mnt/Apps/immich/pgData

Migration Process
My library is quite large (~1TB), so instead of using rsync for everything, I reorganized it via the SSH terminal as truenas_admin:

  1. Since the library child dataset (/mnt/Main/immich/library) was the largest, I renamed it to data:
sudo zfs rename Main/immich/library Main/immich/data
  1. Created a library directory inside the newly renamed data dataset and moved the existing subfolder (admin in my case) into it:
mkdir /mnt/Main/immich/data/library
mv /mnt/Main/immich/data/admin /mnt/Main/immich/data/library/
  1. Used rsync to transfer the other Immich library datasets into subfolders within the data dataset with appropriate naming:
sudo rsync -avh --info=progress2 /mnt/Main/immich/backups/ /mnt/Main/immich/data/backups/
sudo rsync -avh --info=progress2 /mnt/Main/immich/profile/ /mnt/Main/immich/data/profile/
sudo rsync -avh --info=progress2 /mnt/Main/immich/thumbs/ /mnt/Main/immich/data/thumbs/
sudo rsync -avh --info=progress2 /mnt/Main/immich/upload/ /mnt/Main/immich/data/upload/
sudo rsync -avh --info=progress2 /mnt/Main/immich/video/ /mnt/Main/immich/data/encoded-video/
  1. Removed the old datasets via the TrueNAS UI:
/mnt/Main/immich/backups
/mnt/Main/immich/profile
/mnt/Main/immich/thumbs
/mnt/Main/immich/upload
/mnt/Main/immich/video

Postgres Data Migration:
I followed a similar approach for the Postgres data by renaming the dataset:

sudo zfs rename Apps/immich/pgData Apps/immich/postgres-data

New Storage Configuration:
Library is now on the HDD dataset immich with a single child dataset:

/mnt/Main/immich/data

Postgres data remains on the SSD dataset immich for faster I/O, with the child dataset:

/mnt/Apps/immich/postgres-data

TrueNAS Immich App Settings:
After reorganizing the storage, I updated the Immich app settings in TrueNAS:

  1. Unchecked Use Old Storage Configuration.
  2. Set Data Storage (Host Path) to /mnt/Main/immich/data
  3. Set Postgres Data Storage (Host Path) to /mnt/Apps/immich/postgres-data

Handling errors:
When starting the Immich app in the TrueNAS UI, check the server logs for issues:

1. If you encounter an EACCESS error, such as:

Failed to write upload/encoded-video/.immich: Error: EACCES: permission denied, open 'upload/encoded-video/.immich' 

Adjust the data dataset permissions:

  • In Immich app settings, under Storage Configuration, enable Enable ACL and Force Flag.
  • Add two ACL entries: user ID 568 with Modify Access and user ID 999 with Modify Access.

2. If you encounter an ENOENT error, such as:

2025-07-17 20:38:49.325247+00:00e[31m[Nest] 7  - e[39m07/17/2025, 11:38:49 PM e[31m  ERRORe[39m e[33m[Microservices:StorageService]e[39m e[31mFailed to read upload/library/.immich: Error: ENOENT: no such file or directory, open 'upload/library/.immich'e[39m
2025-07-17 20:38:49.332232+00:00microservices worker error: Error: Failed to read "<UPLOAD_LOCATION>/library/.immich - Please see https://immich.app/docs/administration/system-integrity#folder-checks for more information.", stack: Error: Failed to read "<UPLOAD_LOCATION>/library/.immich - Please see https://immich.app/docs/administration/system-integrity#folder-checks for more information."

Manually create the .immich file in the specified path via SSH, in my case:

sudo touch /mnt/Main/immich/data/library/.immich

Hope this will be useful for someone, thanx again!

2 Likes

p.s., obviously STOP Immich app before migration and DO backup your data :slight_smile:

hey! i’m trying to setup an instance of immich using the new storage location config. thanks all for help with rsync instructions

i’m running into a postgres issue - it seems like i’m entering the wrong db password in the TrueNAS app configuration. My immich server logs have:

2025-07-22 02:00:43.893446+00:00microservices worker error: PostgresError: password authentication failed for user "immich", stack: PostgresError: password authentication failed for user "immich"

i’ve tried restarting the app with the password as ‘postgres’, ‘password’, and a base64 decoded POSTGRES_PASSWORD value i found in /mnt/pool/ix-applications/backups/system-update--2024-09-19_01:04:06/immich/secrets/immich-postgres-creds. i can’t remember if i configured a password when i was last setting everything up :frowning:

i found some older forums where others had similar errors but haven’t found a solution yet. i’ve tried seeing if i can forcibly reset a postgres password - i tried opening a shell into the pgvecto container but didn’t have any luck launching psql, even though it’s installed

i’m not sure if there’s a default password i should be using? or what y’alls ideas are.

i was optimistically searching for a ‘regenerate database’ button in the admin settings but i don’t believe that exists currently.

i’ve read a little about the additional storage options - not sure if this is something i should look into more. re-adding all of my images through the web app seems tedious (i have +1TB data)

I just wanted to say this helped me as a user who is trying to install Immich on a fresh install of Truenas Scale.

Below is some lines in bash if you ssh in, it’s easier to create the required folder directory.

mkdir -p /mnt/homelab-storage/immich/data/{upload,library,thumbs,profile,video,backups,encoded-video}
mkdir -p /mnt/homelab-storage/immich/postgres

# default user provided by apps
chown -R 568:568 /mnt/homelab-storage/immich/data

# https://forums.truenas.com/t/immich-storage-location-is-being-deprecated-issue/45930/7
chown -R 999:999 /mnt/homelab-storage/immich/postgres

# perms
chmod -R 770 /mnt/homelab-storage/immich/data
chmod -R 770 /mnt/homelab-storage/immich/postgres

FYI I came here because I encountered the same error

middlewared.service_exception.CallError: [EFAULT] Failed 'up' action for 'immich' app. Please check /var/log/app_lifecycle.log for more details

The error in the logs wasn’t descriptive to really nail down the exact issue:

[2025/07/23 22:49:56] (ERROR) app_lifecycle.compose_action():56 - Failed 'up' action for 'immich' app:  Network ix-immich_default  Creating\n Network ix-immich_default  Created\n Container ix-immich-permissions-1  Creating\n Container ix-immich-permissions-1  Created\n Container ix-immich-redis-1  Creating\n Container ix-immich-pgvecto-1  Creating\n Container ix-immich-redis-1  Created\n Container ix-immich-pgvecto-1  Created\n Container ix-immich-server-1  Creating\n Container ix-immich-server-1  Created\n Container ix-immich-permissions-1  Starting\n Container ix-immich-permissions-1  Started\n Container ix-immich-permissions-1  Waiting\n Container ix-immich-permissions-1  Waiting\n Container ix-immich-permissions-1  Exited\n Container ix-immich-pgvecto-1  Starting\n Container ix-immich-permissions-1  Exited\n Container ix-immich-redis-1  Starting\n Container ix-immich-redis-1  Started\n Container ix-immich-pgvecto-1  Started\n Container ix-immich-redis-1  Waiting\n Container ix-immich-permissions-1  Waiting\n Container ix-immich-pgvecto-1  Waiting\n Container ix-immich-permissions-1  Exited\n Container ix-immich-pgvecto-1  Error\n Container ix-immich-redis-1  Healthy\ndependency failed to start: container ix-immich-pgvecto-1 is unhealthy\n

Hey y’all.

Running into the same sort of issues as mentioned here. My main question is this:

I’m currently putting all of my thumbs, postgres data, profile, and encoded videos onto the SSD (using about 300GB/2TB of my drive atm), and the library and uploads folders are on my HDD in another dataset.

It seems like the way the folders are grouped by default with the new storage config requires either only the postgres-data on SSD or nothing on SSD. How do I instead split things up a bit more so that I can utilize my SSD like how I was previously?

It seems like the devs (is this a TrueNAS thing or an immich thing?) are implying that only postgres db needs to be on SSD. Is this really the case? I imagine that having more of those small files on SSD would be preferred.

The deprecated storage structure I’m using now:

/mnt/immich-ssd/          ← on your NVMe/SSD volume
├── database/              
├── backups/              
├── encodedvid/           
├── mlcache/              
├── profile/              
└── thumbs/               

/mnt/immich_data/         ← on your HDD volume
├── uploads/ 
└── library/

Thanks!

Hello folks,

I’ve run into the same issue and followed the same steps some of you outlined here.
However, I still have a major issue, which prevents me from using my old db configuration.
Once I created the new datasets and folders, moved all the files in the new folders, and deselected the old storage option, all the thumbs and files were not available anymore.
Digging more into the Postgres DB, I found the issue:
in several tables there is a path to the file, for example in asset_file table, the path is: upload/thumbs/bb463fb6-175c-4288-9cfc-659b823e5972.
But in the pgvector container, the volumes are now mounted inside the data folder, not the asset folder.
I confirmed this by trying a fresh install of the app Immich, and the same table has the path: /data/thumbs/2148955c-f35b-491c-af7d-494ffe506265/....

I appears the migration for me either is not using the right mount volume path, or some db migration didn’t happen.

Do you know how I can fix this? Is there a way to enforce the volume bind in docker to the old folder? I would prefer not to run manually a script in the db to change all the paths, there are many many tables with the path recorded.

Sorry, I meant the upload folder, not the asset folder. I could not edit the original message