-
Notifications
You must be signed in to change notification settings - Fork 43
How to migrate all tor instances of one server to another
A short guide on how ansible-relayor can help you migrate your existing (setup with ansible-relayor) tor instances to a new server. This will affect all instances on the server (not just a single instance).
There can be multiple reasons for the actual move (the reason is not relevant):
- hoster change
- hardware failure
Whatever the reason was: Make sure that your former server is not "coming back" (and using the same relay keys). If you can not ensure that the old tor instances won't start again better create new keys (and ignore this guide).
If the hostname and IP addresses do not change you do not have to do anything just rerun your playbook.
- it makes sense to migrate a relay because it can take quite some time to fully bootstrap a relay https://blog.torproject.org/blog/lifecycle-of-a-new-relay
- stop all running tor instances on your old server
- delete the datadir and torrc files from your old server
- remove the old server from your ansible inventory
- add your new server to the ansible inventory (lets call him "newserver" in this guide)
- tell ansible-relayor to create new but empty local DataDir folders for the instances running on the new server
ansible-playbook your-playbook.yml -t createdir -l newserver
- change into the
tor_offline_masterkey_dir
, if you didn't change this, the default location is: ~/.tor/offlinemasterkeys - in that folder you should have as many subfolders for the oldserver as for the newserver (one directory per tor instance)
- rename the old instances to the new instances (you have to repeat that
mv
command for every instance)
mv -T oldserver-1.1.1.1_443 newserver-1.2.3.4_443
- finally tell ansible-relayor to setup all tor instances on the newserver
ansible-playbook your-playbook.yml -l newserver