Remove unecessary pages about backup methods ... apart from Borg's one, now integrated into the app's ADMIN.md, they contain no detail that ain't already in the main 'backup_methods.md' page

This commit is contained in:
Alexandre Aubin 2024-07-10 22:08:17 +02:00
parent 4f828219e3
commit b2d0719a33
12 changed files with 21 additions and 441 deletions

View file

@ -1,5 +1,5 @@
---
title: Sauvegarder son serveur
title: Sauvegardes basiques
template: docs
taxonomy:
category: docs
@ -174,20 +174,3 @@ scp -P port_ssh /path/to/your/<nom_d'archive>.tar admin@your.domain.tld:/home/yu
[/ui-tab]
[/ui-tabs]
## Sauvegarde automatique ou distante
Il existe 3 applications YunoHost qui proposent d'étendre YunoHost avec une méthode de sauvegarde automatisées.
- [BorgBackup](/backup/borgbackup)
- [Restic](/backup/restic)
- [Archivist](/backup/archivist)
## Aller plus loin
- [Évaluer la qualité de sa sauvegarde](/backup/strategies)
- [Cloner son système de fichier](/backup/clone_filesystem)
- [Éviter une panne matérielle](/backup/avoid_hardware_failure)
- [Inclure/exclure des fichiers](/backup/include_exclude_files)
- [Méthodes personnalisées](/backup/custom_backup_methods)
- [Migrer ou fusionner des serveurs](/backup/migrate_or_merge_servers)

View file

@ -1,5 +1,5 @@
---
title: Eseguire il backup del vostro server e delle app
title: Basic backups
template: docs
taxonomy:
category: docs

View file

