Hi [carlier74] as your data folder is on an external storage you need to back up your settings so if you happen to have an error in your snap installation you can easily restore the settings and the files remain unchanged on your external storage
In my scenario I follow the following script
- ->> Remove the Default Backups Directory.
rm -rf /var/snap/nextcloud/common/backups
2 ->> I create a folder called Backups on the external drive where the nextcloud data folder is.
mkdir /mnt/Nextcloud/Backups
- ->> I create a symbolic link pointing to the folder that was created in the previous step.
ln -s /mnt/Nextcloud/Backups /var/snap/nextcloud/common/backups
- ->> I export the Settings
nextcloud.export -abc
5 Backup the drive with Borg or rsync
Restoration
- ->> install snap
sudo snap install nextcloud
- ->> Remove the default backups directory
rm -rf /var/snap/nextcloud/common/backups
- ->> Symbolic link to the backups folder on the external storage
ln -s /mnt/Nextcloud/Backups /var/snap/nextcloud/common/backups
- ->> Restore Settings
nextcloud.import -abc /var/snap/nextcloud/common/backups/20221002-1200
- ->> Activate the option for snap to recognize external storage media.
sudo snap connect nextcloud:removable-media
Ready!! Your nextcloud instance will already be restored