# How to : Backup Yunohost server on Borgbase with Borgbackup

**URL:** https://forum.yunohost.org/t/how-to-backup-yunohost-server-on-borgbase-with-borgbackup/15295
**Category:** Tutorials
**Tags:** borg, english
**Created:** [April 8, 2021, 11:57am UTC](https://forum.yunohost.org/t/how-to-backup-yunohost-server-on-borgbase-with-borgbackup/15295 "2021-04-08T11:57:37Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![toad](https://forum.yunohost.org/letter_avatar_proxy/v4/letter/t/8c91f0/32.png) [@toad](https://forum.yunohost.org/u/toad)
#### Post date: [April 8, 2021, 11:57am UTC](https://forum.yunohost.org/t/how-to-backup-yunohost-server-on-borgbase-with-borgbackup/15295/1 "2021-04-08T11:57:37Z")

</div>

## Introduction

- **Hardware:** refurbished laptop
- **YunoHost version:** up to date
- **I have access to my server :** Either through SSH or webadmin
- **special context / particular tweaking** : no yet

I recently started with Yunohost, and I don’t have all the tips to make my life easier.

So your comments are welcome, both to help me learn, and to simplify this tuto

## Goal

Use the Yunohost Borgbackup application to externalize backups on a borgbase server.

This is a step-by-step tuto from scratch.

## Prerequisite

- Create a pair of SSH keys and display the public key

```bash
$ ssh-keygen -t ed25519 -a 100
$ less .ssh/id_ed25519.pub

```

- Create an account on [Borgbase](https://www.borgbase.com)

- drop the SSH public key

- Create a backup repository

> - The repository list provide those information :
> - on the left, you can copy the repository name
> - the form of repository URL is `<hash@hash>.repo.borgbase.com<:repo>`
> - in the `Security` column, the printfinger icon provide you the SSH fingerprint of the Borgbase server

## Borgbackup app on Yunohost

- Install `Borg Backup App` (through the webadmin)
  - provide [Borgbase.com](http://Borgbase.com) server URL in the form of `ssh://<hash@hash>.repo.borgbase.com:22/~/repo`
  - provide a strong backup passphrase and keep it safe (in several place following the 3-2-1 rules too)!
  - a mail is sent to the yunohost server administrator by install script in which is listed the public key to configure in borgbase repo

- add the SSH public key of the Borgbackup app on the Borgbase server
  - on the Yunohost serveur, copy the content of `.ssh/id_borg_ed25519.pub` or copy it from the email
  - on the Borgbase server, in `Account`, `SSH keys`, click on `Add Key`
  - past the public key, add a name (arbitrary) and validate
  - in `Repositories`, édit the repository
  - choose the new SSH key (**we discourage yout to select the `append-only access` as this feature doesn’t act as its name suggest it, read attentively the following link to know more [Additional Notes — Borg - Deduplicating Archiver 1.4.3 documentation](https://borgbackup.readthedocs.io/en/stable/usage/notes.html#append-only-mode)**)

> The SSH key `id_borg_ed25519` created by Borgbackup installer doesn’t ask password. It allow backup automation.

## Initialize and test

- The first run will initialize the repository
  - By default, you have to wait the timer trigger specified at installation
  - At this time you received a “[YNH] First backup is starting” email.

- You can launch a backup manually
  - in Webadmin \> Services \> Borg
  - in shell with `systemctl start borg.service`

## Troubleshooting

- check the repository

```bash
$ BORG_RSH="ssh -i /root/.ssh/id_borg_ed25519 " borg list <hash@hash>.repo.borgbase.com:repo
Enter passphrase for key ssh://<hash@hash>.repo.borgbase.com/./repo: 
auto_conf_21_03_21_00:00 Sun, 2021-03-21 06:00:11 [00858c0db2863e6ab144682f1b18002d9b5666b5f3352ff0f813cc50ae345d65]
auto_data_21_03_21_00:00 Sun, 2021-03-21 06:00:18 [cfc19598981410cccd17e98cec207c74211b596d5fb38a1a0f043712e70e34a0]
auto_borg_21_03_21_00:00 Sun, 2021-03-21 06:00:33 [07a3897f8621ab90a01a27ab9f73d974bb25492cf341a344290ffcb0fbd11fa8]
...

```

- display repository statistics

```bash
$ BORG_RSH="ssh -i /root/.ssh/id_borg_ed25519 " borg info <hash@hash>.repo.borgbase.com:repo
[...]
------------------------------------------------------------------------------
                       Original size Compressed size Deduplicated size
All archives: 5.02 GB 2.65 GB 418.51 MB

                       Unique chunks Total chunks
Chunk index: 37672 494522

```

- check a backup

```bash
$ BORG_RSH="ssh -i /root/.ssh/id_borg_ed25519 " borg check --debug <hash@hash>.repo.borgbase.com:repo::auto_borg_21_03_21_00:00
using builtin fallback logging configuration
35 self tests completed in 0.10 seconds
[...]
Enter passphrase for key ssh://<hash@hash>.repo.borgbase.com/./repo: 
TAM-verified manifest
Analyzing archive auto_borg_21_03_21_00:00 (1/1)
RepositoryCache: current items 1, size 2.24 kB / 2.15 GB, 0 hits, 1 misses, 0 slow misses (+0.0s), 0 evictions, 0 ENOSPC hit
Orphaned objects check skipped (needs all archives checked).
Archive consistency check complete, no problems found.
RemoteRepository: 640 B bytes sent, 1.52 MB bytes received, 15 messages sent

```

- Change Borg repository URL in Yunohost configuration :

```bash
$ yunohost app setting borg repository -v <hash@hash>.repo.borgbase.com:repo

```

- You can also find Borgbackup logs in :

- Borgbase allow to set an alert when no activity is detected within a given period.

## Restore

- Export to restore

```bash
$ BORG_RSH="ssh -i /root/.ssh/id_borg_ed25519 " borg export-tar <hash@hash>.repo.borgbase.com:repo::_auto_borg_21_03_21_00:00 /home/yunohost.backup/archives/_auto_borg_21_03_21_00:00.tar.gz

```

- Restore the archive through the admin interface (the archive appears in the backups section), or in command line :

```bash
$ yunohost backup restore _auto_borg_21_03_21_00:00.tar.gz --apps

```

> you can also restore system parts with the `--system` option

- Mount to restore

```bash
$ BORG_RSH="ssh -i /root/.ssh/id_borg_ed25519 " borg mount <hash@hash>.repo.borgbase.com:repo /media/borg-repo

```

---

<div class="post-metadata">

### Author: ![ljf](https://forum.yunohost.org/user_avatar/forum.yunohost.org/ljf/32/58_2.png) [@ljf](https://forum.yunohost.org/u/ljf)
#### Post date: [April 8, 2021, 4:52pm UTC](https://forum.yunohost.org/t/how-to-backup-yunohost-server-on-borgbase-with-borgbackup/15295/2 "2021-04-08T16:52:56Z")

</div>

**Thanks toad for this contribution !** 🙂

Here are my comments:

> [@toad](#):
>
> Install `Borg Backup App` (through the webadmin)
> 
> - provide [Borgbase.com](http://Borgbase.com) server URL in the form of `<hash@hash>.repo.borgbase.com` (without `:repo`)
> - provide a Borgbackup username (arbitrary)
> - a mail is sent to the yunohost server administrator by install script

I think the repo path should be added like that: `ssh://<hash@hash>.repo.borgbase.com/~/repo` . Indeed, the current version doesn’t support the `USER@DOMAIN:PATH` notation without change by hand like you do.

Now the question about username has been removed from install question, the user is directly contained in the repository question.

So i suggest to change this part like this:

```auto
* Install `Borg Backup App` (through the webadmin)
  * provide [Borgbase.com](http://Borgbase.com) server URL in the form of `ssh://<hash@hash>.repo.borgbase.com/~/repo`
  * provide a strong backup passphrase and keep it safe (in several place following the 3-2-1 rules too)!
  * a mail is sent to the yunohost server administrator by install script in which is listed the public key to configure in borgbase repo

```

> [@toad](#):
>
> - add the SSH public key of the Borgbackup app on the Borgbase server
> - on the Yunohost serveur, copy the content of `.ssh/id_borg_ed25519.pub`
> - on the Borgbase server, in `Account`, `SSH keys`, click on `Add Key`
> - past the public key, add a name (arbitrary) and validate
> - in `Repositories`, édit the repository
> - choose the new SSH key for an `append-only access`

I suggest here to remove the append-only access. We studied in details how this option works during the yunohost infra hackaton 10 days ago. This features is an anti-feature and doesn’t act as expected. See here for more details [Additional Notes — Borg - Deduplicating Archiver 1.2.7 documentation](https://borgbackup.readthedocs.io/en/stable/usage/notes.html#append-only-mode) . We conclude this option doesn’t really protect from an attacker that delete your repo, because deletion operations are just paused until the next operation from a full access repo.

In more append only repo management need a full access to the repo, i mean, you have to be able to read some logfile from the repo, and i don’t think borgbase allow you to do that.

SO here i suggest this change:

```auto
* add the SSH public key of the Borgbackup app on the Borgbase server
  * on the Yunohost serveur, copy the content of `.ssh/id_borg_ed25519.pub` or copy it from the email
  * on the Borgbase server, in `Account`, `SSH keys`, click on `Add Key`
  * past the public key, add a name (arbitrary) and validate
  * in `Repositories`, édit the repository
  * choose the new SSH key ( **we discourage yout to select the `append-only access` as this feature doesn't act as its name suggest it, read attentively the following link to know more https://borgbackup.readthedocs.io/en/stable/usage/notes.html#append-only-mode** )

```

> [@toad](#):
>
> ## Initialize the repository

You don’t have to manually initialize your repo. It should be done by borg\_ynh. If you don’t want to wait for timer trigger you can run the borg service in Webadmin \> Services \> Borg  
At this time you received a “[YNH] First backup is starting” email.

> [@toad](#):
>
> ## Configure Borgbackup with the Borgbase repository

You don’t have to do this if you use the notation `ssh://<hash@hash>.repo.borgbase.com:22/~/repo` as explained in help comment on the first question during install.

Others thigs are ok for me

---

<div class="post-metadata">

### Author: ![MrMorals](https://forum.yunohost.org/user_avatar/forum.yunohost.org/mrmorals/32/1852_2.png) [@MrMorals](https://forum.yunohost.org/u/MrMorals)
#### Post date: [April 8, 2021, 5:53pm UTC](https://forum.yunohost.org/t/how-to-backup-yunohost-server-on-borgbase-with-borgbackup/15295/3 "2021-04-08T17:53:23Z")

</div>

It is great that you have taken the time to help other users with this! Backup is an important topic and is not yet as usable as I’d like it to be for Yunohost. However, in reading your post on Borgbase and such, I am happy to see that there are positive developments!

If you would consider putting screenshots in the tutorial, that would be really helpful in people’s understanding I think 😃 Is that something you would want upgrade your tutorial with?

Thanks and cheers!

---

<div class="post-metadata">

### Author: ![toad](https://forum.yunohost.org/letter_avatar_proxy/v4/letter/t/8c91f0/32.png) [@toad](https://forum.yunohost.org/u/toad)
#### Post date: [April 9, 2021, 1:52pm UTC](https://forum.yunohost.org/t/how-to-backup-yunohost-server-on-borgbase-with-borgbackup/15295/4 "2021-04-09T13:52:41Z")

</div>

Hi ljf, and thanks a lot for your comment. It leaned me severals tricks, and connect things I had not paid attention.

> [@ljf](#):
>
> I think the repo path should be added like that: `ssh://<hash@hash>.repo.borgbase.com/~/repo` . Indeed, the current version doesn’t support the `USER@DOMAIN:PATH` notation without change by hand like you do.

I didn’t know the mapping between the two notations. It’s a good thing to know about Borg.

> [@ljf](#):
>
> I suggest here to remove the append-only access.

Another good peace of knowledge about Borg. I also correct my config.

> [@ljf](#):
>
> You don’t have to manually initialize your repo.

It makes sense that the borg\_ynh app facilitates this step, I was too focused to realize.

> [@ljf](#):
>
> It should be done by borg\_ynh. If you don’t want to wait for timer trigger you can run the borg service in Webadmin \> Services \> Borg  
> At this time you received a “[YNH] First backup is starting” email.

It makes me connect the fact that each time I restart service, it launch a backup…

I modify the tuto according to your propositions. Thank you also for taking the time to format them.

---

<div class="post-metadata">

### Author: ![toad](https://forum.yunohost.org/letter_avatar_proxy/v4/letter/t/8c91f0/32.png) [@toad](https://forum.yunohost.org/u/toad)
#### Post date: [April 9, 2021, 2:36pm UTC](https://forum.yunohost.org/t/how-to-backup-yunohost-server-on-borgbase-with-borgbackup/15295/5 "2021-04-09T14:36:29Z")

</div>

Thank you MrMorals for your comment.

I understand the visual interest of screenshots, particularly for people who try and discover.

I’m not sure having time to maintain such a tuto, considering that I’m not familiar with tools to manipulate and enrich raw screenshot. Closing this gap has too low a priority to be achieved in the near future.

As you said, backup is a far more important topic…

---

<div class="post-metadata">

### Author: ![TheNomad11](https://forum.yunohost.org/user_avatar/forum.yunohost.org/thenomad11/32/3139_2.png) [@TheNomad11](https://forum.yunohost.org/u/TheNomad11)
#### Post date: [April 9, 2021, 3:04pm UTC](https://forum.yunohost.org/t/how-to-backup-yunohost-server-on-borgbase-with-borgbackup/15295/6 "2021-04-09T15:04:39Z")

</div>

Thanks so much. So important. We should add this guide to the official documentation, I think. Then others might be able to add screenshots as well

---

<div class="post-metadata">

### Author: ![steven](https://forum.yunohost.org/user_avatar/forum.yunohost.org/steven/32/4140_2.png) [@steven](https://forum.yunohost.org/u/steven)
#### Post date: [April 16, 2021, 5:38am UTC](https://forum.yunohost.org/t/how-to-backup-yunohost-server-on-borgbase-with-borgbackup/15295/7 "2021-04-16T05:38:40Z")

</div>

Thanks for this tuto, I am backing up my server on a borgbase repo 😉👍

Here is a list of providers for backup borg (found on borgmatic)

> **Borg Hosting providers**  
> Need somewhere to store your encrypted offsite backups? The following hosting providers include specific support for Borg/borgmatic. Using these links and services helps support borgmatic development and hosting. (These are referral links, but without any tracking scripts or cookies.)  
> [rsync.net](https://www.rsync.net/cgi-bin/borg.cgi?campaign=borg&adgroup=borgmatic): Cloud Storage provider with full support for borg and any other SSH/SFTP tool (18€/an 100Go)  
> [BorgBase](https://www.borgbase.com/?utm_source=borgmatic): Borg hosting service with support for monitoring, 2FA, and append-only repos (24€/an 100Go)  
> [Lima-Labs](https://storage.lima-labs.com/special-pricing-offer-for-borgmatic-users/): Affordable, reliable cloud data storage accessable via SSH/SCP/FTP for Borg backups or any other bulk storage needs. (22, 5€/an 250Go)

---

<div class="post-metadata">

### Author: ![arnauld](https://forum.yunohost.org/user_avatar/forum.yunohost.org/arnauld/32/12085_2.png) [@arnauld](https://forum.yunohost.org/u/arnauld)
#### Post date: [April 21, 2021, 5:39pm UTC](https://forum.yunohost.org/t/how-to-backup-yunohost-server-on-borgbase-with-borgbackup/15295/8 "2021-04-21T17:39:54Z")

</div>

Bonjour,  
J’essaye de faire un backup vers Borgbase. J’ai finalement réussi à installer l’application Borgbackup, mais à l’initialisation je reçois un mail disant :

> borg init: error: argument REPOSITORY: Invalid location format: “ssh://xxx@xxx.repo.borgbase.com:repo:22/~/yunohost”  
> Could not run script: /etc/yunohost/hooks.d/backup\_method/05-borg\_app  
> Custom backup method could not get past the ‘backup’ step

Dans le tuto, lors de l’installation de Borgbackup, il est indiqué de remplir suivant : ssh://[hash@hash](mailto:hash@hash).repo.borgbase.com:22/~/repo

J’ai changé repo à la fin par yunohost (le nom de mon repo sur Borgbase), ce qui donne :  
ssh://xxx@xxx.repo.borgbase.com:repo:22/~/yunohost  
est-cela qu’il faut faire ou dois-je conserver ? :  
ssh://[hash@hash](mailto:hash@hash).repo.borgbase.com:22/~/repo  
Merci.

Hello,  
I am trying to make a backup to Borgbase. I finally succeeded in installing the Borgbackup application, but at initialization I receive an email saying :

> borg init: error: argument REPOSITORY: Invalid location format: “ssh://xxx@xxx.repo.borgbase.com:repo:22/~/yunohost”  
> Could not run script: /etc/yunohost/hooks.d/backup\_method/05-borg\_app  
> Custom backup method could not get past the ‘backup’ step

In the tutorial, when installing Borgbackup, it is indicated to fill the following: ssh://[hash@hash](mailto:hash@hash).repo.borgbase.com:22/~/repo

I changed repo at the end to yunohost (the name of my repo on Borgbase), which gives :  
ssh://xxx@xxx.repo.borgbase.com:repo:22/~/yunohost  
is this the right thing to do or should I keep repo instead of yunohost ? :  
ssh://[hash@hash](mailto:hash@hash).repo.borgbase.com:22/~/repo  
Thank you.

---

<div class="post-metadata">

### Author: ![ljf](https://forum.yunohost.org/user_avatar/forum.yunohost.org/ljf/32/58_2.png) [@ljf](https://forum.yunohost.org/u/ljf)
#### Post date: [April 22, 2021, 4:07pm UTC](https://forum.yunohost.org/t/how-to-backup-yunohost-server-on-borgbase-with-borgbackup/15295/9 "2021-04-22T16:07:13Z")

</div>

> [@arnauld](#):
>
> ssh://xxx@xxx.repo.borgbase.com:repo:22/~/yunohost

Il faut plutôt mettre:  
ssh://xxx@xxx.repo.borgbase.com:22/~/yunohost

Tu as mis un :repo de trop.

---

<div class="post-metadata">

### Author: ![arnauld](https://forum.yunohost.org/user_avatar/forum.yunohost.org/arnauld/32/12085_2.png) [@arnauld](https://forum.yunohost.org/u/arnauld)
#### Post date: [April 22, 2021, 4:09pm UTC](https://forum.yunohost.org/t/how-to-backup-yunohost-server-on-borgbase-with-borgbackup/15295/10 "2021-04-22T16:09:36Z")

</div>

> [@ljf](#):
>
> Il faut plutôt mettre:  
> ssh://xxx@xxx.repo.borgbase.com:22/~/yunohost
> 
> Tu as mis un :repo de trop.

Merci. j’y suis arrivé, mon premier backup vers Borgbase semble être un succès.

---

<div class="post-metadata">

### Author: ![TheNomad11](https://forum.yunohost.org/user_avatar/forum.yunohost.org/thenomad11/32/3139_2.png) [@TheNomad11](https://forum.yunohost.org/u/TheNomad11)
#### Post date: [April 26, 2021, 10:54am UTC](https://forum.yunohost.org/t/how-to-backup-yunohost-server-on-borgbase-with-borgbackup/15295/11 "2021-04-26T10:54:45Z")

</div>

I finally tried to set this up following this tutorial. The second time I made it right. But the first time I was so stupid to just copy the url of the repository from the Borgbase admin while the Yunohost set up requires a small change which is `:22/~/repo` as the end of the URL as it is written in this tutorial as well.

So the question is: How do I change the URL? I did not find any way to do so. Do we have to uninstall the Borg app and start from scratch?

---

<div class="post-metadata">

### Author: ![TheNomad11](https://forum.yunohost.org/user_avatar/forum.yunohost.org/thenomad11/32/3139_2.png) [@TheNomad11](https://forum.yunohost.org/u/TheNomad11)
#### Post date: [April 26, 2021, 11:07am UTC](https://forum.yunohost.org/t/how-to-backup-yunohost-server-on-borgbase-with-borgbackup/15295/12 "2021-04-26T11:07:33Z")

</div>

And to complete the tutorial we need instructions how to restore from a backup as there are no ways to do so in the Yunohost webadmin.

It seems it can be done this way from the yunohost command-line:

`borg export-tar /path/to/repo::your_backup your_backup_yunohost.tar.gz`

according to [[Borg & Borg Server] Deduplicated, encrypted and remote backups - #18 by charly](https://forum.yunohost.org/t/borg-borg-server-deduplicated-encrypted-and-remote-backups/5006/18)

Then, I suppose, it will show up as a normal backup in the Yunohost webadmin, and from there we can restore individual apps. right?

I will have to check if this works with Borgbase

---

<div class="post-metadata">

### Author: ![ljf](https://forum.yunohost.org/user_avatar/forum.yunohost.org/ljf/32/58_2.png) [@ljf](https://forum.yunohost.org/u/ljf)
#### Post date: [April 26, 2021, 11:12am UTC](https://forum.yunohost.org/t/how-to-backup-yunohost-server-on-borgbase-with-borgbackup/15295/13 "2021-04-26T11:12:25Z")

</div>

> [@TheNomad11](#):
>
> Then, I suppose, it will show up as a normal backup in the Yunohost webadmin, and from there we can restore individual apps. right?

That’s it (if you put your tar.?gz into /home/yunohost.backup/archives/

---

<div class="post-metadata">

### Author: ![TheNomad11](https://forum.yunohost.org/user_avatar/forum.yunohost.org/thenomad11/32/3139_2.png) [@TheNomad11](https://forum.yunohost.org/u/TheNomad11)
#### Post date: [April 26, 2021, 11:39am UTC](https://forum.yunohost.org/t/how-to-backup-yunohost-server-on-borgbase-with-borgbackup/15295/15 "2021-04-26T11:39:13Z")

</div>

It is not as straight forward as it seems. So when I run this command

`borg export-tar ssh://XXXXXXXXX.repo.borgbase.com:22/~/repo /home/yunohost.backup/archives/yunohost.tar.gz`

I get the error message:

`borg export-tar: error: argument ARCHIVE: "ssh://XXXXXXXX.repo.borgbase.com:22/~/repo": No archive specified`

EDIT: Looking at the complexity involved here [Restore | BorgBase Docs](https://docs.borgbase.com/restore/) I start wondering if Borg is the best solution for non IT-professionals?

---

<div class="post-metadata">

### Author: ![ljf](https://forum.yunohost.org/user_avatar/forum.yunohost.org/ljf/32/58_2.png) [@ljf](https://forum.yunohost.org/u/ljf)
#### Post date: [April 26, 2021, 6:01pm UTC](https://forum.yunohost.org/t/how-to-backup-yunohost-server-on-borgbase-with-borgbackup/15295/16 "2021-04-26T18:01:10Z")

</div>

You have to use borg list to identify the archive before.

`borg list ssh://XXXXXXXXX.repo.borgbase.com:22/~/repo`

And next you can export it:

```auto
borg export-tar ssh://XXXXXXXXX.repo.borgbase.com:22/~/repo::ARCHIVE_NAME /home/yunohost.backup/archives/ARCHIVE_NAME.tar.gz

```

---

<div class="post-metadata">

### Author: ![TheNomad11](https://forum.yunohost.org/user_avatar/forum.yunohost.org/thenomad11/32/3139_2.png) [@TheNomad11](https://forum.yunohost.org/u/TheNomad11)
#### Post date: [April 26, 2021, 7:54pm UTC](https://forum.yunohost.org/t/how-to-backup-yunohost-server-on-borgbase-with-borgbackup/15295/17 "2021-04-26T19:54:31Z")

</div>

> [@ljf](#):
>
> borg list ssh://XXXXXXXXX.repo.borgbase.com:22/~/repo

Thanks! Running this command gives me a permission error:

```
Remote: xxxx@xxxx.repo.borgbase.com: Permission denied (publickey).
Connection closed by remote host. Is borg working on the server?

```

Borg is running, I double-checked and started a manual backup which worked well

---

<div class="post-metadata">

### Author: ![ljf](https://forum.yunohost.org/user_avatar/forum.yunohost.org/ljf/32/58_2.png) [@ljf](https://forum.yunohost.org/u/ljf)
#### Post date: [April 27, 2021, 10:13am UTC](https://forum.yunohost.org/t/how-to-backup-yunohost-server-on-borgbase-with-borgbackup/15295/18 "2021-04-27T10:13:43Z")

</div>

Try with:

```auto
BORG_RSH="ssh -i /root/.ssh/id_borg_ed25519 -oStrictHostKeyChecking=yes " borg list ssh://XXXXXXXXX.repo.borgbase.com:22/~/repo

```

---

<div class="post-metadata">

### Author: ![TheNomad11](https://forum.yunohost.org/user_avatar/forum.yunohost.org/thenomad11/32/3139_2.png) [@TheNomad11](https://forum.yunohost.org/u/TheNomad11)
#### Post date: [April 27, 2021, 12:23pm UTC](https://forum.yunohost.org/t/how-to-backup-yunohost-server-on-borgbase-with-borgbackup/15295/19 "2021-04-27T12:23:58Z")

</div>

Yes, that worked. Just had to remove the whitespace after =yes so that it is =yes" and I was asked for the repository password and got connected

then also the export command had to start with  
`BORG_RSH="ssh -i /root/.ssh/id_borg_ed25519 -oStrictHostKeyChecking=yes"`

so that both commands would be

1. list archives:

`BORG_RSH="ssh -i /root/.ssh/id_borg_ed25519 -oStrictHostKeyChecking=yes" borg list ssh://xxxxx@xxxxxx.repo.borgbase.com:22/~/repo`

1. export to restore

`BORG_RSH="ssh -i /root/.ssh/id_borg_ed25519 -oStrictHostKeyChecking=yes" borg export-tar ssh://xxxxx@xxxxxx.repo.borgbase.com:22/~/repo::ARCHIVE_NAME /home/yunohost.backup/archives/ARCHIVE_NAME.tar.gz`

I then tried to restore an application (Dokuwiki) from this backup and it worked! Yeah, thanks a lot! Now we just need to publish these instruction in the Yunohost documentation, I think

---

<div class="post-metadata">

### Author: ![ljf](https://forum.yunohost.org/user_avatar/forum.yunohost.org/ljf/32/58_2.png) [@ljf](https://forum.yunohost.org/u/ljf)
#### Post date: [April 27, 2021, 1:27pm UTC](https://forum.yunohost.org/t/how-to-backup-yunohost-server-on-borgbase-with-borgbackup/15295/20 "2021-04-27T13:27:04Z")

</div>

Instructions are in the readme of borg\_ynh [GitHub - YunoHost-Apps/borg\_ynh: An experimental Borg implementation for YunoHost](https://github.com/YunoHost-Apps/borg_ynh/#restore-backups-to-yuno) but you are probably right, i think backup with borg should be describe on this page [Backing up your server and apps | Yunohost Documentation](https://yunohost.org/en/backup)

---

<div class="post-metadata">

### Author: ![TheNomad11](https://forum.yunohost.org/user_avatar/forum.yunohost.org/thenomad11/32/3139_2.png) [@TheNomad11](https://forum.yunohost.org/u/TheNomad11)
#### Post date: [April 27, 2021, 1:56pm UTC](https://forum.yunohost.org/t/how-to-backup-yunohost-server-on-borgbase-with-borgbackup/15295/21 "2021-04-27T13:56:08Z")

</div>

Yes, and the readme you mention is confusing for non-experts as me and does not include backing up to borgbase (or other external services). It also says in the beginning that " This doc is partially obsolete and should be reworked!".

What we should have in my opinion are newbie-friendly instructions to backup to different external providers on the one hand and on the other hand to another yunohost server with Borg server app.

Later today or so, I hope, I will try to set up the backup on my main Yunohost instance (so far I have used a test instance with YH 4.2) and will make some notes.

[Next page](https://forum.yunohost.org/t/how-to-backup-yunohost-server-on-borgbase-with-borgbackup/15295.md?page=2)
