What to backup?

Hey,

I installed restic (cmd tool not the app) on my yunohost server.
I want to save all important data from my apps, like nextcloud, trilium… and so on, on a NAS.
I added “/var/www” and “/home/yunohost.app” and I am a bit afraid I miss something? What else is important to not loose data? Or can we use the Snapshot functionality (but I have limited space on my local yunohost ).
I am missing some experience in WHAT I have to backup so I can restore all important data.

Thanks in advance!

That’s a very personal question. Just imagine you had to reinstall the whole server again, what data would give you pain if it disappeared or was corrupt?

Photos?
/home/ folder?
shell scripts you’ve made?
passwords?

For myself, I backup the following folders with restic

/home/username/ (my shell scripts and docker-compose files)
/home/yunohost.app/nextcloud/data/username/files/ (nextcloud files)
/home/yunohost.backup/archives/ (yunohost backup files)

1 Like

Here 4 solutions for your use case:

Borg_ynh

If you can have borg on your NAS, i think you should use the borg_ynh package that have a best quality i think than restic_ynh (but i am a bit partial).

Restic_ynh

In second, you can use restic_ynh package (but be sure to well check your backup regularly even if i can give the same advice for borg ^^)

By hand with restic

Finally, if you want to backup “by hand”, and to answer your question, you can read all backup scripts of your yunohost apps.
For example for nextcloud: nextcloud_ynh/backup at master · YunoHost-Apps/nextcloud_ynh · GitHub
To read all this script:

cat /etc/yunohost/apps/*/scripts/backup

You should also add:
/etc
/home (except /home/yunohost.backup)
/var/mail
And maybe xmpp stuff if you use it

By hand with a hook and restic

An other way to do it by hand, if you know a bit bash, you can use the hook mechanism to use the yunohost backup features coupled with restic without need space in /home/yunohost.backup/archives.But in this last case, i suggest you to use the restic_ynh and fix what is annoying you if it’s relevant.

1 Like