Hello ive been wanting to know how to back up a tor relay the proper way. Ive had about 2 relays that ive lost (1 week of progress) because I didnt or didnt properly back the keys up. Can someone please tell me how I can back them up and restore them? Thanks
Hi pineapple,
To backup and restore a Tor relay, you would need to extract the relay’s keys. Specifically the ed25519_master_id_secret_key
and ed25519_signing_secret_key
if I’m not mistaken. On FreeBSD they are stored in /var/db/tor/$tor-relay/keys
. I suspect the Linux equivalent would be something like /var/lib/tor/$tor-relay/keys
. If you’re in doubt, check your torrc
file (with the relay specific configuration settings) and look for DataDirectory
for the correct location. This file can be found in /usr/local/etc/tor/
on FreeBSD and I suspect the Linux equivalent would be /etc/tor/
.
It’s also fine to just copy the whole DataDirectory
+ torrc
configuration file, and put them in place again on a new server when you want to migrate the relay(s). That might be easier/simpler instead of copying specific files. Do make sure the ownership and permissions are in order after you have moved the files . And if you run more than one relay, also backup your
MyFamily
file to make sure you don’t forget this after migrating relays.