I’m looking to relocate my Tor relay to a new VPS while keeping the same key. I’ve read through the FAQ section, but I ran into numerous errors when attempting to make the transfer. Could someone kindly provide a step-by-step guide on how to successfully move or upgrade a relay to another VPS while retaining the same key? Any help would be greatly appreciated.
Al you need to do is setup your new relay on a new VPS and then to copy /var/lib/tor/keys folder from the old machine to the new machine and restart the tor service systemctl restart tor@default
Like SirNeo says, this should work when you copy both torrc and the keys. In my case I tend to just copy the whole DataDirectory and torrc file, always worked fine.
You could use something like rsync to sync the DataDirectory/torrc file (or the archives when you made a zip/tar file first) to your new server. Since you ask for a step-by-step guide, this could look like:
Create or use a existing ssh keypair for rsync between your VPS instances and make sure you can rsync some basic files (i.e. touch file.txt) from the old to the new VPS instance.
Create a archive containing both the torrc configuration file and the DataDirectory. E.g. something like zip -r torbackup.zip /var/lib/tor /etc/tor for Linux and zip -r torbackup.zip /usr/local/etc/tor /var/db/tor on FreeBSD. I’m using FreeBSD so check the Linux locations since I’m not 100% sure these are right ones.
Rsync the file to the new VPS, e.g. something like rsync -avz /home/user/torbackup.zip user@remote_host:/home/user/
Unzip and move the right folders in their new destinations.