by Mikael Henriksson
23. June 2010 20:12
Last post I said I would come back with information about how to move TeamCity from one computer to another. This part of TeamCity I really like. Let’s establish some ground rules first. For this to work at all both computers/servers need to run the same version of TeamCity. Second if you like me had everything running fine locally backed by a SQL Server the server also needs this for things to move smoothly.
So that’s the gibberish now let’s move on to the solution.
- Take a full backup of TeamCity on the original machine
- Move the backup zip file to the TeamCity copy
- From the .BuildServer/Config (aka <TeamCity Data Directory>) grab the database.properties file and copy this file to where ever you want on the new machine and modify it if necessary to point to the new database. Don’t forget the problems with the port and the instance name
- Fire up a remote session to the new machine and start a command prompt
- Stop the TeamCity services
- Run the maintainDB command at the bottom of this post
- Copy the database.properties file to the .BuildServer/config dir
- Start TeamCity services. It should now fire up with all the build configs etc from the old machine.
cd "C:\Program Files (x86)\TeamCity\bin\"
maintainDB.cmd restore -F "C:\TeamCity_Backup_20100619_150814.zip" -T "C:\database.properties"
-F – specifies the path to the backup archive
-T – specifies specifies the path to the database.properties.
The only thing left now is to run all the builds and watch the lights go green and smile :)