TeamCity Data Backup
Last modified: 20 April 2023note
Make backup of TeamCity data before any TeamCity upgrade. Note that TeamCity server does not support downgrading.
Server Backup
warning
You need to stop TeamCity server before performing any backup procedures
What is needed to be backed up:
.BuildServer/config directory - this is where project's, build configuration's and general server settings are stored
.BuildServer/system directory - this is where build results are stored, namely:
.BuildServer/system/version.dat - mandatory file, stores internal version of the configuration files and database. You should always back it up and ensure it is saved/restored in sync with other data files and database data.
.BuildServer/system/license.keys - file which stores license codes used by TeamCity.
.BuildServer/system/responsibles.xml - file which stores "Take Responsibility" data.
.BuildServer/system/artifacts - directory where builds' artifacts are stored.
.BuildServer/system/messages - directory where builds' logs are stored.
.BuildServer/system/changes - directory where remote run changes are stored.
.BuildServer/system/buildserver.* - set of files pertaining to embedded HSQLDB. You should back them up if you use HSQLDB (default setting)
note
.BuildServer directory is by default placed in the home directory of a user who installed TeamCity (e.g. under Windows it is C:\Documents and Settings\<user_name>) its location can also be configured during installation procedure and via System Properties for Running the Server
Database data Database stores all the information on build results (except for artifacts and build logs), VCS changes, pinned builds, agents, build queue, etc. If you use HSQLDB (default, not recommended for production), the database is stored in the .BuildServer/system directory. If you use MySQL, please back up your database schema used by TeamCity.
note
MySQL database connection settings are specified in the .BuildServer/config/database.properties file. See also Installation
Application files If you did not place any custom libraries for use by TeamCity and did not install any non-default TeamCity plugins as well as no startup script/configuration changes were made, you do not need to back up TeamCity application directory (web server with web application), provided you still have original distribution package. If you feel you need to back up the application files:
If you use non-war distribution: Back up everything under TeamCity installation directory except for "temp" and "work" directories.
If you use war distribution, pursue the backup procedure of the servlet container used.
Log files If you need TeamCity log files (mainly used for problem solving or debug purposes), back up <TeamCity_installation_directory>/logs directory.
note
You may also wish to back up TeamCity Windows Service settings, if they were changed.
Build Agent Backup
Build Agent configuration Back up <Build_Agent_installation_folder>/conf/buildAgent.properties file. You may also wish to back up any other configuration files changed (Build Agent configuration resides in <Build_Agent_installation_folder>/conf and <Build_Agent_installation_folder>/launcher/conf directories).
Log files If you need Build Agent log files (mainly used for problem solving or debug purposes), back up <Build_Agent_installation_folder>/logs directory.
note
You may also wish to back up Build Agent Windows Service settings, if they were changed.
Thanks for your feedback!