Backup using the moulinette?

Could anybody explain how to use the yunohost backup functionality?

I tried to use it:

sudo yunohost backup create -h

this gives:


usage: yunohost backup create [-h] [-d DESCRIPTION] [-o OUTPUT_DIRECTORY]
[-n NAME] [–hooks [HOOKS [HOOKS …]]] [-r]
[–ignore-apps]

optional arguments:
-h, --help show this help message and exit
-d DESCRIPTION, --description DESCRIPTION
Short description of the backup
-o OUTPUT_DIRECTORY, --output-directory OUTPUT_DIRECTORY
Output directory for the backup
-n NAME, --name NAME Name of the backup archive
–hooks [HOOKS [HOOKS …]]
List of backup hooks names to execute
-r, --no-compress Do not create an archive file
–ignore-apps Do not backup apps

But when I launch “sudo yunohost backup create” I get an error message.

Is there any documention somewhere? thanks !

It seems that the folder “archives” in “/home/yunohost.backup/” was missing.

After creating it, “yunohost backup create” launch the backup :slight_smile:

New question: Is there a way to avoid the script to backup the “/home” folder ? (as the backup file is stored by default in the folder “/home/yuohost.backup/archives/”, it is doubling the size of “/home”)

I opened 2 tickets:
https://github.com/YunoHost/moulinette-yunohost/issues/65

https://github.com/YunoHost/moulinette-yunohost/issues/66

I think the yunohost.backup is excluded from backup.
See https://github.com/YunoHost/moulinette-yunohost/blob/unstable/data/hooks/backup/17-system_home

If you really find yunohost dir in the home archive, may be the rsync exclude instruction is misformed ?

Hi all,

It’s an old topic but there are still things that are unclear to me regarding the backup feature.
The reason I’m asking is as follow:
After an unsuccessful upgrade and multiple issues, my Nextcloud app was removed (clean remove, including the database).

I have a “full” backup archive available. So I wanted to use the --apps option to reinstall only the Nextcloud part.
sudo yunohost backup restore [name-of-archive] --apps nextcloud --ignore-hooks

But I got a warning/question about whether I really want to restore over an existing installation or not. Since the app is clearly not there, I assumed I was about to overwrite something else, so I stopped right there.

Is the restore system modular as so I can restore only one app out of a larger archive on an existing installation, or is this risky?

It’s a misconception, this question is always asked on system with a /etc/yunohost/installed file.

But after that only the app will be restored.

I’ve done it today, and indeed, it worked smoothly.

Thanks!

J’ai un souci avec l’option -o pour faire un backup sur un support externe : ça copie laisse le .info.json dans le dossier /home/yunohost.backup/archives, et ça ne copie que le .tar.gz. Du coup, si tu perds le disque dur de ton serveur, le backup est inutilisable.
Pourquoi pas garder le .info.json dans le dossier archives, avec le liens symbolique vers le dossier de sauvegarde, c’est pratique à utiliser, mais il faudrait en parallèle copier le .info.json dans le dossier externe.

Le .info.json est aussi dans le tar.
Il peut être retrouvé de cette façon

tar -zxvf NAME.tar.gz info.json
mv info.json NAME.info.json

Ah ok. Du coup ça doit pas être très compliqué de permettre à yunohost de restaurer un backup uniquement à partir du .tar.gz ? Le jour où j’ai eu besoin de ces backups j’ai mis un moment à comprendre pourquoi j’arrivais pas à le restaurer, et heureusement que j’avais encore accès à mon disque défaillant pour retrouver le .info.json…