Restic backup from Nextcloud to local repository

Hey there,

first of all thanks for everybody involved in making restic happen! It is amazing!

My problem: I want to backup my files stored in a hosted Nextcloud instance using restic and the rclone backup. Despite having rclone all set up and being able to store a repository on the rclone backend, I am not able to backup data from the Nextcloud to a local repository. Note that I am speaking of an externally hosted Nextcloud instance of which I only want to backup my user data; i.e. no databases or such. The following command:

./restic_0.12.1_linux_amd64 --repo /home/martin/TEST_REPO/ backup rclone:nextcloud_martin:/data

fails with the error

rclone:nextcloud_martin:/data does not exist, skipping
Fatal: all target directories/files do not exist

Is that behaviour intended or am I doing something wrong?

My system: Xubuntu 20.04.3 LTS, restic 0.12.1 as downloaded from the github releases.

I followed this tutorial to set up the details: Verschlüsselte Backups mit Rclone und restic in Nextcloud erstellen | hosting.de. Please excuse the fact that it is in German - the code listings should be easy to understand, though, in case that matters.

Additionally, I used this link: Preparing a new repository — restic 0.12.1 documentation. Confusingly, the statement

The general backend specification format is rclone:<remote>:<path>, the <remote>:<path> component will be directly passed to rclone

does not seem to hold for me when trying to backup data from the Nextcloud backend.

Could you please help me? :slight_smile:

Please let me know if any information is missing!

The various backends in restic, both the embedded/build-in ones and the rclone supported ones, are for the repository only. So you cannot use e.g. an rclone backend to backup files “from”, sorry.

You’d have to mount those files from the Nextcloud on the system where you run restic somehow, e.g. using WebDAV or whatever Nextcloud supports. Or, if you can, run restic on the Nextcloud server. Regardless, then you’d point the backup command to a regular path in the filesystem, e.g. where you mounted the files.

I ran into this issue as well. Maybe the devs could consider changing this?