What are best settings for restic in this (personal) use case

• The output of restic version.
restic 0.16.2 compiled with go1.21.3 on linux/amd64

• The complete commands that you ran (leading up to the problem or to reproduce the problem).
No problem, just a question :slight_smile:

• Any environment variables relevant to those commands (including their values, of course).
I have not set any, not sure how to check

• The complete output of those commands (except any repeated output when obvious it’s not needed for debugging).
N/a

Hi, my use case is the following:

Using restic on an x86 laptop running a Linux distro to backup persoanl data to an external hard disk connected to the laptop with a USB cable - ie pretty simple.

I would like to be able to easily continue using the same restic repo that I have created on the external hard disk under the following situations:

  1. My laptop dies and I need to replace it with a different laptop, reinstall the same Linux distro and restic and need to do a full restore of my data from the repo on the external hard disk.

  2. I change to a different Linux distro (that supports restic) either on my existing laptop or a replacement laptop, reinstall restic and need to do a full restore of my data from the repo on the external hard disk.

  3. I use a different hostname on the new distro or laptop

  4. I use a different username on the new distro or laptop

  5. I want to move the repo on the external hard disk to a different external hard disk.

  6. I change the source path on the laptop to the data

  7. I change the destination path to the repo on the external hard disk

In any of the above changes I would just like to be able to continue to use the same restic command syntax and the same repo after the change as I did before the change.

IE I would like to be able to use the same repo regardless of hardware, distro, host name, user name or external hard disk, etc, change. I would like to use restic in the same way that a simple copy command is independent of these factors.

I had posted the issue:

https://forum.restic.net/t/no-parent-snapshot-found-will-read-all-files-issue/8576

Which led me to conclude that I should use the following restic settings:

restic -r --host main ${mydestination} --verbose backup ${mysource}

But as I learn more about restic, I see there are a lot of other options and maybe I should be using other options for my use case.

I am concerned that if I use incorrect options now, then in future, if I do use a different laptop, distro, username, hostname, or external hard disk, etc, I will not be able to access the repo or all snapshots in the same repo.

I am concerned that the repo somehow contains the original path, hardware id, username, hostname, etc and will not restore to one or more of these being changed, unless I set some options that will cause the repo ignore these changes.

Any feedback or help would be appreciated :slight_smile:

I am just a home user of Linux and restic and not an IT pro, so please provide answers that can be understood by a beginner.

Thanks ahead of time…

2 Likes

I’d argue you don’t actually need any special backup command flags, so long as you’re fine with the first backup after making any of those changes taking a little longer (apart from #5 and #7, which require you to update the command to point to the new repository location).

The reason for the above being, restic will not upload the same data twice to the repository. So while the first backup after making one of those changes you specified may take a little longer than expected (as restic may need to re-scan the entire dataset to work out what new data it needs to store in the repository), after that initial backup you should be back to normal.

If you’re trying to eliminate that initial backup after making a change taking longer than normal, you can do this for most of your scenarios, but it will involve some fiddling. I’m also not sure it’s possible to cover every one of your scenarios; #6 in particular I don’t think is easily solvable.

If you want my opinion, just don’t stress about it. Your previous issue shows you’ve got a somewhat unusual setup where the hostname changes frequently, so setting the hostname makes sense in your case (and solves #3 from your list).

Anecdotally, I switched a machine from windows to linux a few years back (while keeping the same data), and it’s still backing up to the same repository without incident. The only “gotcha” was I needed to adjust my forget policy to not group by hostname (which is fine, as I use one backup repository per-system). Otherwise, all the snapshots taken under windows would remain in the repository forever.

3 Likes

@shd2h - Thanks very much for taking the time to post and helping me out.

Good to hear that you switched from Windows to Linux and the repo kept working.

I will use the existing restic syntax and go from there.

2 Likes