Tag: backups

  • My 3-2-1 backup plan (and the gaps I found)

    Self-hosting means my photos, files and passwords live on my own hardware, which also means I’m responsible for not losing them. Here’s how my backups work today, the weak spot I’ve found, and the plan for my new 10 TB drive.

    The 3-2-1 rule

    The classic rule for backups that actually save you:

    • 3 copies of your data (the original plus two backups)
    • on 2 different devices or types of media
    • with 1 copy kept off-site

    Each part protects against something different: a failed disk, a corrupted backup, or a fire or burglary that takes out everything in one place.

    Where things stand today

    • Immich photos: backed up to an 8 TB external drive.
    • This blog: backed up nightly to the same drive (database plus site files, 14 days kept).
    • PCs and the Raspberry Pi: backed up daily to the same drive by UrBackup.
    • Vaultwarden: backed up nightly to a separate machine on my network, a Raspberry Pi, and to the 8 TB drive, with 30 days kept. Each backup is a consistent database snapshot that’s checked for corruption before it’s saved.
    • Nextcloud files: live on the 8 TB drive, and that’s currently their only copy.
    • Docker compose files: on the server’s system disk, without a separate copy yet.

    The weak spots

    The 8 TB drive was bought second-hand and arrived with some remapped sectors. A full surface scan found no new bad sectors developing, and Scrutiny now tracks its health every day, but it’s still a used drive carrying a lot of responsibility.

    More importantly, almost all of the backups sit in or next to the same box as the originals. A disk failure is covered, but a power surge, fire, theft or mistyped command could take out the originals and the backups together. The password vault is the exception, because its backups also go to the Pi. Everything else needs a copy that lives somewhere else. That’s what the new drive is for.

    The plan for the 10 TB drive

    Diagram of the 3-2-1 backup plan: the home server holds the live data (copy 1), nightly backups go to the 8 TB ExtStorage drive (copy 2), and a weekly full copy goes to a new 10 TB drive (copy 3) that is rotated off-site. Included: Immich photos and database, Nextcloud files, Vaultwarden vault, WordPress site, Docker compose files, and PC and Pi backups.
    Three copies, two devices, one off-site.
    1. Copy 3: a new 10 TB drive gets a full copy of everything important, refreshed regularly.
    2. Off-site: between updates, the drive lives away from the house, ideally with family. It’s unplugged, so ransomware or a bad command can’t reach it.
    3. Encrypted: an off-site drive can be lost or stolen, so the backup on it should be encrypted.

    Tools I’m considering

    • rsync: simple and reliable. It mirrors folders exactly, but a mirror also copies mistakes, such as deleted files.
    • restic: encrypted, deduplicated snapshots. You can go back to any earlier version, and it only stores the changes, so many snapshots fit on one drive. This is my likely pick.

    Whatever the tool, the most important step is testing a restore. I’ll regularly restore a few photos, a Nextcloud folder and the blog from the backup drive, and check they work.

    What I’ll include

    • The Immich photo library and its database dumps
    • Nextcloud data
    • The Vaultwarden data folder
    • WordPress backups
    • All Docker compose files and configs in /opt/stacks
    • The UrBackup store with the PC and Pi backups

    I’ll write a follow-up once it’s up and running, with the exact commands.

  • UrBackup: backing up every computer in the house

    My home server doesn’t just back up itself. It also backs up the other computers in the house. UrBackup is the open-source server that does it, quietly, every day, with no subscription.

    What UrBackup does

    UrBackup is a client/server backup system. You run the server on one machine, install a small client on each computer you want protected, and the server pulls backups over the network on a schedule:

    • File backups: incremental and full copies of chosen folders, with deduplication so unchanged files aren’t stored twice.
    • Image backups (Windows): a full disk image you can restore a whole PC from, even onto a new drive.
    • A web interface for status, settings and browsing or downloading backed-up files.

    I use it to back up my Windows PC and a Raspberry Pi, with everything stored on the large external drive in my server.

    My setup

    services:
      urbackup:
        image: uroni/urbackup-server:latest
        container_name: urbackup
        restart: unless-stopped
        network_mode: host
        environment:
          - PUID=1000
          - PGID=1000
          - TZ=Europe/Dublin
        volumes:
          - /opt/stacks/urbackup/data:/var/urbackup
          - /media/ExtStorage/backups/urbackup:/backups
    • network_mode: host lets clients on your network discover the server automatically, using UDP broadcasts.
    • /backups is where the backups themselves go. Point it at a big disk.
    • /var/urbackup holds the server’s own database and settings. Keep it on a reliable disk too.

    The web interface runs on port 55414: http://<server-ip>:55414.

    Adding a computer

    1. Download the client for Windows, Linux or macOS from the UrBackup website and install it.
    2. On the same network, the client finds the server by itself, and it appears in the web interface within a minute or two.
    3. In the client (Windows tray icon), choose which folders to back up, or let it use the defaults.
    4. Adjust the schedule and how many backups to keep under Settings in the web interface.

    Restoring

    • Single files: browse the backups in the web interface and download what you need, or restore from the client.
    • A whole Windows PC: boot from the UrBackup restore image on a USB stick and restore an image backup to the disk.

    Test a restore now and then. A backup you’ve never restored from is only a hope.

    One important caveat

    UrBackup stores its backups on my server, so if something happens to the server itself, the PC backups go with it. That’s why they’re part of my 3-2-1 backup plan, which copies everything important to a second drive kept away from the house.