| ... | @@ -25,10 +25,25 @@ We need to list the next vars to use in the process: |
... | @@ -25,10 +25,25 @@ We need to list the next vars to use in the process: |
|
|
* Backblaze Key ID: `backups_role_b2_app_key_id`
|
|
* Backblaze Key ID: `backups_role_b2_app_key_id`
|
|
|
* Restic password: `backups_role_restic_repo_password`
|
|
* Restic password: `backups_role_restic_repo_password`
|
|
|
|
|
|
|
|
## Create and provision a new server
|
|
## Prepare the server
|
|
|
|
|
|
|
|
We have two options at this point: Create a new server or restore the backup in the current server.
|
|
|
|
|
|
|
|
### Create and provision a new server
|
|
|
|
|
|
|
|
Buy a new VPS and execute the [`opencell-provisioning`](https://gitlab.com/coopdevs/opencell-provisioning/) to prepare the server.
|
|
Buy a new VPS and execute the [`opencell-provisioning`](https://gitlab.com/coopdevs/opencell-provisioning/) to prepare the server.
|
|
|
|
|
|
|
|
|
### Create and provision a new server
|
|
|
|
|
|
|
|
If you want to use the same server you need to be sure that you have space to download all the B2 bucket in the server. You can check the size of the bucket in https://secure.backblaze.com/b2_buckets.htm and searching the bucket. Then, if you don't have the space in the server, we can attach a new volume (double the size of the bucket to be more comfortable). This new volume attached can be find inside the server running `df -h`:
|
|
|
|
|
|
|
|
```
|
|
|
|
$ df -h
|
|
|
|
Filesystem Size Used Avail Use% Mounted on
|
|
|
|
/dev/sda1 151G 119G 26G 83% /
|
|
|
|
/dev/sdc 246G 105G 128G 46% /mnt/HC_Volume_8507646 --> The new volume mounted on /mnt/HC_Volume_8507646
|
|
|
|
```
|
|
|
|
|
|
|
## Download backup from B2
|
|
## Download backup from B2
|
|
|
To download the bucket we need to install and config the [`b2` command-line tool](https://www.backblaze.com/b2/docs/quick_command_line.html):
|
|
To download the bucket we need to install and config the [`b2` command-line tool](https://www.backblaze.com/b2/docs/quick_command_line.html):
|
|
|
1. Access to the server where you want to restore:
|
|
1. Access to the server where you want to restore:
|
| ... | @@ -49,9 +64,10 @@ $ pip install b2 |
... | @@ -49,9 +64,10 @@ $ pip install b2 |
|
|
$ b2 authorize-account [<Backblaze Key ID>] [<Backblaze Key>]
|
|
$ b2 authorize-account [<Backblaze Key ID>] [<Backblaze Key>]
|
|
|
```
|
|
```
|
|
|
|
|
|
|
|
4. With the `b2` configured we can download the bucket. You can find the bucket name listing the buckets with `b2 list-buckets`:
|
|
4. With the `b2` configured we can download the bucket. You can find the bucket name listing the buckets with `b2 list-buckets`. Be sure that you start a `screen` session to avoid lost the output of the download process, that can take a lot of time:
|
|
|
|
|
|
|
|
```
|
|
```
|
|
|
|
$ screen
|
|
|
$ b2 list-buckets
|
|
$ b2 list-buckets
|
|
|
$ b2 sync --threads 25 b2://<bucket-name> <path-to-save-the-bucket>
|
|
$ b2 sync --threads 25 b2://<bucket-name> <path-to-save-the-bucket>
|
|
|
```
|
|
```
|
| ... | |
... | |
| ... | | ... | |