How do you backup your YunoHost server?

I used to do this, years ago, but there were a problem with /home/yunohost.backup/tmp folder and I was not able to make more than 1 backup and had to manually empty this folder each time.
So now I have a link on /home/yunohost.backup/archives

1 Like

Very important topic!

I’m very impressed by all the creative solutions that you are using. Right now I’m doing a mix of things. I use snapshots made by the VPS provider, I sync all my files with NextCloud client and sometimes I backup manually YNH from the backup panel.

As @Guwom said, it would be awesome to have a backup solution integrated and easy to use.

Another very cool thing would be to have a sort of automatic exchange of backup space between users. I know this could be done manually now, but imagine how cool would be.

1 Like

i don’t care about backing up the server, the only important part is the data.

  • nextcloud syncs my day to day working files between server and all my laptops
  • i use restic with a cron job to make snapshots of important data everyday to local RAID1
  • use restic with cron job to make duplicate snapshots to rest-server with remote RAID1 over wireguard

i think the restic_ynh complicates restic too much, also SFTP is slow. should use rest-server GitHub - restic/rest-server: Rest Server is a high performance HTTP server that implements restic's REST backend API.

1 Like

My custom method is to have an openvpn tunnel between my server and a rasbperry pi at my home connected to a large HDD. There’s a script that runs every night that creates a backup with yunohost backup create and pushes it to the rpi via Restic

1 Like

Bonjour,
Je ne sauvegarde pas mon serveur yunohost, car je ne sais pas le faire malgré les tutoriels proposés. Mon souhait serait de faire une sauvegarde avec borg de mon serveur loué chez scaleway sur un pc chez moi qui tourne sur openmediavault. Bonne journée.

1 Like

Hello,

Pour ma part je ne suis pas sûr de maitriser toutes les méthodes que vous utilisez vous, ainsi que la méthode par défaut de YunoHost. Et un ami maitre Jedi qui m’a fait découvrir Linux m’as dit en premier que “tout était fichier”. Ma méthode est donc la suivante, je ne crois que ce que je vois.

J’utilise les sauvegardes de YunoHost, mais en parallèle j’ai

  • Un rsync de mon répertoire Nextcloud vers un DDE externe toujours branché sur le serveur.

  • Un rsync de mon répertoire Nextcloud vers un DDE que je branche le soir et j’emporte avec moi lorsque je quitte la maison (incendie, etc).

  • Un rsync de mon répertoire Nextcloud vers un DDE pair/impair ou j’alterne chaque jour afin d’avoir un roulement de sauvegarde au cas ou.

  • Un rsync de mon dossier avec les scripts pour remonter rapidement la machine.

  • Un rsync avec mes TXT ou j’ai yunohost domain add XXX.tdl && yunohost cert-install, etc etc.

  • Un rsync des fichiers vcard et ical vers une clé USB + Nextcloud

  • Un rsync des sauvegardes YunoHost partiel / complete / emails vers DDE / Nextcloud.

En parallèle je synchroniser mon dossier Nextcloud de sauvegardes sur 3 machines différentes (travail / famille / maison).

J’utilise la méthode du rsync car je suis sur de posséder les fichiers et en cas de réel problème je remonte mon YunoHost à la main, car c’est la méthode que je maitrise le mieux et qui finalement avec mon TXT me prends moins de temps.

Désolé si j’hérisse les cheveux des pros de l’info :slight_smile:

Belle journée
Guillaume

1 Like

Hello et merci pour ce sondage, clairement un sujet d’importance!

Perso, j’utilise le téléchargement manuel de l’archive via l’UI mais je recherche une meilleure solution plus automatisee. Ton travail sera l’occasion pour moi de me replonger dans ces sujets.
Bon courage et encore merci !

1 Like

Mes deux centimes :o

Serveur distant sur un RAID1 de 1 To

Automatique - quotidien :

  • backup system avec yunohost
  • borg (ynh)
  • restic (ynh) sur un serveur distant

De temps à autres :

  • backup complet avec yunohost (en .tar) : checksum de l’archive crée, puis recup par ftp et comparaison des checksums.

Purge des vieux backups :

  • je dégage tous les backup complets vieux de plus d’un an (~25 Go/backup dans mon cas, vu l’espace disque faut pas en garder 50 :o)

Il me semble que l’appli restic est un peu obsolète et qu’elle mériterait une bonne révision.

1 Like

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.

2 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