How do you backup your YunoHost server?

Haven’t seen too much feedback in the comments about using borg, so here is one:

Note that I’m in a special situation where the yunohost servers I run are virtual machines in a main physical one.

I used to simply have backups from the inside of the virtual machines, using borg_ynh (with automated daily backups). After a critical problem, I had to reinstall the servers, but it was a fairly long process, restoring apps one by one. It worked fine, but the time it took me to do it motivated me to setup an additional backup system that makes snapshots of the VMs (from outside of them, the main physical machine). The VM backups are also sent using borg to a remote repository in a yunohost server in a different location (running borgserver_ynh). I tested recovering which is a two lines process thanks to borg and virsh snapshots, very smooth.

Overall I find borg a really high quality, reliable and convenient tool for handling backups. And borg_ynh, and borgserver_ynh, great apps of the yunohost catalog.

It’s really great to know there’s work in adding borg to yunohost core (if I understood well), I often wanted to help developping it but never managed to create time for it, sorry for this.

Overall I’d say, up to now borg_ynh was a pretty simple way to make and restore backups of single apps. For a full system, I found it a bit more cumbersome and time consuming, so it could be nice to imagine a simple button like kind of feature when installing a system, like at the moment of postinstall where you can choose “reinstall server from a backup” and then just enter the address of you remote (or local) borg repository, the key, and go. Maybe that’s already a planned feature. I think it could be of great help for non expert users in terms of reliability of the infrastructure.

Another remark, is that some kind of snapshot system is really a convenient feature, I’m wondering if in longer term, yunohost could be implementing such kind of feature from inside it, like with a file system supporting snapshots. (I’m saying this but know nothing about it, so I have no idea about how unrealistic this proposal is, or how much work it would take to implement such a thing.)

Last remark, I believe finding a way to implement a functionality like the one fallback_ynh proposes (never used it but always thought I should get into it) would be another really strong feature to make self-hosting/local-hosting more reliable and adapted to hosting more people than just oneself, with non techy users relying on the services for their daily life.

Stopping here, sorry for the long post, hope it contains some useful infos :wink:

1 Like

Hello, my yunohost is running in a VM in Proxmox. I use Proxmox Backup Server, for local backup of the full VM, and the remote sync of datastore feature for an offsite backup.

1 Like

My ynh is on a rent server, and uses cron jobs calling yunohost backup create + logrotate to keep a number of daily, weekly and monthly backups on the server. The cron job also create a torrent for the latest daily and weekly backup.

Every week, I transfer the latest weekly backup to a NAS at home using bittorrent, and I keep 3 or 4 of them on the NAS.

3 Likes

I’m currently just doing a local backup with archivist, which is horrible, I know. Planning to move to borg when I have the time.

1 Like

@djizeus Nice solution ! I had never imagined transfering archive through bitorrent ! I was searching an idea to help people with only one laptop and one server to backup on their laptop easily and in an automated way. Your solution seems pretty nice, but i have questions:

  • Is it possible to protect a torrent (for example with a password) to authorize only one machine to donwload it ?
  • Is it a Synology NAS ? If yes bittorrent is natively supported or you have install an app to do it ?

Pour rappel chez Lydra on développe une collection Ansible pour YunoHost et on a fait pas mal de travaux sur les backups. Concrètement ça veut dire quoi :

Automatique - quotidien :

  • Script de sauvegarde automatique à l’aide de la cli yunohost (yunohost backup). Purge automatique des vieux backups.
  • A partir de là, sauvegarde vers un bucket distant à l’aide de Restic et de borg (on a automatisé tout ça à l’aide de rôles Ansible externes).
  • Bien évidemment, tout est paramétrable sur tout : destination des sauvegardes, applications YunoHost ou/et système, nombre de jours avant purge…

Si vous voulez en savoir plus, je vous invite à faire un tour du côté de notre présentation de la collection ou alors directement sur le GitLab de la collection

4 Likes

Thanks @ljf, and sorry for the late answer: I am traveling atm.

Regarding your questions:

  • In my case, the torrent file is not accessible publicly. It is stored on the server in some folder (that’s also used by the Transmission app), and every week it is downloaded with scp (protected with SSH keys) to the NAS via my laptop. And I forgot to mention, I use a private tracker (OpenTracker on the ynh server :slight_smile: )
  • I use the NAS of the Freebox revolution, it comes with Transmission installed on it. So I put the torrent file in a specific folder on the Freebox, and the download starts automatically. At some point I used a Synology NAS at work, and it didn’t have native support for bittorrent, but that was several years ago.

Note that I didn’t find a way for my NAS / Freebox to automatically download the torrent file from the server, but I thought it’s actually a good thing. It’s part of my weekly maintenance routine to run a small script from my laptop to download the torrent file from the server and send it to the NAS, and is an opportunity to check that backups are running and working, remind me to update packages / apps, etc.

If you are interested I can share the scripts I wrote for this solution.

2 Likes

Avant que mon instance ne soit sur un cluster Proxmox j’utilisais Rsnapshot avec des cron des 7 derniers jours, des 5 dernières semaines et des 2 derniers mois.

