TeamCity 8.0 Help

TeamCity Data Backup

TeamCity provides several ways to back up its data:

  • Creating Backup from TeamCity Web UI: an action in the web UI (can also be triggered via REST API) to create a backup while the server is running. It is recommended for regular maintenance backups. Restore is possible via the maintainDB console tool. Some limitations on the backed up data apply. This option is also available on upgrade in the maintenance screen - on the first start of a newer version of the TeamCity server.

  • Creating Backup via maintainDB command-line tool: Same as via the UI, but requires the server be not running and has no limitations. Restore is possible the via the maintainDB console tool.

  • Manual Backup and Restore: is suitable if you want to manage the backup procedure manually.

If you need to back up the build agent's data, refer to Backing up Build Agent's Data. For instructions on how to restore the data from backup, refer to the Restoring TeamCity Data from Backup page.

The recommended approach is either to perform backup described under Manual Backup and Restore or run backup from the Creating Backup from TeamCity Web UI regularly (e.g. automated via REST API) with the level "Basic" - this will ensure backing up all important data except build artifacts and build logs. Build artifacts and logs (if necessary) can be backed up manually by copying files under .BuildServer/system/artifacts and .BuildServer/system/messages. See TeamCity Data Directory for details on what is stored in the directories.

Note that for large production TeamCity installations export and import of the data from/to the database may not be an optimal solution and maintaining database backup via replication might be a better option. e.g. see the corresponding documentation for MySQL database.

Last modified: 20 April 2023