parent
ca245cb46c
commit
a93b877a6a
25
content/blog/2024-08-19-borgtastic-backups.md
Normal file
25
content/blog/2024-08-19-borgtastic-backups.md
Normal file
@ -0,0 +1,25 @@
|
||||
---
|
||||
date: "2024-08-19T20:58:00Z"
|
||||
title: "Borgtastic Backups"
|
||||
description: "My discovery of Borgmatic and discussion around how this tool makes my backups much easier to manage in various use-cases."
|
||||
tags: [technology, selfhost]
|
||||
slug: "borgtastic-backups"
|
||||
---
|
||||
|
||||
[Restic](https://restic.net) has been my go-to backup tool for many years, and I've used it for a wide range of workloads -- including for managing [filesystem](https://git.wilw.dev/wilw/fs-backup), [Postgres](https://git.wilw.dev/wilw/postgres-backup), [Photoprism](https://git.wilw.dev/wilw/photoprism-backup) and [Vaultwarden](https://git.wilw.dev/wilw/vaultwarden-backup) backups. At the point I was researching suitable backup options for these cases, and considering my personal requirements, I was often stumbling upon discussions comparing Restic to a similar tool -- [Borg backup](https://www.borgbackup.org) -- but I eventually settled on using Restic myself, due to its flexibility and the amount of data (measured in terabytes) I intended to backup.
|
||||
|
||||
In addition to the handy utilities and ease of backup encryption, what drew me to these two tools in particular was their ability to easily provide incremental backups and snapshots -- something I wasn't sure other tools, such as [Rclone](https://rclone.org), could do.
|
||||
|
||||
Borg is itself not limited in terms of the size of the archives it backs-up (in fact, it is often more performant than Restic in terms of compression and computation), but the deployment of Borg remote targets was such that the cost of backing-up large volumes of data would be prohibitively expensive. Restic, on the other hand, does not require any remote processing and can directly work with low-cost object storage providers, such as [Backblaze B2](https://www.backblaze.com/cloud-storage). At the time, workflows along the lines of Rcloning a local Borg repo to cheap object storage didn't cross my mind.
|
||||
|
||||
Either way, more recently, I've been swept up in further online discussions comparing the two tools. One particular thread I saw (I don't remember where) mentioned a tool called Borgmatic; not something I had heard of before. After some research, the strengths of this system quickly became apparent.
|
||||
|
||||
In its simplest form [Borgmatic](https://torsion.org/borgmatic) is a collection of utilities for Borg backup, exposed primarily via a handy and easy-to-craft [configuration file](https://torsion.org/borgmatic/docs/reference/configuration/). A single such file can be used to define multiple backup targets and repositories, immediately removing some of the pain in complex commands and backup scripts that reference `borg` commands directly.
|
||||
|
||||
Personally, one of my favourite features is Borgmatic's ability to directly [backup databases](https://torsion.org/borgmatic/docs/how-to/backup-your-databases/). Particularly useful to me is that MongoDB and PostgreSQL database backups are achievable with only a few configuration lines, with the appropriately relevant `dump` commands being used behind the scenes to ensure data correctness. Borgmatic can also automatically [restore databases](https://torsion.org/borgmatic/docs/how-to/backup-your-databases/#database-restoration) if needed.
|
||||
|
||||
Other useful features are its built-in checks and [monitoring](https://torsion.org/borgmatic/docs/how-to/monitor-your-backups/). I schedule manual backup "checks" (in addition to tests) on a semi-regular basis, but being able to skip the "are things actually be being backed-up" segment of this would be welcomed.
|
||||
|
||||
Borgmatic's "official" [Docker image](https://github.com/borgmatic-collective/docker-borgmatic) makes deployment super simple, and also includes the ability to specify a cron-based backup schedule using environment variables.
|
||||
|
||||
Along with the reduced overheads in managing Borgmatic-based backups (try saying that ten times quickly), and given the added ease of Borg-compatible services such as [BorgBase](https://www.borgbase.com) (which also include their own monitoring), I plan to complete migrating some backups to this new system -- particularly databases, which are less about data volume (in my cases) and more about fiddly configuration, to which Borgmatic is highly suited to solve.
|
Loading…
Reference in New Issue
Block a user