Maintenant avec mon cluster Proxmox j’utilise Proxmox Backup Server pour gérer mes sauvegardes.

1 Like

I use different methods depending of the context

NGO

Context: there is an “obsolete server” and a “new one” that is being installed
summary: No maintenance and backup made for four years. Option to download from GUI was not there yet
See this: How to update an unsupported YunoHost 3.X and Debian 9? - #9

Both server

  • backup from YunoHost GUI or yunohost backup create when i have time (few datas, backup size is small)

Obsolete server

  • use sshfs to mount the remote yuno FS on my computer then use rsync to sync the whole /home/yunohost.backup/archives/ to my computer
  • backups stays on my laptop (not so much datas again)

new server

  • TODO (not so much ideas. My goal is that “anybody” could do it but as it was never done for a few years, well…)

my yuno server

when backups are made

  • backup from yunohost backup create when i have time.
  • I have two commands versions because “nextcloud” backup is huge ~80Gb and nextcloud files are already synced to my computer and on work computer so the files are, IMO, safe.
  • most of the time, I run the “quick one” on the evening and when finished, I start the nextcloud one for the night because it’s slow
  • Next day or later, I get the two backups with my script.

nextcloud only

yunohost backup create --apps nextcloud --description 'application Nextcloud seulement'

backup size ~80Gb
Run not so often as I have to purge old backups and its a PITA to do it by CLI IMO. (no offense!)

not relevant:
A few years ago, I had troubles while migrating server while trying to restore nextcloud as it backuped “only the datas” and some “settings were missing” for the “restored nextcloud app” to run properly. It should have been fixed by now but I didn’t try again and only files are stored on my nextcloud because of this. (baikal handles calendars and contacts even thow, it is limited - no calendar sharing that I know about. If someone has an idea/solution?)

No nextcloud

BACKUP_CORE_ONLY=1 yunohost backup create --description 'tout sauf Nextcloud'

backup size ~10Gb
The real backup for me as all apps and settings should be stored here: (calendar, contacts, wiki, web apps, etc)

how backups are retrieved

  • use an ansible playbook/script to rsync from yuno to my computer. Then copy to a NAS with rsync over sshfs or by using samba
  • I don’t want the NAS to be exposed on Internet so I prefer to “pull” data from YunoHost instead of “pushing” it (I didn’t look much at other option, borg was interesting but I had to open my NAS on Internet or use VPN and …, well, too much work)
  • I didn’t spend time to run the ansible playbook from the NAS instead of my computer because it “kinda works” manually for now.
  • The goal wa to have to NAS handles the versioning of the backups and deleting “old backup” on the server to clear disk space.

If @lydra can/want to have a look / improve it? I had to “quickly clean” the playbook so I could share it so it might be broken

1 Like

https://syncthing.net/ coud also be a solution as an alternative to BitTorrent ?

I tried it a few years ago before moving to nextcloud on my smartphone to backup the pictures with “instant upload” feature of the nextcloud client.
With syncthing, there was too much limitations on the android side (which folder can be read/written to) and it was a PITA. Now, it work with nextcloud and pictures/movies are safe.

It migjt have changed on the android side since it was a “long time ago”

adding @ljf to the loop

I just had some problems with a backup and I immediately thought about this topic.

Is there any idea about how to create a backup solution for Ynh? I think this is one of the biggest problem right now. What do you think?

Do you mean snapshots of OS or apps? For Apps and configuration I use this script: GitHub - cichy1173/yh-backup: Personal bash script for backuping yunohost to external drive as cronjob.

1 Like

Two ways, VPS boot volume backup and ynohost backup utility,then copying the archive to external cloud storage.

How can you be sure that the backup drive will always have the same path ? For ex., if you forgot that you already plugged another drive, the DISC variable may point to that drive instead of the one you use for your backups ? Need to know, 'cause I’d like to try your script :stuck_out_tongue:

I mount drives using UUID on @reboot.

OK, so you need to stop/restart your server.

I’m looking for a solution to make a copy of Yunohost backup files created after each update, automagically when I plug a specific drive/partition to the server. I already started playing with udev rules, but I didn’t go very far.

OK, so you need to stop/restart your server.

My server works 24/7 so mounting drives on reboot is ideal for me. I do backup every 2 days, but I have to change that to everyday.
I see that i have a problem in a ‘if’ instruction. I have to change it.

I’m looking for a solution to make a copy of Yunohost backup files created after each update, automagically when I plug a specific drive/partition to the server. I already started playing with udev rules, but I didn’t go very far.

I think it is possible with UUID. Mounting a drive/partition can be a trigger, but right now I don’t how to use it in another programme. Your use-case is different than mine.

Hello everyone :slightly_smiling_face:

Any idea about how to backup Ynh? I was thinking that maybe it could be used a DIY solution, but provided as a tutorial so everyone can follow it.

What do you think?

Thank you

There are MANY ways of backup in YunoHost, you can find some of them in the documentation Backup strategies | Yunohost Documentation

Here, there is a nice poll about the choice made by some users.

What’s the easiest way to backup Yunohost on a VPS, directly to an external computer?

(VPS doesn’t have enough storage for the backup)

1 Like