r/immich • • 12d ago

Backup Ideas

I have had an immich server running for a few months now. I currently run it on a raspberry pi 4b with 8gb of ram while using Tailscale for external connections at my home. I just recently got a second raspberry pi that I have set up at my apartment in a different location and want to start using it as a backup.

I really don't have any idea how to go about this and have been trying to research the best method. I would love to hear what methods some of you have used so that I can do this in a way that would be robust, easy to recover, and safe. I currently have two 500gb drives (one for each pi). This makes it a little difficult to take more than one copy of the photos at a time as a version snapshot. This worries me because if I set up an automated script to backup all my photos, and my first drive becomes corrupted, I don't want the backup to send the corrupted files to my second drive and also mess up my backup.

2 Upvotes

12 comments sorted by

7

u/ImpossibleSlide850 12d ago

I use restic to backup my immich server to a local HDD and cloud

2

u/Previous_Tea_2250 12d ago

The remote Pi can be a good second copy, but make the job versioned rather than a mirror. A sync that deletes or overwrites immediately can reproduce corruption; a backup repository with retention lets you roll back to a known-good date.

For Immich, make sure the backup covers both the library files and the database, then test restoring a small sample before trusting the whole setup. With only two 500 GB drives, I would start with one regular versioned off-site backup, keep several daily versions plus a few longer-lived ones, and set an alert so a failed job does not stay invisible.

3

u/Potential-Plankton98 12d ago

You you please explain in more detail what you mean with "versioned"?

2

u/Previous_Tea_2250 12d ago

Not another full 200 GB for every version if the backup tool deduplicates unchanged files: the first backup is roughly 200 GB, then later snapshots mainly consume space for new or changed files.

With a 500 GB destination, that still leaves only about 300 GB of headroom, so I would keep the retention modest and monitor it. For a photo library that mostly grows, a practical policy could be daily snapshots for a week plus a few monthly points, pruning automatically as space gets tight. The important part is using a real backup repository rather than a plain mirror, so an accidental deletion or corruption does not immediately become the only copy.

1

u/silver565 12d ago

I used to use rsync to copy my directories and the backup folder (db dumps) at 1am to another server. Which would then use restic.

I then moved off a Linux host to truenas when my library got too big for rsync to be efficient

1

u/nlflint 12d ago

I have a beefier server with a ZFS mirror. Then use the syncoid/sanoid to take and send snapshots to my other server (offsite, which also runs a ZFS mirror) on regular schedule every 4hrs.

That's 4 drives in total, two in each server.

1

u/milerebe 12d ago

I also have ZFS but snapshots for database backups are not such a good idea. For the photos themselves, sure.

1

u/nlflint 12d ago

My WAL and Database are on the same dataset, so the database will be consistent whenever a snapshot is taken. The WAL can be played back I ever needed to recover from a snapshot. Are you thinking of something else?

1

u/milerebe 11d ago

True, the WAL allows replaying, but a proper DB backup is considered the safe way of doing DB backups. Snapshot should work, but it's not guaranteed.

1

u/techbro- 12d ago

Today - I sync daily to an s3 storage (I use Backblaze B2, but any of them would do). So one on the server and one in s3 for safety.

My backup script has some basic checks like it will error out and send a notification if any of the backups is deleting 10k or more photos. So accidentally it does not clear out the s3 backup too in case of an error.

1

u/stray_r 12d ago

Backrest as a web UI for restic. Has a docker/podman image available. I back up my home server to a not-quite-pi with a USB SLED and a hetzner storage box depending what I'm backing up. Some stuff goes both places. Some only to the SLED

1

u/I-cey 12d ago

I had exactly the same worry a few months ago, so here's what I ended up with. My hardware is different (Immich on a small TrueNAS box, not a Pi), but the principles carry straight over.

The key insight: you don't want a copy**, you want** history**.**

A plain mirror (rsync --delete, Syncthing, etc.) will faithfully copy corruption, accidental deletes or ransomware to your backup. What protects you is versioning: the backup keeps older states, so if something goes wrong today, yesterday's version is still there. The nice part is that versions only cost the changes, not a full extra copy. Photos almost never change after upload, so a month of history on top of a 400GB library costs very little. Your 500GB drive is not a reason to skip snapshots.

My setup (3 copies, one of them offsite)

  1. Primary: Immich on a ZFS pool.
  2. Second local copy: nightly ZFS snapshots, replicated incrementally to a separate SSD pool. Snapshots are read-only, and the target keeps the same history. ZFS checksums every block, so silent corruption (bit rot) gets detected instead of quietly copied: sending a damaged block fails loudly instead of shipping garbage.
  3. Offsite: weekly encrypted sync to AWS S3 Glacier Deep Archive (rclone crypt via TrueNAS Cloud Sync). Versioning is on in the bucket, overwritten or deleted files are kept for 180 days, and the backup credential is explicitly not allowed to delete old versions or turn versioning off. So even if my server gets compromised, it can't wipe the offsite history. ~490GB costs me about $1/month. A full restore would be ~$40 (mostly egress), which is fine for a copy that's only for real disasters.