Replies: 2 comments 1 reply
-
Beta Was this translation helpful? Give feedback.
-
Okay, so this was frustrating, but I finally got it to work. The 'issue' is 1.136 which switched from relative to absolute paths. Changing the ENV doesn't fix this. So, trying to switch from docker to LXC with v1.136 means that the Postgres database has each thumbnail, file, profile picture as an absolute path inside the database:
Now, we could simply create a symlink, but I refused to do that. Seems just to be a whack workaround. docker exec -it immich_server /bin/sh
$ immich-admin change-media-location
...
? Enter the previous value of IMMICH_MEDIA_LOCATION: ./my-library
? Enter the new value of IMMICH_MEDIA_LOCATION: /usr/src/app/my-library
Previous value: ./my-library
Current value: /usr/src/app/my-library
Changing database paths from "my-library/*" to "/usr/src/app/my-library/*"
? Do you want to proceed? [Y/n] y
Matching database file paths were updated successfully! 🎉
You may now set IMMICH_MEDIA_LOCATION=/usr/src/app/my-library and restart! Unfortunately, with a fresh installation of the LXC this command won't work, because the environment variables and paths are not correct.
Script expects it at: For this I used a symlink: mkdir -p /opt/immich/app/server
ln -sf /opt/immich/app/dist /opt/immich/app/server/dist Let's try again: > cd /opt/immich/app && immich-admin
Initializing Immich
Detected CPU Cores: 4
Usage: main [options] [command]
Options:
-h, --help display help for command
Commands:
reset-admin-password Reset the admin password
enable-password-login Enable password login
disable-password-login Disable password login
enable-oauth-login Enable OAuth login
disable-oauth-login Disable OAuth login
list-users List Immich users
version Print Immich version
grant-admin Grant admin privileges to a user (by email)
revoke-admin Revoke admin privileges from a user (by email)
change-media-location Change database file paths to align with a new media location
help [command] display help for command Note that I changed directory first, if not, it will also complain about the missing Now, let's try change-media-location: > cd /opt/immich/app && immich-admin change-media-location
Initializing Immich
Detected CPU Cores: 4
Error: getaddrinfo ENOTFOUND redis
at GetAddrInfoReqWrap.onlookup [as oncomplete] (node:dns:111:26) {
errno: -3008,
code: 'ENOTFOUND',
syscall: 'getaddrinfo',
hostname: 'redis'
}
Error: getaddrinfo ENOTFOUND database
at GetAddrInfoReqWrap.onlookupall [as oncomplete] (node:dns:122:26) {
errno: -3008,
code: 'ENOTFOUND',
syscall: 'getaddrinfo',
hostname: 'database'
}
Unable to update database file paths. Yep, it connects to the wrong database and redis server. Using This is where I used a NPM package (ok, ok. Claude suggested it): > npm install -g dotenv-cli
added 11 packages in 472ms
4 packages are looking for funding
run `npm fund` for details
> dotenv -e ../.env node dist/main.js immich-admin change-media-location
? Enter the previous value of IMMICH_MEDIA_LOCATION: [/opt/immich/upload] Voilà. It works. I used Complete solution: echo 'export PATH="/opt/immich/app/bin:$PATH"' >> /etc/environment
source /etc/environment
mkdir -p /opt/immich/app/server
ln -sf /opt/immich/app/dist /opt/immich/app/server/dist
npm install -g dotenv-cli
cd /opt/immich/app
dotenv -e ../.env node dist/main.js immich-admin change-media-location |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hey there! I am trying to move my Immich instance from my docker server to the LXC version.
After hassling with Postgres and Vectors, I finally got it to start with my old database (Docker still uses 14, LXC uses 16, but I manually installed 14 and will later upgrade).
Now I ran into the next issue: Media Location
My docker-compose.yaml has it mounted with:
- ./data:/usr/src/app/upload
and in the .env:
UPLOAD_LOCATION=./library
Now, everything is located in
/opt/immich/upload/upload/{user-id}
, but Immich still tries to access the old location inside the docker container:I supppose the database has the full path?
I read on the breaking changes you can use
immich-admin change-media-location
, but this isn't working. I found it inside/opt/immich/app/bin/immich-admin
, but it's complaining about path, but when I add it to path, it then complains that I doesn't find/opt/immich/app/server/dist/main.js
Beta Was this translation helpful? Give feedback.
All reactions