Synchronize backups with remote servers (e.g. BorgBase) #2247
gbertolottiKS
started this conversation in
Wiki
Replies: 3 comments 3 replies
-
Wow @gbertolottiKS , thanks a lot, this is great! :) I will add it to the readme with #2249 |
Beta Was this translation helpful? Give feedback.
0 replies
-
Thanks for the instructions. |
Beta Was this translation helpful? Give feedback.
1 reply
-
We have created a new guide on how to use Borg and Borgmatic to make remote backups, in order to avoid making backups useless in case of a malware attack: #4391 |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
This guide aims to describe step by step what you need to do to synchronize backups created with Borg from Nextcloud AIO with an external server, so that you always have an up-to-date remote copy.
It describes in particular the flow, from start to finish, to use the BorgBase service, an open-source solution for backing up repositories based on Borg or Restic, but the same procedure can be adapted to any remote backup service: you simply need to generate an SSH key pair and have installed RClone on the Nextcloud server.
Let's get started!
BorgBase account creation
Register at https://www.borgbase.com and select a plan from those offered. However, all of them allow you to exceed the GB allowance by paying an additional fee.
SSH key pair creation
In order to perform any operation on BorgBase remotely, you need to create an SSH key pair (which can also be used for SFTP operations).
Follow this useful guide: https://docs.borgbase.com/faq/ssh/
⚠⚠⚠
Remember that a key pair must be generated for each server you want to connect, and for the user who will connect to the remote repository. As for Nextcloud backups, since they are created with root as owner, you must create a key pair for the root user
⚠⚠⚠
Creating repos on BorgBase
Manual import/export test
Import
Follow the official guide: https://docs.borgbase.com/setup/import/#import-existing-repository.
Two clarifications:
where
<user-name>
is the name of the user associated with the repoExport
Follow the official guide: https://docs.borgbase.com/setup/import/#export-existing-repository.
RClone installation and configuration
The following guide refers to Ubuntu servers; for other OS follow the official guide: https://rclone.org/install/
sudo apt install rclone
.rclone --version
rclone config
.Leave the default for all options, apart from the following info:
Example:
Test sync upload to BorgBase
Follow the command specified in the official guide: https://docs.borgbase.com/setup/import/#using-rclone .
In particular, the command must have the following format:
where
<local-path-borg-backup>
is the path where the folder of the Borg backup made by Nextcloud is located; the folder is configurable from the Nextcloud AIO interface.<config-rclone-name>
is the name assigned when configuring rcloneExample:
Scheduled job creation
The following steps have been adapted from the following documentation: https://github.com/nextcloud/all-in-one#sync-the-backup-regularly-to-another-drive
Create scripts
where
SOURCE_DIRECTORY
is the path where Nextcloud backups are saved (this is configurable from the AIO interface), andRCLONE_CONFIG
is the name of the previously defined RClone configurationSet crontab
sudo crontab -u root -e
That's all!
Beta Was this translation helpful? Give feedback.
All reactions