36

Fellow self hosting friends, I screwed up. Not only have I deleted Immich's PostgreSQL folder but I also didn't have backups (of the database, of the photos I do).

I've tried to recover the deleted folder but there's not much left even with proper tools. I've checked and the photos are still there, so my question is: Is there a way for immich to rebuild the database with the photos there? Should I start from scratch and re-upload?

all 13 comments
sorted by: hot top new old
[-] gezero@lemmy.bowyerhub.uk 16 points 1 year ago

I am only a solo user that tried similar recovery.

There are several jobs in the admin section, one of them is "migrate the storage template" or something like this. I think that thing might do what you want. I would check that it is set properly depending on what you were using previously and rerun in. https://immich.app/docs/administration/storage-template/

I also wanted to mention that normally Immich dumps its own db into a file backup file somewhere. I forgot where. Check the database dump backup cron job in the settings.

[-] jeena@piefed.jeena.net 8 points 1 year ago

You can always add them as a external library

[-] webghost0101@sopuli.xyz 4 points 1 year ago

This does not help you but it makes me think of this:

I understand why it makes technical sense to do so but immich storing things in a database in general is more nuisance then practical.

We want those fotos accessible in our own file system where we have full control of what is what.

Immich job is to put the pictures from a phone to the server and also to display all pictures within a certain directory.

It does a good job at both. Having your own file structure is not a problem and it seem to even know and adapt if pics get moved around.

But we have to manually move the photos out of its own structure into our own every time we do a big upload.

Maybe i can set something up with syslinks so it all appears centralized as a big “upload” folder to be sorted.

[-] Infernal_pizza@lemm.ee 4 points 1 year ago

When you first set it up there is an option to set a custom filesystem, I selected that and then chose the default which just sorts by year and day

[-] webghost0101@sopuli.xyz 2 points 1 year ago

I am aware and actually use this but it appears too restrictive for our needs.

The structure we were already using cannot be recreated. Honestly i could live with the default. But my partner who is less into computers likes to make their own backups on external hard drives and uses shared network drives rather then the immich web viewer.

[-] tribut@infosec.pub 3 points 1 year ago

So use whatever you were using before and add that as an external library to immich?

https://immich.app/docs/features/libraries

[-] webghost0101@sopuli.xyz 2 points 1 year ago* (last edited 1 year ago)

I am, that works really well actually and it even knows when the same file was moved.

But to add new files to that external library, which is in fact the only main library. We need to dig in immich file structure which at the very least enforces different directories per individual user and also uses those to store some forms of metadata.

We tried sharing a user in the beginning but the app did not seem to like that.

Now its not the biggest deal, just an annoyance. the fix i am currently thinking is to move the immich directory to somewhere hidden and us systemlinks to get all uploads centralized under a single directory for further processing.

[-] MangoPenguin@lemmy.blahaj.zone 3 points 1 year ago* (last edited 1 year ago)

You can add your existing photos as an external library after starting from scratch with Immich, they'll show up just like before.

[-] corsicanguppy@lemmy.ca 2 points 1 year ago

Is immich still container-dependent?

this post was submitted on 01 Jun 2025
36 points (92.9% liked)

Selfhosted

63158 readers
659 users here now

A place to share alternatives to popular online services that can be self-hosted without giving up privacy or locking you into a service you don't control.

Rules:

Detailed Rules Post

  1. Be civil.

  2. No spam.

  3. Posts are to be related to self-hosting.

  4. Don't duplicate the full text of your blog or readme if you're providing a link.

  5. Submission headline should match the article title.

  6. No trolling.

  7. Promotion posts require active participation, with an account that is at least 30 days old. F/LOSS without a paywall has exceptions, with requirements. See the rules link for details. Tags [CBH] or [AIP] are required, see the links in Rule 8 for details.

  8. AI-related discussions and AI-involved promotional posts have additional requirements for tagging, as noted in Rule 7 and the AI & Promotional Post Expanded Rules post, and find example disclosures here.

Resources:

Any issues on the community? Report it using the report flag.

Questions? DM the mods!

founded 3 years ago
MODERATORS