@ -1,5 +1,5 @@
---
title: Backing up your server
title: Basic backups
template: docs
taxonomy:
category: docs
@ -11,8 +11,6 @@ In the context of self-hosting, backups are an important element to compensate f
## Manual backup
### Backup
YunoHost comes with a backup system, that allows you to backup (and restore) system configurations and data (e.g. emails) and apps if they support it.
You can manage backups either from the command line (`yunohost backup --help`) or from the web administration (in the Backups section), though some features are not yet available in the webadmin.
@ -145,7 +143,7 @@ You can then run `yunohost backup restore <archivename>` (hence without its `.ta
To restore an app, the domain on which it was installed should already be configured (or you need to restore the corresponding system configuration). You also cannot restore an app which is already installed... which means that to restore an old version of an app, you must first uninstall it.
#### Upload an archive
#### Uploading an archive
In many cases, the archive is not on the server on which you want to restore it. So it has to be uploaded, which depending on its size can take more or less time.
@ -170,20 +168,3 @@ scp -P ssh_port /path/to/your/<archive_name>.tar admin@your.domain.tld:/home/yun
[/ui-tab]
[/ui-tabs]
## Automatic or remote backup
There are 3 YunoHost applications that offer to extend YunoHost with an automated backup method.
- [BorgBackup](/backup/borgbackup)
- [Restic](/backup/restic)
- [Archivist](/backup/archivist)
## Go further
- [Evaluate the quality of your backup](/backup/strategies)
- [Clone your file system](/backup/clone_filesystem)
- [Avoid a hardware failure](/backup/avoid_hardware_failure)
- [Include/exclude files](/backup/include_exclude_files)
- [Custom methods](/backup/custom_backup_methods)
- [Migrate or merge servers](/backup/migrate_or_merge_servers)

View file

@ -1,91 +0,0 @@
---
title: BorgBackup
template: docs
taxonomy:
category: docs
routes:
default: '/backup/borgbackup'
page-toc:
active: true
depth: 3
---
YunoHost propose un couple d'applications pour [BorgBackup](https://www.borgbackup.org/).
## Fonctionnalité
Cette application propose:
- la sauvegarde des données sur un disque externe ou sur un dépôt borg distant
- la déduplication et la compression des fichiers ce qui permet de conserver de nombreuses copies antérieures
- le chiffrement des données, ce qui permet de pouvoir stocker chez un tiers
- de définir finement la fréquence et le type de données à sauvegarder
- un système d'alerte mail en cas de défaut de sauvegarde.
Il existe des [fournisseurs de dépôts borg distants](https://www.borgbackup.org/support/commercial.html), il est également possible de créer son propre dépôt sur un autre YunoHost avec l'[application borgserver](https://github.com/YunoHost-Apps/borgserver_ynh).
La future méthode de sauvegarde intégrée par défaut dans YunoHost sera basée sur ce logiciel.
## Mise en place de la sauvegarde
!!! Pour la mise en place, il faut d'abord installer l'[application borg](https://github.com/YunoHost-Apps/borg_ynh), puis éventuellement l'[application borgserver](https://github.com/YunoHost-Apps/borgserver_ynh).
## Tester
Avec les apps borg un email est envoyé pour dire si la sauvegarde échoue ou si le repo distant n'a rien reçu. On peut toutefois analyser manuellement pour s'assurer que tout va bien de façon plus complète.
```bash
# Lister les fichiers
app=borg; BORG_PASSPHRASE="$(yunohost app setting $app passphrase)" BORG_RSH="ssh -i /root/.ssh/id_${app}_ed25519 -oStrictHostKeyChecking=yes " borg list "$(yunohost app setting $app repository)" | less
# Lister les exports de base de données
app=borg; BORG_PASSPHRASE="$(yunohost app setting $app passphrase)" BORG_RSH="ssh -i /root/.ssh/id_${app}_ed25519 -oStrictHostKeyChecking=yes " borg list "$(yunohost app setting $app repository)" | grep "(db|dump)\.sql"
# Lister les fichiers de l'archive
app=borg; BORG_PASSPHRASE="$(yunohost app setting $app passphrase)" BORG_RSH="ssh -i /root/.ssh/id_${app}_ed25519 -oStrictHostKeyChecking=yes " borg list "$(yunohost app setting $app repository)::ARCHIVE" | less
# Voir les infos de l'archive
app=borg; BORG_PASSPHRASE="$(yunohost app setting $app passphrase)" BORG_RSH="ssh -i /root/.ssh/id_${app}_ed25519 -oStrictHostKeyChecking=yes " borg info "$(yunohost app setting $app repository)::ARCHIVE"
# Vérifier l'intégrité des données
app=borg; BORG_PASSPHRASE="$(yunohost app setting $app passphrase)" BORG_RSH="ssh -i /root/.ssh/id_${app}_ed25519 -oStrictHostKeyChecking=yes " borg check "$(yunohost app setting $app repository)::ARCHIVE" --verify-data
```
## Restaurer
Si on est dans le cas d'une migration ou d'une réinstallation, il faut réinstaller borg de la même façon. Si le repo est distant il faut changer la clé publique.
Lister les archives disponibles
```bash
app=borg; BORG_PASSPHRASE="$(yunohost app setting $app passphrase)" BORG_RSH="ssh -i /root/.ssh/id_${app}_ed25519 -oStrictHostKeyChecking=yes " borg list "$(yunohost app setting $app repository)"
```
Créer les archives tar (une archive par app et partie de système)
```bash
app=borg; BORG_PASSPHRASE="$(yunohost app setting $app passphrase)" BORG_RSH="ssh -i /root/.ssh/id_${app}_ed25519 -oStrictHostKeyChecking=yes " borg export-tar "$(yunohost app setting $app repository)::ARCHIVE" /home/yunohost.backup/archives/ARCHIVE.tar
```
Puis restaurer l'archive de façon classique.
### Restaurer des grosses archives
Si l'espace disponible est inférieur au poids de votre archive, des données décompressées et des dépendances, vous devrez restaurer partie par partie, app par app.
Si restaurer app par app ne suffit pas OU si une archive est trop grosse, il peut être judicieux de générer une archive tar sans les "grosses" données d'une app comme si elle avait été générée avec l'[option BACKUP_CORE_ONLY](/backup/include_exclude_files#ne-pas-sauvegarder-les-grosses-quantites-de-donnees). Exemple avec Nextcloud:
```bash
app=borg; BORG_PASSPHRASE="$(yunohost app setting $app passphrase)" BORG_RSH="ssh -i /root/.ssh/id_${app}_ed25519 -oStrictHostKeyChecking=yes " borg export-tar -e apps/nextcloud/backup/home/yunohost.app "$(yunohost app setting $app repository)::ARCHIVE" /home/yunohost/archives/ARCHIVE.tar
```
Il faudra ensuite extraire ces données directement avec borg
```bash
cd /home/yunohost.app/
app=borg; BORG_PASSPHRASE="$(yunohost app setting $app passphrase)" BORG_RSH="ssh -i /root/.ssh/id_${app}_ed25519 -oStrictHostKeyChecking=yes " borg extract "$(yunohost app setting $app repository)::ARCHIVE" apps/nextcloud/backup/home/yunohost.app/
mv apps/nextcloud/backup/home/yunohost.app/nextcloud ./
rm -r apps
```
Puis restaurer de façon classique

View file

@ -1,91 +0,0 @@
---
title: BorgBackup
template: docs
taxonomy:
category: docs
routes:
default: '/backup/borgbackup'
page-toc:
active: true
depth: 3
---
YunoHost propone due programmi per [BorgBackup](https://www.borgbackup.org/).
## Funzionalità
con BorgBackup potrete:
- effettuare il backup dei dati in un HD esterno o in un repository borg remoto
- deduplicare e comprimere i file, che permette di mantenere molte versioni precedenti
- la cifratura dei dati, permettendo così di conservare in modo sicuro i file presso soggetti terzi
- definire i tipi di dati da copiare e la frequenza di backup
- ricevere una mail di allerta in caso di fallimento del backup
Oltre ai [fornitori terzi di repository](https://www.borgbackup.org/support/commercial.html), vi è la possibilità di hostare il proprio repository su una differente installazione YunoHost con installata l'[applicazione borgserver](https://github.com/YunoHost-Apps/borgserver_ynh).
Il futuro metodo di backup integrato in YunoHost sarà basato su BorgBackup
## Pianificazione del backup
!!! Installate l'[applicazione borg](https://github.com/YunoHost-Apps/borg_ynh), ed eventualmente l'[applicazione borgserver](https://github.com/YunoHost-Apps/borgserver_ynh).
## Test
Con il programma borg una mail viene inviata nel caso la sessione di backup fallisca o nel caso il repository di destinazione non riceva nessun dato. Da terminale possiamo controllare nei minimi dettagli, che tutto funzioni.
```bash
# Elencare i files
app=borg; BORG_PASSPHRASE="$(yunohost app setting $app passphrase)" BORG_RSH="ssh -i /root/.ssh/id_${app}_ed25519 -oStrictHostKeyChecking=yes " borg list "$(yunohost app setting $app repository)" | less
# Elencare le esportazioni del database
app=borg; BORG_PASSPHRASE="$(yunohost app setting $app passphrase)" BORG_RSH="ssh -i /root/.ssh/id_${app}_ed25519 -oStrictHostKeyChecking=yes " borg list "$(yunohost app setting $app repository)" | grep "(db|dump)\.sql"
# Elencare i file contenuti nell'archivio
app=borg; BORG_PASSPHRASE="$(yunohost app setting $app passphrase)" BORG_RSH="ssh -i /root/.ssh/id_${app}_ed25519 -oStrictHostKeyChecking=yes " borg list "$(yunohost app setting $app repository)::ARCHIVE" | less
# Ottenere informazioni sull'archivio
app=borg; BORG_PASSPHRASE="$(yunohost app setting $app passphrase)" BORG_RSH="ssh -i /root/.ssh/id_${app}_ed25519 -oStrictHostKeyChecking=yes " borg info "$(yunohost app setting $app repository)::ARCHIVE"
# Verificare l'integrità dei dati
app=borg; BORG_PASSPHRASE="$(yunohost app setting $app passphrase)" BORG_RSH="ssh -i /root/.ssh/id_${app}_ed25519 -oStrictHostKeyChecking=yes " borg check "$(yunohost app setting $app repository)::ARCHIVE" --verify-data
```
## Ripristino
Se effettuiamo il ripristino dopo una migrazione o una reinstallazione dobbiamo reinstallare borg nello stessa maniera. Se il repository si trova in un server remoto bisogna cambiare la chiave pubblica.
Elencare gli archivi disponibili
```bash
app=borg; BORG_PASSPHRASE="$(yunohost app setting $app passphrase)" BORG_RSH="ssh -i /root/.ssh/id_${app}_ed25519 -oStrictHostKeyChecking=yes " borg list "$(yunohost app setting $app repository)"
```
Creare gli archivi tar (uno per ogni applicazione e componente del sistema)
```bash
app=borg; BORG_PASSPHRASE="$(yunohost app setting $app passphrase)" BORG_RSH="ssh -i /root/.ssh/id_${app}_ed25519 -oStrictHostKeyChecking=yes " borg export-tar "$(yunohost app setting $app repository)::ARCHIVE" /home/yunohost/archives/ARCHIVE.tar
```
In seguito ripristinare l'archivio come di consueto.
### Ripristino di archivi di grandi dimensioni
Se lo spazio disponibile è inferiore alla dimensione del vostro archivio, dei dati scompattati e delle dipendenze, dovrete ripristinare un'applicazione alla volta.
Se il ripristino non riesce o se un archivio è troppo grande, è più prudente creare un archivio tar senza la parte più grande dei dati, cioè come se l'archivio fosse stato creato con l'[opzione BACKUP_CORE_ONLY](/backup/include_exclude_files#don't-save-large-quantities-of-data). Di seguito un esempio con Nextcloud:
```bash
app=borg; BORG_PASSPHRASE="$(yunohost app setting $app passphrase)" BORG_RSH="ssh -i /root/.ssh/id_${app}_ed25519 -oStrictHostKeyChecking=yes " borg export-tar -e apps/nextcloud/backup/home/yunohost.app "$(yunohost app setting $app repository)::ARCHIVE" /home/yunohost/archives/ARCHIVE.tar
```
In seguito si estrarranno questi dati direttamente con borg
```bash
cd /home/yunohost.app/
app=borg; BORG_PASSPHRASE="$(yunohost app setting $app passphrase)" BORG_RSH="ssh -i /root/.ssh/id_${app}_ed25519 -oStrictHostKeyChecking=yes " borg extract "$(yunohost app setting $app repository)::ARCHIVE" apps/nextcloud/backup/home/yunohost.app/
mv apps/nextcloud/backup/home/yunohost.app/nextcloud ./
rm -r apps
```
Procedere poi con il consueto metodo di ripristino

View file

@ -1,102 +0,0 @@
---
title: BorgBackup
template: docs
taxonomy:
category: docs
routes:
default: '/backup/borgbackup'
page-toc:
active: true
depth: 3
---
YunoHost offers a couple of applications for [BorgBackup](https://www.borgbackup.org/).
## Functionality
This application offers:
- backup of data on an external disk or on a remote Borg repository
- deduplication and compression of files, which allows to keep many previous copies
- data encryption, which allows you to store data with a third party
- to define the frequency and type of data to be backed up
- a mail alert system in case of backup failure.
There are [remote borg repository providers](https://www.borgbackup.org/support/commercial.html), it is also possible to create your own repository on another YunoHost with the [borgserver application](https://github.com/YunoHost-Apps/borgserver_ynh).
The future default backup method integrated in YunoHost will be based on this software.
## Setting up the backup
!!! To set up, first install the [borg application](https://github.com/YunoHost-Apps/borg_ynh), then optionally the [borgserver application](https://github.com/YunoHost-Apps/borgserver_ynh).
## Finding the borg command
The `borg` command is found inside the installation directory of the app. You should generaly prefer using this executable rather than the one installed by Debian's package, to ensure compatibility.
```bash
# Get the path to the borg executable
alias borg="$(yunohost app setting $app install_dir)/venv/bin/borg"
```
The rest of this documentation assumes this alias is present in your shell, or that you added the venv in your PATH.
## Test
With the borg apps an email is sent to say if the backup fails or if the remote repo has received nothing. However, you can manually test to make sure everything is fine in a more complete way.
```bash
# List files
app=borg; BORG_PASSPHRASE="$(yunohost app setting $app passphrase)" BORG_RSH="ssh -i /root/.ssh/id_${app}_ed25519 -oStrictHostKeyChecking=yes " "$borg" list "$(yunohost app setting $app repository)" | less
# List database exports
app=borg; BORG_PASSPHRASE="$(yunohost app setting $app passphrase)" BORG_RSH="ssh -i /root/.ssh/id_${app}_ed25519 -oStrictHostKeyChecking=yes " "$borg" list "$(yunohost app setting $app repository)" | grep "(db|dump)\.sql"
# List files from the archive
app=borg; BORG_PASSPHRASE="$(yunohost app setting $app passphrase)" BORG_RSH="ssh -i /root/.ssh/id_${app}_ed25519 -oStrictHostKeyChecking=yes " "$borg" list "$(yunohost app setting $app repository)::ARCHIVE" | less
# View archive info
app=borg; BORG_PASSPHRASE="$(yunohost app setting $app passphrase)" BORG_RSH="ssh -i /root/.ssh/id_${app}_ed25519 -oStrictHostKeyChecking=yes " "$borg" info "$(yunohost app setting $app repository)::ARCHIVE"
# Verify data integrity
app=borg; BORG_PASSPHRASE="$(yunohost app setting $app passphrase)" BORG_RSH="ssh -i /root/.ssh/id_${app}_ed25519 -oStrictHostKeyChecking=yes " "$borg" check "$(yunohost app setting $app repository)::ARCHIVE" --verify-data
```
## Restore
If we are in the case of a migration or a reinstallation, we must reinstall borg in the same way. If the repo is remote you have to change the public key.
List the available archives
```bash
app=borg; BORG_PASSPHRASE="$(yunohost app setting $app passphrase)" BORG_RSH="ssh -i /root/.ssh/id_${app}_ed25519 -oStrictHostKeyChecking=yes " "$borg" list "$(yunohost app setting $app repository)"
```
Create tar archives (one archive per app and system part)
```bash
app=borg; BORG_PASSPHRASE="$(yunohost app setting $app passphrase)" BORG_RSH="ssh -i /root/.ssh/id_${app}_ed25519 -oStrictHostKeyChecking=yes " "$borg" export-tar "$(yunohost app setting $app repository)::ARCHIVE" /home/yunohost/archives/ARCHIVE.tar
```
Then restore the archive in the usual way.
### Restore large archives
If the available space is less than the weight of your archive, decompressed data and dependencies, you will have to restore part by part, app by app.
If restoring app by app is not enough OR if an archive is too big, it may be a good idea to generate a tarball without the "big" data of an app as if it had been generated with the [BACKUP_CORE_ONLY option](/backup/include_exclude_files#don't-save-large-quantities-of-data). Example with Nextcloud:
```bash
app=borg; BORG_PASSPHRASE="$(yunohost app setting $app passphrase)" BORG_RSH="ssh -i /root/.ssh/id_${app}_ed25519 -oStrictHostKeyChecking=yes " "$borg" export-tar -e apps/nextcloud/backup/home/yunohost.app "$(yunohost app setting $app repository)::ARCHIVE" /home/yunohost.backup/archives/ARCHIVE.tar
```
You will then have to extract these data directly with borg
```bash
cd /home/yunohost.app/
app=borg; BORG_PASSPHRASE="$(yunohost app setting $app passphrase)" BORG_RSH="ssh -i /root/.ssh/id_${app}_ed25519 -oStrictHostKeyChecking=yes " "$borg" extract "$(yunohost app setting $app repository)::ARCHIVE" apps/nextcloud/backup/home/yunohost.app/
mv apps/nextcloud/backup/home/yunohost.app/nextcloud ./
rm -r apps
```
Then restore in the classic way

View file

@ -1,21 +0,0 @@
---
title: Restic
template: docs
taxonomy:
category: docs
routes:
default: '/backup/restic'
page-toc:
active: true
depth: 3
---
## Fonctionnalité
Cette application propose:
- la sauvegarde des données sur un stockage distant (support de différents types de stockage)
- la déduplication et la compression des fichiers ce qui permet de conserver de nombreuses copies antérieures
- le chiffrement des données, ce qui permet de pouvoir stocker chez un tiers
Le paquet permet aussi de définir finement la fréquence et le type de données à sauvegarder et intègre un système d'alerte mail en cas de défaut de sauvegarde.

View file

@ -1,21 +0,0 @@
---
title: Restic
template: docs
taxonomy:
category: docs
routes:
default: '/backup/restic'
page-toc:
active: true
depth: 3
---
## Funzionalità
Questa applicazione permette:
- il backup dei dati in rete (compatibile con diverse modalità di stoccaggio dei dati)
- deduplicare e comprimere i file, permettendo di mantenere molte copie precedenti
- la cifratura dei dati, permettendo così di conservare in modo sicuro i file presso soggetti terzi
Il programma permette di configurare con precisione i dati che devono essere salvati e la frequenza dei backup, e comprende un sistema di allerta via mail nel caso di fallimento nell'esecuzione del backup

View file

@ -1,21 +0,0 @@
---
title: Restic
template: docs
taxonomy:
category: docs
routes:
default: '/backup/restic'
page-toc:
active: true
depth: 3
---
## Functionality
This application offers:
- backup of data to remote storage (support for different types of storage)
- deduplication and compression of files, which makes it possible to keep many previous copies
- data encryption, which allows to store data at a third party
The package also allows you to finely define the frequency and type of data to be backed up and integrates an email alert system in case of backup failure.

View file

@ -1,22 +0,0 @@
---
title: Archivist
template: docs
taxonomy:
category: docs
routes:
default: '/backup/archivist'
page-toc:
active: true
depth: 3
---
## Fonctionnalité
Cette application se base sur rsync et GPG, elle propose:
- la sauvegarde des données sur un stockage distant (support de différents types de stockage)
- le chiffrement des données, ce qui permet de pouvoir stocker chez un tiers
Le paquet permet aussi de définir finement la fréquence et le type de données à sauvegarder et intègre un système d'alerte mail en cas de défaut de sauvegarde.
Pour plus d'information : <https://forum.yunohost.org/t/new-app-archivist/3747>

View file

@ -1,22 +0,0 @@
---
title: Archivist
template: docs
taxonomy:
category: docs
routes:
default: '/backup/archivist'
page-toc:
active: true
depth: 3
---
## Functionality
This application is based on rsync and GPG, it offers:
- backup of data on a remote storage (support for different types of storage)
- data encryption, which allows to store data at a third party
The package also allows you to finely define the frequency and type of data to be backed up and integrates an email alert system in case of backup failure.
For more information: <https://forum.yunohost.org/t/new-app-archivist/3747>

View file

@ -1,5 +1,5 @@
---
title: Backup Methods
title: Backup methods
template: docs
taxonomy:
category: docs
@ -10,28 +10,35 @@ page-toc:
depth: 3
---
## [BorgBackup](/borgbackup)
YunoHost currently has three apps integrating backup solutions offering more features than the simple ".tar" mechanism shipped in YunoHost, in particular automatic and remote backups.
This application offers:
## [BorgBackup](https://www.borgbackup.org/) (cf the [Borg "client"](https://apps.yunohost.org/app/borg) and [Borg "server"](https://apps.yunohost.org/app/borgserver) apps)
- backup of data on an external disk or on a remote Borg repository
- deduplication and compression of files, which allows to keep many previous copies
- deduplication and compression of files, which makes it possible to keep many previous copies without too much storage overhead
- data encryption, which allows you to store data with a third party
- to define the frequency and type of data to be backed up
- a mail alert system in case of backup failure.
## [Restic](/restic)
There are [remote borg repository providers](https://www.borgbackup.org/support/commercial.html), it is also possible to create your own repository on another YunoHost with the [borgserver application](https://github.com/YunoHost-Apps/borgserver_ynh).
This application offers:
## [Restic](https://restic.net/) (cf the [Restic app](https://apps.yunohost.org/app/restic))
- backup of data to remote storage (support for different types of storage)
- deduplication and compression of files, which makes it possible to keep many previous copies
- backup of data to remote storage (support for different types of storage, inclusing S3 and SFTP)
- deduplication and compression of files, which makes it possible to keep many previous copies without too much storage overhead
- data encryption, which allows to store data at a third party
- to define the frequency and type of data to be backed up
- a mail alert system in case of backup failure.
## [Archivist](/archivist)
## [Archivist](https://apps.yunohost.org/app/archivist)
!! This application is currently broken!
This application is based on rsync and GPG, it offers:
- based on rsync and GPG
- backup of data on a remote storage (support for different types of storage)
- data encryption, which allows to store data at a third party
The package also allows you to finely define the frequency and type of data to be backed up and integrates an email alert system in case of backup failure.
More info: <https://forum.yunohost.org/t/new-app-archivist/3747>