Setting up an External Database

Skip to end of metadata
Go to start of metadata
You are viewing documentation of TeamCity 4.x, which is not the most recent released version of TeamCity. Please refer to the listing to choose another version.
Search

Searching TeamCity 4.x Documentation

Table of Contents

TeamCity supports MySQL, PostgreSQL, Oracle and MS SQL 2005 databases.

This page covers external database setup for the first use with TeamCity. If you evaluated TeamCity with internal database and want to preserve the data while switching to an external database, please refer to Migrating to an External Database guide.

This page covers:

General Steps

  1. If you already ran TeamCity but do not want to preserve any data, delete TeamCity Data Directory.
    All the data you entered into TeamCity will be lost. To preserve your data, please refer to the migration guide.
  2. Run TeamCity with the default settings to create the <TeamCity Data Directory>.
  3. Shutdown the TeamCity server.
  4. Perform database-specific steps described below.
  5. Start the server.
    Please note that TeamCity actively modifies its own database schema. The user account used by TeamCity should have permissions to create new, modify and delete existing tables in its schema, in addition to usual read/write permissions on all tables.

Database Configuration Properties

TeamCity uses Apache DBCP for database connection pooling. Please refer to http://commons.apache.org/dbcp/configuration.html for detailed description of configuration properties. Example configurations for each of supported databases are provided in sections below.

MySQL

Supported versions: (5.0.40+)

  1. Download the MySQL JDBC driver from: http://dev.mysql.com/downloads/connector/j/
  2. Extract downloaded archive in a temporary folder. In the unpacked folder locate a jar file which name looks like the following: mysql-connector-java-<version>-bin.jar (or similar). This would be MySQL connector.
  3. Put MySQL connector jar to the WEB-INF/lib directory of TeamCity web application
  4. Create an empty database for TeamCity in MySQL and grant permissions to modify this database to a user from which TeamCity will work with this database.
    We recommend using UTF-8 character set for the database. Please consult this document for more details on how to create database with Unicode support.
  5. In the <TeamCity data directory>/config folder rename database.mysql.properties file to database.properties and specify the required settings in this file:

PostgreSQL

Supported versions: 8+

  1. Create an empty database for TeamCity in PostgreSQL and grant permissions to modify this database to a user from which TeamCity will work with this database. Be sure to set up it to use UTF8.
  2. In the <TeamCity data directory>/config folder create file database.properties and specify the required settings in this file:

Oracle

Supported versions: 10+

  1. Create an Oracle user account for TeamCity (with CREATE_TABLE permission). It is important to ensure the user is NOT granted any extra permissions, such as DBA role.
  2. Download the Oracle JDBC Thin driver and put the driver jar (ojdbc14.jar) into the WEB-INF/lib directory of TeamCity web application. Please make sure use use the specified driver (version 10.2.0.1.0XE), earlier driver versions may not function properly with TeamCity.
  3. In the <TeamCity data directory>/config folder create file database.properties and specify the required settings in this file:

Microsoft SQL Server 2005

Supported version: 2005

  1. Create new database, ensure that _CI_AI collation is selected for this database.
  2. Create TeamCity user and ensure the user is the owner of the database (grant the user dbo rights). This requirement is necessary because the user needs to have ability to modify database schema.
  3. Download latest jTDS driver and put it into WEB-INF/lib directory of TeamCity web application.
  4. In the <TeamCity data directory>/config folder create file database.properties and specify the required settings in this file:

To use Windows authentication just do not mention connectionProperties.user and connectionProperties.password properties.


See Also:

Labels:

database database Delete
migration migration Delete
mssql mssql Delete
oracle oracle Delete
postgresql postgresql Delete
mysql mysql Delete
Enter labels to add to this page:
Wait Image 
Looking for a label? Just start typing.