TeamCity Migration Guide HSQLDB to Microsoft SQL Server

This is a specific detailed guide on how to migrate TeamCity HSQLDB data to Microsoft SQL Server.  The original documentation can be found here:

Migrating+to+an+External+Database

Setting+up+an+External+Database

Steps to Setup SQL Server

  1. Create an empty Database specific to teamcity.  I called my database TeamCity.

  1. Create a windows account specific to teamcity so integrated security is possible.   I called my user account teamcity.

  1. Register the windows user account, teamcity, in SQL Server; Have his starting database be TeamCity and grant the teamcityuser db_owner permission on the TeamCity database.

  1. Enable TCP/IP

TeamCity Preparation

  1. Update the teamcity window services (agents and build server) to use the newly created teamcity user account.  Don’t start the services.

  1. Download http://jtds.sourceforge.net/  1.2.xx - I picked 1.2.8 and unzip into your .BuildServer\lib\jdbc

  2. For teamcity to use Integrated Security copyF:\TeamCity.BuildServer\lib\jdbc\x86\SSO\ntlmauth.dll toF:\TeamCity\bin

  3. Copy F:\TeamCity.BuildServer\config\database.mssql.properties.dist  to  F:\TeamCity.BuildServer\config\database.properties

And change the values as required for your environment.  Remember we are using Integrated Security so username/password should be left empty.

changes-database.properties

Migration

maintainDB.cmd migrate -S “f:\TeamCity.BuildServer” -T “f:\TeamCity.BuildServer\config\database.properties”