TeamCity provides several ways to back up the data:
- Backup from web UI: an action in 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 maintainDB console tool. Some limitations on backed up data apply. This option is also available on upgrade in the maintenance screen - on the first start of newer version of TeamCity server.
- Backup via maintainDB command-line tool: Same as via UI, but requires server not running and has no limitations. Restore is possible via maintainDB console tool.
- Manual backup: is suitable if you want to manage the backup procedure manually.
If you need to back up build agent's data, refer to Backing up Build Agent's Data.
For instructions on how to restore the data from backup, please refer to the Restoring TeamCity Data from Backup page.
Recommended approach is either to perform backup described under Manual Backup and Restore or run backup from web UI regularly (e.g. regularly via REST API) with level "All except build artifacts" - this will ensure backup for all important data except for Build logs and artifacts. Build logs and artifacts (if necessary) can be backed up manually by copying files under
.BuildServer/system/artifacts. See TeamCity Data Directory for details on what is stored in artifacts and build logs.