Restic thinks all files are new after windows reinstall

Context: I have data stored on a HDD, and I utilize restic version 0.15.1 to perform backups of this data onto an external drive. Recently, I reinstalled Windows on my SSD, which, importantly, did not modify any of the data stored on the HDD. However, when I initiated a fresh backup of the HDD to the external drive using restic, the software erroneously identifies all the files as new. Therefore all files are read completely from the drive which takes quite the time. However they are not copied to the backup. My guess is that all hashes are calculated again.

Why is that? Does restic create a cache somewhere on the C drive with the hash of every backed up file?

image
Reading the logs more thoroughly the cache indeed got deleted.

If the paths didn’t change, you could have specified --parent <Snapshot-ID> and it likely would have sped up the process. If the hostname changed with the reinstall, that would explain why it couldn’t find the parent, btw.

1 Like

The hostname did indeed change.

But thanks to deduplication no new data will be uploaded (but some metadata). Only cost is slower first backup when all stuff has to be re-hashed.

1 Like

Yeah, so you could have specified --parent and it would have gone faster. OR you could have used the -H switch and put in your old hostname.

Going forward, it should properly reference the parent snapshot. If you use the -H switch, you’ll have to do it every time.

If you want to use the -H switch for consistency’s sake, just make another backup with the -H switch and use --parent to reference the last snapshot. Then forget the snapshots with the new hostname. Going forward, continue using the -H switch.