Change snapshot path

Hi all.

I have an external HDD with about 2TB of data, which I backup on another external HDD. This happens on a Windows and on a Linux PC, which obviously have different paths for the same files. And even using only Windows, the drive letter sometimes changes.

Even if no duplication happens, rescanning all the files takes 10+ hours.

I’m aware of a similar issue pointing to an old and very long backup: Add options --set-path and --set-path-from by aawsome · Pull Request #3200 · restic/restic · GitHub.

What is the current way of solving the problem? Is there a way to change the root path of an existing snapshot?

Thank you.

I opened Add --new-path-remove and --new-path-add to rewrite command by neclepsio · Pull Request #4604 · restic/restic · GitHub, hoping I understood how the code works.

1 Like

If I understand correctly, this would solve my issue and I would be happy to use your functionality to update a changed mount point. Thanks @neclepsio!

@neclepsio That approach won’t work. The file structure within a snapshot still doesn’t match and thus backup will still have to rescan all files.

To properly fix this we’ll likely have to adapt something like Introduce a label to uniquely identify 'what' is backed up · Issue #4026 · restic/restic · GitHub or add a --strip-prefix option to the backup command.

That’s what I thought too, then I saw the paths for stored files where relative to snapshot metadata root? Now that I think about, that would be a problem with multiple roots. I will look into the issue you mentioned.