Changing repository location

I wanted to confirm if where restic looks for the repository depends only on the path name and not the device.
For example lets say I have 2 hard drives; sdb and sdc

  1. If I initialise a restic reposiory at sdc with the following:

     export RESTIC_REPOSITORY="/run/media/user/WD/restic-backup"
     export RESTIC_PASSWORD="foo"
     restic init
    
  2. and then I backup data to the repository above to give
    # restic snapshots

     repository 1f475afi opened successfully, password is correct
     ID        Date                 Host        Tags               Directory
     ----------------------------------------------------------------------
     d234a134  2018-04-20 18:10:42  Bob                       /
    
  3. If I move this repository temporarily to sdb and delete the original repository in sdc (by formatting), and then later move this repository back to its orginal location in sdc, will I still be able to open the repository to access my data?

That is correct, @randUser, changing RESTIC_REPOSITORY to point to the new location is enough to get access to repo again. There is no specific location dependant info in the repository itself, so you’re free to move repos around as you wish.

Thanks @zcalusic. Just to be clearer, I wasn’t going to change the repository path name. I only wanted to move the repository directory out of the original device to a new device and then return the repository directory back to the orginal device and continue accessing it from there.

If this is true, are you also saying that I could change the pathname and still get access to my data as long as I have the same password?

1 Like

Exactly! You will be just fine. :slight_smile: