Help with full home directory restore linux (pop_os)

Hey, I have been using restic to backup my home directory on my laptop and just got a new laptop. I am backing up like this

restic -r sftp:zac@pi:/backups/pop-os --verbose backup /home/zac --exclude-file=/home/zac/.restic_excludes

.restic_excludes

/home/zac/Downloads
/home/zac/pCloudDrive
/home/zac/Qt
/home/zac/.local/share/trash

I went to restore my home directory like so

export RESTIC_PASSWORD_FILE=/home/zac/.restic_password
export RESTIC_REPOSITORY=sftp:zac@pi:/backups/pop-os

restic -vvv restore latest --target /

And got a bunch of Ignoring error for symlink and file exists errors. It looks like restic just continued and exited as fatal, but I’m not seeing any info on how restic handles this sort of thing in the docs or help page.

I tried grabbing the latest build which should include a merge that handles symlinks but the same errors popped up when I ran another restore.

Could anyone shed some light on this either with a link or some info? Does restic truly just skip over errors and just continue? So if there were 40 of these ignored errors that implies only 40 individual files failed to be restored?

Overwriting existing files will probably work in most cases but not all, the exact semantics are a bit messy right now. The recommended way is to restore to a temporary folder and then move the files you need out of there.

I’m not sure I can follow your description, what is the log output of restic? restore will skip files which it cannot restore but will continue restoring everything else.

Sorry for the late reply, got super caught up at work.

That last sentence is all the info I was looking for thank you!

In reply to me restoring incorrectly, I noticed in the examples they always restore to a temp dir but didn’t realize that the process for a full restore like this is intended to be restore->move. That’s good to know I’ll try that next time.

I’m curious though, what do you mean by

the exact semantics are a bit messy right now.

What about restic’s restore functionality makes it unsuitable for directly restoring into a directory like this? Is there just not enough control to specify how to handle each conflict causing errors or unexpected results?

There are a few unknowns: should files that already exist in a folder but not in the snapshot be kept or deleted? What to do if the snapshot contains a file, but a directory with the same name already exists? And quite a few more corner cases.