Setting up an External Database
TeamCity 3.0 supports MySQL and PostgreSQL. Oracle support was added in TeamCity 3.1.
This document 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.
In this section:
Setting up MySQL
Setting up PostgreSQL
Setting up Oracle
General Steps
- 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 refer to the migration guide. |
- Run TeamCity with the default settings to create the <TeamCity Data Directory>.
- Shutdown the TeamCity server.
- Perform database-specific steps described below for MySQL, PostgreSQL or Oracle.
- Start 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. |
Setting up MySQL
- Download the MySQL JDBC driver from: http://dev.mysql.com/downloads/connector/j/
- Put MySQL connector jar to the WEB-INF/lib directory of TeamCity web application
- 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. |
- In the <TeamCity data directory>/config folder rename database.mysql.properties file to database.properties and specify the required settings in this file:
connectionUrl=jdbc:mysql:connectionProperties.user=<user>
connectionProperties.password=<password>
Setting up PostgreSQL
Supported PostgreSQL versions: 8+
- 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.
- In the <TeamCity data directory>/config folder create file database.properties and specify the required settings in this file:
driverName=org.postgresql.Driver
connectionUrl=jdbc:postgresql:connectionProperties.user=<user>
connectionProperties.password=<password>
maxConnections=50
poolPreparedStatements=true
Setting up Oracle
Supported Oracle versions: 10g+
 | Oracle support is available only since TeamCity 3.1 |
- Download the Oracle JDBC Thin driver from: http://www.oracle.com/technology/software/tech/java/sqlj_jdbc/htdocs/jdbc_10201.html
- Put the driver jar (ojdbc14.jar) into the WEB-INF/lib directory of TeamCity web application
- Create TeamCity user in Oracle database and grant permissions to modify this database to a user from which TeamCity will work with this database.
- In the <TeamCity data directory>/config folder create file database.properties and specify the required settings in this file:
driverName=oracle.jdbc.driver.OracleDriver
connectionUrl=jdbc:oracle:thin:@<host>:1521:<service>
connectionProperties.user=<user>
connectionProperties.password=<password>
maxConnections=5
poolPreparedStatements=true
See also: