Replies: 6 comments 5 replies
-
Hi there, thanks for the excellent guide! I'm encountering an issue at Step 6:
Any idea on a solution? It doesn't seem to be permissions related, but at the same time the language does suggest as much. |
Beta Was this translation helpful? Give feedback.
-
To complete my migration I also needed to import my database backup. After making my files available using the above how-to (partly) I did the following to restore the database of my Docker setup to the LXC installation. Warning Make sure you have backups in place and are working on the correct system etc. No warranty for the steps below.
To list the databases and the privileges:
I had some minor issues with differences between permissions of the |
Beta Was this translation helpful? Give feedback.
-
Hi Thanks a lot for the amazing guide. I notice that when immich is creating files it creates them readable only by the immich user. How do I get it to automatically create the files so that they are readable by the group/all? |
Beta Was this translation helpful? Give feedback.
-
Running into DB restore issues, anyone else see it ? I followed the above steps to recreate the immich db and get the following when I attempt a restore: $ gunzip --stdout "/mnt/immich/backups/immich-db-backup-1751156950651.sql.gz" \
| sed "s/SELECT pg_catalog.set_config('search_path', '', false);/SELECT pg_catalog.set_config('search_path', 'public, pg_catalog', true);/g" \
| sudo -u postgres psql --dbname=immich --username=immich
...
COPY 59511
ERROR: relation "public.face_search" does not exist
...
invalid command \N
invalid command \N
...
ERROR: syntax error at or near "3038832"
LINE 1: 3038832 Vila 1.56654 42.53176 AD 03 2024-11-04 Encamp
^ |
Beta Was this translation helpful? Give feedback.
-
Also pardon my ignorance but where does |
Beta Was this translation helpful? Give feedback.
-
For your advanced setup wouldn't it make more since to place upload/library on the NAS instead of upload/upload? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Immich in an LXC
Love Immich? Hate Docker? Me too! That's why I wanted a Proxmox Helper Script for the best open-source, self-hosted photo management software to ever exist.
So the script is here, and it seems to work, and it's huge and kind of complex. Let's go over what the script CAN do and what it CANNOT do.
✅ Can do
🚫 Cannot Do
/opt/immich/upload
.Since so far we've been receiving feedback that the major problem people are having is related to using a different upload folder (with good reason!), this guide is mainly geared towards attempting to demystify that part.
📁 The upload Folder
It's located by default in
/opt/immich/upload
, on the same disk as the LXC itself. Definitely not ideal, since you're gonna have to continuously increase the size of the disk as you add more media. I'd wager that pretty much all of us use some kind of NAS, which is likely on completely different disks, and that's where we want to store our Immich uploads.It defaults to where it does because there are many different ways to configure storage on Proxmox, and the script is unable accommodate them as well as properly setup permissions in each use case. So this is left up to you to figure out. That being said, this guide is not going to cover how to properly mount a network share in your LXC, aside from the fact of whether you should choose to create an unprivileged LXC or a privileged LXC.
❓ Choose Privileged if...
immich
user can write to the share.❔ Choose Unprivileged (default and recommended) if...
/etc/subuid
and/etc/subgid
entries on your Proxmox host.Needless to say, regardless of the path you choose, you should have this figured out before proceeding. But to be a good sport and to get you started, I'll say you need to learn about how unprivileged LXCs operate in relation to the host, and how to leverage that to be able to mount a writable share in your Immich LXC. Try this writeup for a good starting point. And now, the GUIDE.
⚙ Changing the Immich upload directory in your Immich LXC
systemctl stop immich-web immich-ml
/opt/immich/.env
) to reflect your chosen mount pointnano/vi /opt/immich/.env
Look for
IMMICH_MEDIA_LOCATION
and change it to the path of your bind mount.For example, say your bind mount is at
/mnt/immich
. Do this:Save and close the file.
root
user can write to the folder. Even if you haven't uploaded data, there are files in each of those folders that must also be present for this to work.cp -a /opt/immich/upload/* /mnt/immich
(or whatever your location is)You want the folder structure to look like this:
And within each of those dirs there should be an
.immich
file, and potentially a folder with a long alphanumeric name which is your user ID, if you have existing uploaded content.Delete these symlinks:
Recreate them so they point to your new location:
So the folders should look like the below:
Confirm ownership of the Immich folder in case it's changed.
chown -R immich:immich /opt/immich
Restart Immich services and tail the web log, then go check out your Immich feed and open an image.
You need to check Immich because if you messed up or skipped the symlink thing, if you only check the log things will seem fine. As soon as you try to look at your timeline (all thumbnails blurred) or open a photo (it won't load), then you'll see the problem.
rm -rf /opt/immich/upload
That should be it.
📝 A Note About Updating
During the update process, the script deletes everything in the
/opt/immich/app/
directory, including those symlinks. But they get recreated, using the information from your .env, whereIMMICH_MEDIA_LOCATION
will point to your current upload directory! So you do not need to recreate anything yourself.🚀 Advanced Settings
I mentioned earlier that my setup is a bit different, which caused me to overlook the symlink step. I actually have not changed
IMMICH_MEDIA_LOCATION
in my .env file. Instead I made an additional symlink from/opt/immich/upload/upload
to my bind mount. I did this because I prefer to store the thumbnails, encoded videos and other data on the LXC (for the responsiveness and speed), while storing the photos themselves on the NAS. So far this has worked out for me, but keep in mind that if you want to do this, thumbnail and encoded video data do take up space on your LXC disk, so you'll have to make sure you increase your LXC disk size accordingly. You can also customise this to your liking, for example create another symlink for/opt/immich/upload/backups
to your bind mount, to store the DB backups on your NAS (I might do this myself).Steps (Photo files only, as an example)
**If you have any existing data in the
/opt/immich/upload/upload
folder, you better copy/move it to your bind mount location! And make double-certain that your destination has a.immich
file (you can simply create an empty one if needed).Delete the
/opt/immich/upload/upload
dir, leaving the others intact.rm -r /opt/immich/upload/upload
Create the symlink(s) and restore ownership
Looks like this:
OK, that's all folks! If you think anything in this guide can be made more clear and/or explicit, or if you find any errors, please let me know and I will fix 👍🏼
Beta Was this translation helpful? Give feedback.
All reactions