Moving library path
I'm going to move my library from HDD to SSD, and their label is different.
Currently my path is
/media/4TB/immich/
and the new one will be /media/STORAGE/immich/
.
What's the process so everything keeps working?
Would it be a matter of updating file paths in the db?
What would be the right command to do so?40 Replies
:wave: Hey @Chaos,
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:Just bring the stack down. Move all the folders that you want to the new location (Not sure if you just have a single upload location, or custom locations setup). Update the env to point to the new location, and bring the stack back up
oh really? It will update the db automatically? That's great
The db doesn't keep the file system paths. It just knows the container paths.
but if I check the db right now (while the library is doing a backup and the server is off) it shows originalpaths showing the full path. You mean they'll get updated as soon as the server starts with a new env, right?
@schuhbacca Please confirm when you can before I mess up
The full path on your actual host machine? Or the full container path eg: usr/src/app/upload/ etc
let me see, because I'm running it in Home Assistant, and db and Immich are 2 separate addons/containers
Oh, home assistant I have no idea
This is all default docker compose recommendations
Home assistant may do things way different
yeah but the process is the same
the db tables won't be any different in HA

I just can't guarantee it there but I would hope it would be the same
here you go, you can see originalPath showing the path visible to the container (to all containers in HA really)
Honestly I can't confidently say
in my case, that 4TB is the drive label, which will change
could you check your db to see if originalPath shows a similar path?
You can’t change the right side of the mount point. Idk how to change the source (left) side in home asst
We don’t support or recommend that deployment
Yeah mine shows the container path
I don't follow. Can you please elaborate?
Not really, idk how it’s setup on home asst
what does that mean? Sorry I'm not handy on docker or containers
You could reach out to them or their docs. I’m just describing normal docker setup
yeah I udnerstanmd, but can you clarify what you meant with right and left? With an example ideally

Normal docker volume mounting
Left is host, right is container
does the db live in the same container?
They are seperate containers in the docker setup
so then the OriginalPath in your db is what?
/usr/src/app/external/photos
?
so it's the same in HA really
I just want to know if when changing the env, the server will run something on server start that will updatee the paths in the db (because at the end of the day, that needs to happen, either auto or manually)For the external library yes. For the internal it's just /data/library/...
Like we said, we have no idea. Home assistant could set things up differently, we really only support the default setup
I understand. Does that mean I cannot ask some guidance to figure things out myself though?
You certainly can, we just may not know or may inadvertently steer you wrong. So your at your own risk basically
The server will not handle or detect any of those changes
ofc
cool, that was my guess tbh. I think I will still do a test boot and see the errors happen, just to make sure as it should be harmless.
So I'd need to manually run a db query to update all the assets paths, right? Can someone help me with that? Otherwise I'll try AI for guidance
Just to recap.
1. It's an external library.
2. Your current Import path in Immich settings is like
/media/4TB/immich
3. Could you post your Immich volumes:
section? I guess the external library (directory) is mounted approximately like:
- /media/4TB/immich:/media/4TB/immich
4. You are going to move files on host from 4TB to STORAGE
5. And switching to smth like
- /media/STORAGE/immich:/media/STORAGE/immich
?
(In principle, you can choose more storage-agnostic internal path, such as /photo
. Then upon changing/moving on-host, only compose volume definition has to be updated: /media/4TB/immich:/photo
-> /media/STORAGE/immich:/photo
, everything will be /photo/...
inside the Immich container and the database)1. No, it's not an external library.
2. Yes.
Probably that's not how the Home Assistant addon is set up. In HA there's a setting that passes the env for all immich content.

I just tried, and guess what, it was much easier than expect. The addon maintainer had already thought of this and implemented the thing.
it just updated all db paths for me automatically after changing the env path
That’s immich, not the addon maintainer. This is such a weird path for an internal library, pretty surprised
I wish they had a more standard deployment but glad it worked
huh? How can it be Immich? That was my initial question all along and all of you explained that it didn't make sense in the default setup because the path would be relative to the container.
For future tickets, when you ask questions here we always assume a "normal" deployment, HA Addon is very much not normal
https://github.com/immich-app/immich/blob/147accd9579b6d7800a62cdbe5824a1ded1da85b/server/src/services/storage.service.ts#L122-L125
Yeah, seems HA manages
IMMICH_MEDIA_LOCATION
var, then Immich detects the changeI'll still leave this here in case someone needs doing this manually. The Query to update all paths in the db.
yeah, I'm def aware, that's why I always mention it (I thought I did but it seems this time I forgot)