Skip to content

How to migrate all tor instances of one server to another

nusenu edited this page Feb 3, 2017 · 5 revisions

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).

Why would I have to move tor instances?

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.

Why move instead of just starting from scratch?

Migration Steps

  1. stop all running tor instances on your old server
  2. delete the datadir and torrc files from your old server
  3. remove the old server from your ansible inventory
  4. add your new server to the ansible inventory (lets call him "newserver" in this guide)
  5. 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

  1. change into the tor_offline_masterkey_dir, if you didn't change this, the default location is: ~/.tor/offlinemasterkeys
  2. in that folder you should have as many subfolders for the oldserver as for the newserver (one directory per tor instance)
  3. 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

  1. finally tell ansible-relayor to setup all tor instances on the newserver

ansible-playbook your-playbook.yml -l newserver