Full restore state

Hi all. I’m using Restic, along with Borg, as part of my 3-2-1 backup of my desktop which is a Linux laptop. My Restic and Borg repositories contain roughly monthly snapshots going back about a year. The repositories back up a few key folders of personal files from my home directory.
I’m about to nuke and pave the system to change distributions and plan to restore my files onto the new OS install from Restic’s most recent snapshot.
I’ve never done a full restore before and wonder two things.
From Restic’s point of view, does restoring from the most recent snapshot put my system in the same position it was at the time of the most recent snapshot? If I were to, for example, do a backup right after restoring that snapshot, and had not changed any of my files after OS install, there would be no new or changed files in that new snapshot? Meaning, Restic won’t treat my files as entirely new and want to back them all up. (I’m assuming they’re hashed and the hashes will all be the same as in the snapshot I restored from.)
My second question regards Borg. Once the last Restic snapshot is restored, will Borg think the files are all totally changed and effectively do a full snapshot of every one of my files in its next backup?

Not the system but all the files you backed up. Not sure how firm you are with Linux but most package managers have a way of listing all explicitly installed packages which you could do before reinstalling, so you know what to install again. And then you have to find out what has changed in /etc that you might need in addition to your home folder. Those are usually the most important places but there might of course be others.

Depending on whether you change the distribution, desktop or even a version of those, there will likely be some new files right after booting and starting some software.

But in general: restic doesn’t backup files but chunks of all files. It calculates a hash of those chunks and only adds to the repository what it doesn’t have so far. In your situation you will likely not see a lot of changes in that first snapshot. Just be aware that the backup will still probably take longer as restic’s cache will be rebuilt at that first run.

I’m sorry I don’t have any experience with borg but judging from a quick look at the website I’m guessing it will likely be the same.

Thanks for the reply. I spoke incorrectly when I used the term “system.” I should have referred instead to my directories of personal files that I have been backing up in the Restic/Borg repositories; I have no system files or directories in my repos. My concern is whether or not my first backup after OS install and restoration of my Restic repo’s files from my last Restic snapshot will effectively be addition of all of my personal files again to the repo, thus bloating the repo. But from your answer I take it that likely no, Restic will understand the restored files are already in that previous snapshot and won’t add them again. Thanks again.

Ah okay, yes you’re assuming correctly. Restic will take a while on the first run for rebuilding the cache but no files will be added if they weren’t somehow changed. Note that they will appear to have been added if, for instance, the path has changed (like /home/user on Linux to /Users/user on macOS). But only the references will have been changed, the file chunks themselves still the same.

1 Like