If you need to move the existing TeamCity installation to a new hardware or clean OS, it is recommended to follow the instructions on copying the server from one machine to another and then switch from the old server to a new one.
If you plan do not need the old server after starting to use new one, you can just connect the new server to the same database instance on the new server, just skip the items on copying the database. If you are sure you do not need to preserve the old server, you can perform move operations instead of copying in those instructionsand the same TeamCity Data Directory, it's just important that the database and the data directory are used by one server at any given time.
You can use the existing license keys when you move the server from one machine to another (as long as there are no two servers running at the same time). As license keys are stored under
<TeamCity Data Directory
>, you transfer the license keys with all the other TeamCity settings data.