Immich backup

Hi everyone,
I have been reading some forums on how to back up the Immich app in Scale. When I was reading the docs from Truenas it said I should use pgAdmin with heavyscript, but I along with many others was not able to do that. Is there a way that I can back up Immich photos and videos? Metadata isn’t that important to me (i.e. location and faces). Thanks!

1 Like

have you figured out how to do it?

No, I haven’t had that much time to mess around with it. I do know that you need to use the pg_dumpall command, but I haven’t tried it yet.
Backup and Restore | Immich

I don’t really have an answer, but it’s important to distinguish between the TrueNAS apps and the TrueCharts apps, as the answers will be very different between them. For TrueCharts, heavyscript and pgadmin would likely be involved, but I doubt that’d be the case for the TrueNAS apps.

Immich stores this in the library directory.

I used hostpath type configuration for the official TrueNAS Catalog and mapped mine here. It will organize everything based on the user, in my case admin and by year, e.g.:

root@prod[/mnt/ice/apps/immich/library/admin]# ls
2008  2011  2013  2015	2017  2019  2021  2023
2010  2012  2014  2016	2018  2020  2022  2024
root@prod[/mnt/ice/apps/immich/library/admin]# cd 2024
root@prod[/mnt/ice/apps/immich/library/admin/2024]# ls
2024-06-24  2024-06-26	2024-06-28  2024-06-29
root@prod[/mnt/ice/apps/immich/library/admin/2024]# cd 2024-06-24 
root@prod[.../immich/library/admin/2024/2024-06-24]# ls
 img_2129_iris3_stab_fixed.mp4	    img_2134_iris3_stab_fixed.mp4
'img_2131 2_iris3_stab_fixed.mp4'   img_2135_iris3_stab_fixed.mp4

You can backup the files however you’d like form here with ZFS Replication, RSYNC, etc.

So after messing around for some time today, there are a few ways to back up immich the easiest is going to be to do ZFS replication of the app as @NickF1227 stated. The other way is to use heavyscript and pgadmin as @dan has mentioned. from what I can tell it doesn’t matter if it is a TrueNas app or a TrueCharts app. Follow this guide to download heavyscript: GitHub - Heavybullets8/heavy_script: Bash script for managing Truenas SCALE applications, automatically update applications, backup applications datasets, open a shell for containers.
You have to scroll down to about the center of the page to get to how to download it.

Then follow this guide to connect immich to pg admin and backup:
[Guide] Database backup in Truenas · immich-app/immich · Discussion #8809 · GitHub