TeamCity Windows to Centos migration

TeamCity Win+SQL -> Centos+Postgres migration


Windows Server 2012 R2 + SQL Server + TeamCity


вынести TeamCity Server c Win sandbox на отдельную машину


standalone vm centos 7 + postgres + teamcity server


Prepare new environment

as for vm parameters I’ve set recomended 2×2 CPU and 4Gb RAM

High Important!!! Migration must be done between same TeamCity versions!!!

— server setup

centos 7 installed with next filesystem mapping:

install different requirements:

yum install gettext-devel openssl-devel perl-CPAN perl-devel zlib-devel pam-devel curl-devel gcc make freetds-devel python34-devel wget curl unzip  autoconf automake net-tools -y

install git

install postgresql 10:

yum install
yum install postgresql10 postgresql10-server
systemctl enable postgresql-10

markup db directory:

mkdir /db/teamcity

prepare psql teamcity user:

useradd teamcity
usermod -aG postgres teamcity
chmod 775 /run/postgresql/
chown teamcity /db/teamcity/

create special daemon for teamcity psql instance:

/etc/init.d/postgresql-teamcity <- click to view

add some tuning for instance (leave the port as is because we have only one psql instance)


port = 5432

shared_buffers = 512MB

effective_cache_size = 3GB

max_wal_size = 1500MB



create database and teamcity db user

su teamcity
/usr/pgsql-10/bin/initdb -D /db/teamcity/ -U postgres -E UTF-8
chown teamcity /db/teamcity/ -R
/etc/init.d/postgresql-teamcity start
su teamcity
psql -U postgres

postgres=# CREATE DATABASE teamcity;
postgres=# CREATE USER teamcity with password 'password';
postgres=# GRANT ALL PRIVILEGES ON DATABASE teamcity to teamcity;

install Java 8

cd /usr/local/src/ && wget --no-cookies --no-check-certificate --header "Cookie:; oraclelicense=accept-securebackup-cookie" \
yum localinstall jdk-8u*-linux-x64.rpm -y

—teamcity server setup

cd /tmp
tar -xf TeamCity-2017.2.tar.gz
mv TeamCity /opt/teamcity && cd /opt/teamcity/bin
bash start 

example of successfull output:
Agent home directory is /opt/teamcity/buildAgent
Current Java runtime version is 1.8 
Lock file: /opt/teamcity/buildAgent/logs/ 
Using no lock 
Done [31576], see log at /opt/teamcity/buildAgent/logs/teamcity-agent.log

check that teamcity is really running:

 netstat -nlptu | grep 8111
tcp6 0 0 :::8111 :::* LISTEN 31480/java 

you may have centos firewall so if you cannot open http://<teamcity host>:8111/ in your browser try this
systemctl stop firewalld

if web page begin works it means that some rule in your default firewall block 8111 port
so if you want you can inspect it and open or ( if you bad boy just) disable firewall forever:
systemctl disable firewalld

first look on front

let’s point Data DIrectory = /opt/teamcity/.BuildServer

let’s satisfy this requirement

cd /opt/teamcity/.BuildServer/lib/jdbc

and press Refresh JDBC drivers

driver has been loaded so just fill db connection strings and press Proceed

after ~1-2 min we will see License Agreement which needs to be Accepted and we see this

we can Login as SU (via token from teamcity-server.log in startup section) or just create SU

Export’n’Restore all things from old TeamCity instance

I’ve created basic backup: Administration → Backup → Backup scope = Basic → Start Backup

and placed this zip backup to the /opt/teamcity/.BuildServer/import of new server

(or we can do the same with Administration → Projects Import)

AskDevops —>

Добавить комментарий

Ваш e-mail не будет опубликован. Обязательные поля помечены *