Stop Teamwork Server.
Back up all data in case of unsuccessful data transfer.
Deactivate the license of the old installation.
Use deactivation from the software side or deactivation with the License Deactivation ID. It is treated as the confirmed deactivation and does not decrease available rehost limit.