Restore from `rest-server`

Hi!

I’m using a repository on a rest-server for an offsite backup from a machine, lets call it lucy. The rest-servers data directory is in /srv/restic, and I have created a single repository by running restic -r rest:$RESTIC_REST_HOST/lucy. Rest server access is protected by a username (lucy) and a password. If things go south and I loose access to lucy, how can I access the repository on the rest server?

I can imagine different scenarios, both of which don’t quite work as expected:

In variant A I’d access the repository from another remote machine. I’d set up the repository on this machine, and interact with it as I would have on lucy. I wanted to practice this, but running restic -r "rest:$RESTIC_REST_HOST/lucy" init on another fails by telling me that the repository was already initialized. Am I expected to only access the repository from the machine on which it was originally set up?

In variant B I’d access the repository directly from the machine where the rest server is running. Rest-server repo for local restore suggests this is quite trivial. Still, when I tried accessing the repository from the server by running restic -r /srv/restic/lucy snapshots it prompted me for a password, but repeatedly told me it was incorrect.

I’m not sure what I’m doing wrong, or if I’m misunderstanding something. Any advice? Thanks!

You only need to initialise a repository once. Once initialised you can access it from any computer that has access to the files.
Doing a restic -r "rest:$RESTIC_REST_HOST/lucy" snapshots should work here.

Which password are you talking about?
It seems like you had setup a HTTP password (with username lucy) for the REST server. This password is different than the repository password. The repository password is the one you gave during the init command.

1 Like

Thanks. That explains it. I set the password via through the RESTIC_PASSWORD environment variable, and tried only the RESTIC_REST_PASSWORD when trying to access the repository elsewhere. It works exactly as you describe it!