Skip to content

Commit 03e3b10

Browse files
committed
Add remaining articles, redirects and images.
1 parent d540f14 commit 03e3b10

23 files changed

+411
-14
lines changed

_config.yml

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ baseurl: ""
44
url: "https://docs.borgbase.com"
55

66
permalink: pretty
7+
include: ["_redirects"]
78
exclude: ["README.md", "Rakefile"]
89

910
search_enabled: true

_redirects

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
/linux/how-to-restore-files-from-a-borg-backup-using-the-command-line/ /restore
2+
/backup-strategy/steps-with-template/ /strategy
3+
/macos/how-to-backup-your-mac-using-the-vorta-backup-gui/ /setup/vorta
4+
/linux/how-to-create-a-ssh-key-on-macos-or-ubuntu-debian/ /faq/ssh
5+
/linux/setup-borg-command-line/ /setup/cli

automation.md

+53
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
---
2+
title: Automation
3+
nav_order: 4
4+
layout: page
5+
description: ""
6+
---
7+
# How to Incorporate BorgBase into your Automated Deployment Workflow
8+
Modern IT would be impossible without automation. We provide the tools to make reliable backups a part of your deployment workflow.
9+
10+
## Ansible Role for Borg Backup Client
11+
12+
This role will install Borg Borgmatic and a cron job on a Linux (tested on Ubuntu/Debian/CentOS/Fedora) client. Learn more on the [Github page of the project](https://github.com/borgbase/ansible-role-borgbackup).
13+
14+
## Ansible Module to set up BorgBase Repo
15+
16+
BorgBase user [@adhawkinsgh](https://twitter.com/adhawkinsgh/) created a range of Ansible modules that interact with the BorgBase API for a fully automated setup. These roles will also set up new repos and SSH keys with BorgBase.
17+
18+
For details see the [Github repo](https://github.com/adhawkins/ansible-borgbase) or the [in-file documentation](https://github.com/adhawkins/ansible-borgbase/blob/master/borgbase_repo.py).
19+
20+
## API
21+
22+
The GraphQL API used by the web interface is also available to automate tasks, like adding keys and repos.
23+
24+
You can use the Python sample client to communicate with this API or implement your own. The full documentation can be accessed via the GraphiQL interface at [https://api.borgbase.com/graphql](https://api.borgbase.com/graphql).
25+
26+
Interfacing with GraphQL is relatively easy and can be done with any tool or library that can do POST requests. To get you started we provide the following [Python client](https://github.com/borgbase/borgbase-api-client) as example. It simply wraps the Python `requests` package and provides sample GraphQL queries.
27+
28+
Example usage:
29+
30+
```
31+
from borgbase_api_client.client import GraphQLClient
32+
from borgbase_api_client.mutations import *
33+
34+
client = GraphQLClient()
35+
client.login(email='xxx', password='xxx')
36+
37+
new_key_vars = {
38+
'name': 'Key for VM-004',
39+
'keyData': 'ssh-ed25519 AAAAC3Nz......aLqRJw+dl/E+2BJ xxx@yyy'
40+
}
41+
res = client.execute(SSH_ADD, new_key_vars)
42+
new_key_id = res['data']['sshAdd']['keyAdded']['id']
43+
44+
new_repo_vars = {
45+
'name': 'VM-004-test',
46+
'quotaEnabled': False,
47+
'appendOnlyKeys': [new_key_id],
48+
'region': 'us'
49+
}
50+
res = client.execute(REPO_ADD, new_repo_vars)
51+
new_repo_path = res['data']['repoAdd']['repoAdded']['repoPath']
52+
print('Added new repo with path:', new_repo_path)
53+
```

faq/faq.md

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
title: FAQ
3+
nav_order: 6
4+
layout: page
5+
description: ""
6+
has_children: true
7+
---

faq/ssh.md

+75
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
---
2+
title: New SSH Key
3+
nav_order: 1
4+
layout: page
5+
parent: FAQ
6+
description: ""
7+
---
8+
# How to Create a SSH Key on macOS or Ubuntu/Debian
9+
10+
### Introduction
11+
SSH (or Secure Shell) was invented as a more secure replacement for **telnet**. It is used to connect to a remote server and run command, transfer files or forward traffic. If you do anything remotely related to server or websites, you probably heard about it.
12+
13+
BorgBackup also uses SSH to securely connect to a backup server and transfer files. It does this by starting another server on the remote end, which makes it quicker than using SFTP (a subset of SSH to transfer files) directly.
14+
15+
To use SSH, you need a keypair, which consists of a public- and a private key. The private key should always stay on your local machine. The public key can be added to remote services (like BorgBase), so you can authenticate yourself to the remote service. This is more convenient and secure than using a password because a key is much longer than a typical password.
16+
17+
## Step 1 – Ensure OpenSSH is available
18+
OpenSSH is the default SSH server- and client used on most Linux distributions and on macOS. It comes with utilities to generate keys. It's already pre-installed on macOS. On Ubuntu or Debian it will be installed most of the time. Run the following command to make sure it works:
19+
20+
```
21+
$ ssh-keygen
22+
```
23+
24+
If OpenSSH is already installed, you will see output like this. Cancel the command with **Ctrl-C** and proceed to step 2.
25+
<div class='code-label'>ssh-keygen sample output</div>
26+
```
27+
Generating public/private rsa key pair.
28+
Enter file in which to save the key (/Users/manu/.ssh/id_rsa):
29+
```
30+
31+
If the above command gives an error, you can still install OpenSSH using this command on Ubuntu or Debian. On other distributions this may differ.
32+
```
33+
$ apt-get install openssh-client
34+
```
35+
36+
## Step 2 – Create Keypair
37+
As computers get faster, encryption needs to adjust. That's why the recommended key algorithm and key length has changed over the years. As of 2018 the recommended key setting[^1] [^2] is:
38+
39+
```
40+
$ ssh-keygen -t ed25519 -a 100
41+
```
42+
43+
This will generate an Ed25519 key, which is shorter and faster than a comparable RSA key. If you prefer to use the older RSA format or because you have an older OpenSSH version, you can also use:
44+
45+
```
46+
$ ssh-keygen -t rsa -b 4096 -o -a 100
47+
```
48+
49+
After choosing an appropriate key format- and length, the command will ask you a series of questions regarding place to save the key and password. Using the default location in `~/.ssh/id_ed25519` or `~/.ssh/id_rsa` is generally OK and OpenSSH will easily find keys later. Optionally you can also use a password and store it in macOS' Keychain later.
50+
51+
## Step 3 – Using the Public Key Part for Backups
52+
When done, you will find your newly-generated key in `~/.ssh`. To view your public key:
53+
```
54+
$ cat ~/.ssh/id_ed25519.pub
55+
```
56+
57+
Or if you chose a RSA key
58+
```
59+
$ cat ~/.ssh/id_rsa.pub
60+
```
61+
62+
This will print your **public** key. (Please don't upload your private key.)
63+
```
64+
ssh-ed25519 AAAAC3NzaC1lZDI...LqRJw+dl/E+2BJ manu@nyx
65+
```
66+
67+
You can now simply copy it to the clipboard and add it to [BorgBase.com](https://www.borgbase.com) under **Account** > **SSH Keys**.
68+
69+
When adding a new backup repository, you can choose any of your SSH keys. It's good practice to have one keypair per-server or machine. So each machine can only access its own backups.
70+
71+
During repo initialization, Borg will simply use the key without any further settings.
72+
73+
### References
74+
[^1]: [Secure Secure Shell](https://stribika.github.io/2015/01/04/secure-secure-shell.html)
75+
[^2]: [What are ssh-keygen best practices?](https://security.stackexchange.com/questions/143442/what-are-ssh-keygen-best-practices)
Loading
Loading
Loading
Loading
Loading
Loading
70.7 KB
Loading
80.9 KB
Loading
28.3 KB
Loading
58.2 KB
Loading
24.8 KB
Loading
51.6 KB
Loading
Loading

index.md

+22-7
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,33 @@ description: ""
66
permalink: /
77
---
88

9-
# Focus on writing good documentation
9+
# BorgBase Documentation Centre
1010
{: .fs-9 }
1111

12-
Just the Docs gives your documentation a jumpstart with a responsive Jekyll theme that is easily customizable and hosted on GitHub Pages.
12+
All the resources you need to develop a comprehensive backup strategy with [BorgBase](https://www.borgbase.com) and apply it in your environment.
1313
{: .fs-6 .fw-300 }
1414

15-
[Get started now](#getting-started){: .btn .btn-primary .fs-5 .mb-4 .mb-md-0 .mr-2 } [View it on GitHub](https://github.com/pmarsceill/just-the-docs){: .btn .fs-5 .mb-4 .mb-md-0 }
16-
1715
---
1816

19-
## Getting started
17+
## Steps to Get Started
18+
19+
### Your Backup Strategy and Data
20+
Even the best tools need a sound strategy. Get started by creating an inventory of your important data assets, catalog where they are stored and discover potential issues in backup workflows. [More...](strategy)
21+
22+
### Sign up with BorgBase
23+
BorgBase is a dedicated hosting service for Borg backup repositories. It allows you to manage all your backups in one place and use powerful Borg features, like append-only mode in a simple way.
24+
25+
### Local Borg Setup
26+
Borg Backup works with most operating systems, like Linux, macOS and Windows WSL. For servers and headless systems, look into our [Command Line Setup Guide]. For desktops, we recommend using our desktop client, [Vorta](setup/vorta).
27+
28+
### Automation
29+
Use our GraphQL API or Ansible role to automate repeated setup steps on client endpoints. [More...](automation)
30+
31+
### Restore Data from a Backup
32+
How to restore files from a Borg Backup. [More...](restore)
33+
34+
---
2035

21-
### Dependencies
36+
## Contribute and Customize
2237

23-
Just the Docs is built for [Jekyll](https://jekyllrb.com), a static site generator. View the [quick start guide](https://jekyllrb.com/docs/) for more information. Just the Docs requires no special Jekyll plugins and can run on GitHub Pages' standard Jekyll compiler.
38+
Borg and most other tools we provide are fully open source. You can customize and improve them to a degree that wouldn't be possible with commercial products. Look at our [Github page](https://github.com/borgbase) for ongoing open source development.

restore.md

+153
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,153 @@
1+
---
2+
title: Restore
3+
nav_order: 5
4+
layout: page
5+
description: "Learn to browse and mount a Borg repository and then restore file in bulk using the `borg extract` command."
6+
---
7+
8+
# How to Restore Files from a Borg Backup Using the Command Line
9+
10+
Note: You should be comfortable using the command line. If you prefer a graphical, client, look into our [Vorta Tutorial](/macos/how-to-backup-your-mac-using-the-vorta-backup-gui/) instead. These instructions should work on macOS and popular Linux flavors, like Debian, Ubuntu, as well as Red Hat, Fedora and CentOS.
11+
12+
## Goals
13+
This article assumes that you have set up a backup workflow to a local or remote Borg repository. Now you would like to restore files from it. Borg offers two different ways to restore files. The `borg mount` command allows you to browse multiple archives and find exactly the file you are looking for. Due to some overhead from the FUSE mount library, the speed can be slower when restoring a large number of files. This is where `borg extract` comes in. If you already know which files you need, it can quickly restore large quantities of data including all metadata.
14+
15+
## Prerequisites
16+
You should already have Borg installed and know how to use the command line. If you didn't install Borg yet, have a look at [this previous guide](https://docs.borgbase.com/linux/setup-borg-command-line/).
17+
18+
## Step 1 - Set up FUSE
19+
The FUSE library allows mounting arbitrary file systems into user space. It's available for all popular systems. The [official Borg docs](https://borgbackup.readthedocs.io/en/stable/installation.html) have a detailed overview for each system. You will need two parts: the actual FUSE library and Python wrappers for it.
20+
21+
**For macOS**: First install the FUSE library from Homebrew.
22+
23+
```
24+
$ brew cask install osxfuse
25+
```
26+
27+
**For Debian/Ubuntu**: The FUSE library is available from the main package repository.
28+
29+
```
30+
$ sudo apt-get install libfuse-dev fuse pkg-config
31+
```
32+
33+
**For Red Hat/CentOS**: FUSE is available from the official repository.
34+
```
35+
$ yum install fuse-devel fuse pkgconfig
36+
```
37+
38+
## Step 2 - Install Python FUSE Bindings (optional)
39+
The `llfuse` [package](https://pypi.org/project/llfuse/) provides Python bindings for FUSE. If you are using the standalone binary of Borg, it already includes FUSE bindings and you can proceed to the next step. If you installed Borg from PyPi, you can install it as follows:
40+
41+
### Install Python FUSE library
42+
Be sure to install it into the same Python environment as Borg itself.
43+
44+
```
45+
$ pip install llfuse
46+
```
47+
48+
If you installed Borg as user-package using the system Python:
49+
50+
```
51+
$ pip install --user llfuse
52+
```
53+
54+
Or you could install it together with Borg
55+
56+
```
57+
$ pip install borgbackup[fuse]
58+
```
59+
60+
## Step 3 - Validate Installation and Repository
61+
Next make sure everything is installed properly and you have access to the backup repo.
62+
63+
```
64+
$ borg info [email protected]:repo
65+
```
66+
67+
You should see output similar to this. If you get an error, be sure that you have access to the repository. If your repo is encrypted, it will also ask you for the password or keyfile.
68+
69+
```
70+
Repository ID: daf2e2b94a1b57f0effc96939813ef58d0af04414f92f87c3e092a99adaa90eb
71+
Location: ssh://[email protected]/./repo
72+
Encrypted: Yes (repokey BLAKE2b)
73+
Cache: /Users/manu/.cache/borg/daf2e2b94a1b57f0effc96939813ef58d0af04414f92f87c3e092a99adaa90eb
74+
Security dir: /Users/manu/.config/borg/security/daf2e2b94a1b57f0effc96939813ef58d0af04414f92f87c3e092a99adaa90eb
75+
------------------------------------------------------------------------------
76+
Original size Compressed size Deduplicated size
77+
All archives: 665.90 MB 577.88 MB 68.41 MB
78+
79+
Unique chunks Total chunks
80+
Chunk index: 1359 6711
81+
```
82+
83+
If you installed Borg and llfuse via PIP, you can also validate the packages are installed
84+
85+
```
86+
$ pip freeze | grep llfuse
87+
$ pip freeze | grep borgbackup
88+
```
89+
90+
Step 4 - Using `borg mount` to Browse and Restore Files
91+
The `borg mount` command allows for simple browsing and restoring individual files without their complete metadata. This is great to restore a few documents or images.
92+
93+
First create a new folder as mount point. Since we're not working with root permissions, we won't use `/mnt`. Instead any empty folder in your home directory will suffice.
94+
95+
```
96+
$ mkdir borg-mnt
97+
```
98+
99+
Next mount the whole repository into the newly created folder. This will give us a view of *all* archives in the repository.
100+
101+
```
102+
$ borg mount [email protected]:repo borg-mount
103+
```
104+
105+
If there was no error, you should now see all your archives in the `borg-mount` folder:
106+
107+
```
108+
$ ls -l borg-mount
109+
```
110+
111+
Depending on the archive names used, the output could look like this.
112+
113+
```
114+
drwxr-xr-x 1 manu staff 0 Feb 16 12:04 nyx2-test-repo-2019-02-16T12:04:06
115+
drwxr-xr-x 1 manu staff 0 Mar 5 13:12 nyx2-test-repo-2019-03-05T13:12:04
116+
drwxr-xr-x 1 manu staff 0 Mar 19 22:36 nyx2-test-repo-2019-03-19T22:36:07
117+
drwxr-xr-x 1 manu staff 0 Mar 25 23:29 nyx2-test-repo-2019-03-25T23:29:35
118+
drwxr-xr-x 1 manu staff 0 Mar 26 23:02 nyx2-test-repo-2019-03-26T23:01:57
119+
drwxr-xr-x 1 manu staff 0 Mar 27 09:21 nyx2-test-repo-2019-03-27T09:21:42
120+
```
121+
122+
You can now browse this folder structure and copy the files you need.
123+
124+
## Step 5 - Using `borg extract` to Bulk Restore Files
125+
FUSE can be slow for a large number of files and it can't restore metadata. For this reason, Borg includes a second command for fast bulk-restoring – `borg extract`.
126+
127+
To use it, you will need to know the precise path and archive name to restore. The [`borg mount`](https://borgbackup.readthedocs.io/en/stable/usage/extract.html) command can be helpful for this.
128+
129+
Assuming we got the archive name and path from the previous step, a possible `borg extract` command could be
130+
131+
```
132+
$ borg extract \
133+
--dry-run --list \
134+
[email protected]:repo::nyx2-test-repo-2019-02-16T12:04:06 \
135+
/Users/manu/Documents/financial
136+
```
137+
138+
Due to the `--dry-run` and `--list` arguments this will print a list of files to be restored, but won't actually restore any files. To actually restore files, remove `--dry-run`.
139+
140+
The last part of the command gives the path you're looking to restore. If you pass no paths, then *all* the data will be restored.
141+
142+
Borg will restore your files to the current working directory. So be sure you are in the right place before running the command for real. To restore all the data from a specific snapshot to the current directory:
143+
144+
```
145+
$ borg extract \
146+
--list \
147+
[email protected]:repo::nyx2-test-repo-2019-02-16T12:04:06
148+
```
149+
150+
### Conclusion
151+
Hopefully this guide gave you a good overview of possible restore options for Borg. First we looked at installing required FUSE libraries to comfortably browse a whole repository. In addition, we used the `borg extract` command to quickly restore many files including their metadata.
152+
153+
If you're looking to complement your backup workflow with cost-effective offsite backups, also look into [BorgBase.com](https://www.borgbase.com). There is a free tier of 5 GB for life. Paid plan start at $2/month or $.005/GB for larger plans. We also offer custom solutions to enterprise customers. This includes setting up local backup agents or evaluating your whole backup strategy. Contact [[email protected]](mailto:[email protected]) for more.

setup/setup.md

+7-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
11
---
22
title: Setup
3-
nav_order: 2
3+
nav_order: 3
44
layout: page
55
description: ""
66
permalink: /setup
77
has_children: true
8-
---
8+
---
9+
# Setting up Borg for Backups to BorgBase
10+
11+
Borg is a lightweight backup client that you install locally to prepare your data before sending it to BorgBase for storage. Borg will deduplicate, compress and encrypt your files before sending them to us.
12+
13+
There are many ways to use Borg on your computer. Some popular ways are explained in the pages below. See *Command Line* for ways to set up borg on headless systems, like a NAS or a remote server. For desktops we offer Vorta, our desktop client. It provides a graphical user interface around Borg and integrates with your desktop environment to make creating, browsing and restoring backups easier.

0 commit comments

Comments
 (0)