Hey there,
I’m in need of a bit of wisdom here:
I recently got myself a shiny new Vserver and have it running exclusively with docker containers that use regular volumes.

Now: how would I back this thing up? I mean, I have read a lot about borg for example, but I’m not sure how to do it the right way:
Do I just copy / to a repo and fiddle the data back in place if stuff goes wrong, or would it be wiser to backup the volumes, do a docker save and export the images to a folder and then send that to the storage box?

Since docker should stop the containers to prevent data inconsistency during a backup: How do I tell Borg to do that? I’ve seen several approaches (Borg Dockerized with some sort of access to docker’s .sock, Borg setup on the host, and some even wilder approaches).

Since Backups aren’t something you can “try again” once you need them, I’d rather have a solution that works.

@Dave@lemmy.nz
link
fedilink
English
7
edit-2
1Y

For my personal stuff, I use docker compose to create bind mounts for all volumes (including databases). These are all within a docker-compose directory. Then I use a cron job to shut down the containers, then zip up the docker-compose directories and start the containers again.

It’s important to shut them down so anything in RAM is written to disk.

The way to make sure your backups are working is to regularly restore from them (generally into a VM for me).

The way to make sure your backups are working is to regularly restore from them

Just here to echo this. Hope is not a plan.

Taking a backup is a warm fuzzy. Restoring is a nail biter.

Dandroid
link
fedilink
English
31Y

I wanted to migrate to a bigger SSD. I did it by backing up my old one with rsnapshot then restoring onto a fresh Linux install on the new SSD. I had to update /etc/fstab to mount my new SSD instead of my old one, and that was it! Easy peasy. Now I have backups and restores tested, too. And then I just set up a cron job to keep backing everything up nightly.

Create a post

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:

  1. Be civil: we’re here to support and learn from one another. Insults won’t be tolerated. Flame wars are frowned upon.

  2. No spam posting.

  3. Posts have to be centered around self-hosting. There are other communities for discussing hardware or home computing. If it’s not obvious why your post topic revolves around selfhosting, please include details to make it clear.

  4. Don’t duplicate the full text of your blog or github here. Just post the link for folks to click.

  5. Submission headline should match the article title (don’t cherry-pick information from the title to fit your agenda).

  6. No trolling.

Resources:

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

Questions? DM the mods!

  • 1 user online
  • 127 users / day
  • 422 users / week
  • 1.16K users / month
  • 3.85K users / 6 months
  • 1 subscriber
  • 3.68K Posts
  • 74.2K Comments
  • Modlog