danb35 / freenas-iocage-nextcloud

Script to create an iocage jail on FreeNAS for the latest Nextcloud 28 release, including Caddy, MariaDB or PostgreSQL, and Let's Encrypt
GNU General Public License v3.0
258 stars 71 forks source link

Backup and Restore #107

Closed NasKar2 closed 4 years ago

NasKar2 commented 4 years ago

Currently there is no automated way to backup and restore nextcloud to a new install if something goes wrong with your jail. Included is a fix that the nextcloud/config directory is not created if it doesn't exist.

Backup and Restore

NextcloudBR.sh and NextcloudBR-config are automatically copied to the jails /usr directory. At the end of the restore the script will reset the admin password and ask for a new one. You can automate backup up by setting the cron variable to "yes" in the NextcloudBR-config. It will then automatically backup and not give you the option to restore. The version of nextcloud must be the same as the version of the backup or it will break the install.

run the backup and restore script from the iocage jail for nextcloud

from outside the jail

iocage console nextcloud

from inside the jail

/usr/NextcloudBR.sh

To run the backup automatically add to a crontab -e after setting the cron variable to "yes" in NextcloudBR-config

45 3 * * * /usr/NextcloudBR.sh
PrivatePuffin commented 4 years ago

I think this is a very complicated solution for something that is as simple as:

Basically what I covered here: https://github.com/Ornias1993/jailman/tree/jails/nextcloud

PrivatePuffin commented 4 years ago

Considering @danb35 just merged my PR: All data required to be backed up is now seperated from the main nextcloud jail and the readme includes the instruction to create seperate datasets for them.

They can be easily and more reliably be backed up using freenas nextcloud snapshots imho. Instead of 500+ rows of code.

PrivatePuffin commented 4 years ago

@danb35 Considering the changes after this PR was submitted and the fact it isn't even mergeable anymore, I suggest closing this.

NasKar2 commented 4 years ago

No need as reinstall with old data works great