How to connect Teamcity to an existing SQLServer 2005 database


We had a machine that run teamcity 4.0.2 and that used SqlServer 2005 as datastore. The machine crashed, but we still have the database. How can I get a newly created instance of teamcity connected to the database?

I found infos about migrating an existing teamcity installation over to a new database. But thats not what I want.

I thought that the database contains the configuration for the projects. Thats not the case: Its in the folder Configuration of the Teamcity data directory (.BuildServer)

I only had to copy the contents of that folder over to my new installation. I guess my question was wrong. Anyway I leave it as it is, because there might be others who have the same idea.

Best Solution

  1. Download the MSSQL driver and copy it to WEB-INF/lib of your TeamCity install (probably under program files if you're running Windows).

  2. Create a file called in your config directory (under Windows it's usually Documents and settings\user_who_ran_install.buildserver\config) and put the following lines into it:

    driverName=net.sourceforge.jtds.jdbc.Driver connectionUrl=jdbc:jtds:sqlserver://:1433/ connectionProperties.user= connectionProperties.password=

    maxConnections=50 poolPreparedStatements=true

Restart TeamCity Web Server service. There's a nonzero chance it won't come back up or will be unreachable. Follow the instructions here to the letter and you should be OK. Make sure to have a backup of your database available in case TeamCity decides to reinstall all the data objects for some reason.

Related Question