Quick guide Debian borgbackup on server

vs2-free-users

Active Member
Joined
Jun 8, 2023
Messages
251
Reaction score
117
Credits
1,685
Quick guide Debian borgbackup on server

Foreword

!!!IMPORTANT!!!
This is only a guide, everyone is the architect of his own fortune, think about what you are doing and test it with unimportant data. I AM NOT LIABLE FOR ANY LOSS OF DATA!


Since I have recently rebuilt my mail server and now want to set up a correspondingly newer backup system, I will write down my findings right away.
Since the vs2-free are mainly equipped with IPv6, I will always use the IPv6 version.

Setup (pure test setup mail server is a VS2-428 not vs2-free)

Host A vs2-free with booked and configured IPv4. Operating system Debian 12 (Bookworm) - 64Bit - minimal v4.
Host B vs2-cloud with booked and configured IPv4. Operating system Debian 12 (Bookworm) - 64bit - minimal v4.

Host A is the server to be backed up.
Host B is the server where the backups are located.

In my experiment, I only ever backed up /home1. Of course, it also works with other directories.

- Host B: Perform update and restart
Code:
apt update
apt -y upgrade
reboot

- Host B: Install Borg Backup
Code:
apt install borgbackup

- Host B: Set up Borg Backup repo and make a note of the password
Code:
mkdir -p /home/borgbackup/repo
borg init --encryption=repokey /home/borgbackup/repo

- Host A: Perform update and restart
Code:
apt update
apt -y upgrade
reboot

- Host A: Install Borg Backup
Code:
apt install borgbackup

- Set up SSH key authentication on host B (server) and host A (client)

- Host A: Create backup (is repeated for each backup, preferably as a daily cron job)
Code:
BORG_PASSPHRASE='<PASSWORD>' borg create --numeric-ids root@[<IPv6 Host B>]:/home/borgbackup/repo::backup-"$(date +'%Y-%m-%d-%H-%M-%S')" /home1

- Host A: Display backup statuses and search for the correct one
Code:
BORG_PASSPHRASE='<PASSWORD>' borg list root@[<IPv6 Host B>]:/home/borgbackup/repo

- Host A: Restore the wanted backup
Code:
cd /
BORG_PASSPHRASE='<PASSWORD>' borg extract --numeric-ids root@[<IPv6 Host B>]:/home/borgbackup/repo::<wanted backup>
 



Staff online

Members online


Top