[Borgbackup] How to restore repo to another directory?

JK qzwx2007 at gmail.com
Thu Nov 30 03:24:54 EST 2017


We have several borg repos which I need to be periodically backup on to 
USB disks / cloud / remote sites.   Borg with-lock seems to make it 
possible to take coherent snapshot from a repo e.g. using tar (something 
like: borg with-lock repo tar -czvf tarfile repo).

As a part of backup / restore operations I also occasionally need to 
check that restore works and restored data is really usefull.

How to do that for a backed up borg repo?

It is not an option to restore backup repo over the original repo so is 
it possible to restore backup repo into another dir on the same machine 
(A) it was originally backed up? After that I need to somehow check that 
restored repo is functional, e.g. by running borg check or maybe extract 
archive from original repo and restored repo and diff them. I have not 
tested this but I guess restoring repo on the same machine will cause 
problems with identical repo ids and/or cache files. Is it somehow 
possible to change the repo id of the restored repo? Do I need to do 
something for the client caches? Repos are not encrypted.

If this is not possible then maybe restore backup repo into another 
machine (B), extract archive from it and from original repo on machine 
(A) and compare them. Do I run into id / cache problems if both extract 
are done with a same client?

Third and maybe simplest way is to take a checksum of the snapshot repo 
tar file, store it together with the backup and during restore test just 
restore the snapshot repo tar file + original checksum into target 
machine, recalc the checksum and compare those and assume that if the 
checksums match then the restored repo is (hopefully) functional.

Are there any other ways to check the restored repo functionality?




More information about the Borgbackup mailing list