Restore remote incremental backups don't work

I have actually dug into this quite a lot already and the Restic tool that is used for doing incremental backups does not do restores as we would expect.

Here is a test:

  1. Create an incremental backup.
  2. Add a file anywhere in the website directory
  3. Do a restore.
  4. Check to see if the new file is still there. It will be, because restic doesn’t delete files that aren’t in the snapshot that is being restored.

This is a huge issue as you could end up with all sorts of files and folders in your website directory that should not be there. For instance, you take a snapshot prior to installing some plugins, then restore the snapshot to return to where you were. The plugin folders will remain. And who knows how it treats the database…

I have documented all of this in this Github Issue and recommended that the incremental backup function be disabled until CyberPanel handles it better (I’ve provided a suggestion for this with rclone sync) or restic merges a PR for this type of proper syncing functionality, but there hasn’t been a response from @usmannasir about it yet…

RClone for Incremental Backups · Issue #831 · usmannasir/cyberpanel (github.com)

If anyone is interested in helping to fix this, I already started a process to have the CyberPanel incremental backup function (which works with restic) integrate with rclone, so that you can use pretty much any remote provider that you want (I had it working with OneDrive). But, again, we will need to fix the restore mechanism, which should involve mounting the restic snapshot as a drive, then using rclone sync to do a proper sync (restore the folder to exactly how it was when the snapshot was taken) between the snapshot and the local files.

2 Likes