I recently installed TeamCity with an external SQL Server database. I will go through the steps to install TeamCity and configure the database which was very straight forward. I mostly followed the directions found in the JetBrains documentation but added some steps where I was not familiar.
Install TeamCity
After downloading TeamCity for Windows, install it…
And complete the initialization process.
Shutdown the TeamCity server.
Set up SQL Server Database and User
Now, create a new SQL Server database with case-sensitive collation (as a short-cut choose a collation that ends with “_CS_AS”). I chose to have the TeamCity server open a connection with username and password instead of Integrated Security, so I created a new user with “dbo” rights for the TeamCity database. You can find instructions on how to use Integrated Security for SQL Server authentication here.
Install sqljdbc Driver and Set TeamCity Properties
Download the Native MS sqljdbc driver from here, unpack the driver and copy sqljdbc4.jar the the <TeamCity Data Directory>libjdbc directory. I used the default installation directory which made my TeamCity Data Directory C:ProgramDataJetBrainsTeamCity.
In the <TeamCity Data Directory>config folder, open database.mssql.properties.dist file in a text editor.
Edit the settings:
connectionUrl=jdbc:sqlserver://:;databaseName= connectionProperties.user= connectionProperties.password=
Save the file as database.properties.
Initialize the TeamCity Database
Start the TeamCity server. Open the TeamCity web page again, you’ll be prompted with an error “Database is empty or doesn’t exist”.
You will need to open the TeamCity server log file to get the Authentication Token required to initialize the database. On my computer, I found the file at C:TeamCitylogsteamcity-server.log.
Copy and paste the Authentication Token into the TeamCity web page and click the “Proceed” button at the bottom of the page.
Lastly, TeamCity will initialize a new database and server components. Once complete, TeamCity will be ready for its first use.
Related Posts
October 27, 2014
OAuth 2 Flows
August 25, 2014
TeamCity Dependencies
February 5, 2014
Creating a TeamCity Project
November 20, 2013
TeamCity, Git, and Assembly Version Number
January 22, 2013
Exploring PhantomJS
September 6, 2012
UpshotHelper Update
July 26, 2012
UpshotHelper
April 24, 2012
Database Performance Tuning with Hardware
April 14, 2012