TeamCity 2.1 Help

Upgrade

Upgrading TeamCity

There are two ways how you can upgrade TeamCity:

  • using Windows Installer

  • using war or zip distribution package

Please perform TeamCity Data Backup before any upgrade.

Upgrading Using Windows Installer

  1. Shut the server down.

  2. Shut the agent down if it was installed from the TeamCity installation package.

  3. Locate the .BuildServer folder on the disk and TeamCity Data Backup of this folder (usually this folder is created in the home directory of the user under which the TeamCity server is running).

  4. Back up the configuration files in the TeamCity installation folder if you modified them or installed some custom plugins.

  5. Uninstall the previous installation using Add or Remove Programs.

  6. Run the new installer. When prompted, specify the .BuildServer folder used by previous installation.

  7. If you use MySQL put MySQL Connector jar to the <TeamCity installation folder>/ROOT/WEB-INF/lib directory. Note: If you are upgrading from TeamCity 1.x, it is recommended to move your database settings form backed-up <TeamCity installation folder>/ROOT/WEB-INF/buildServerSpring.xml file to database.properties file located in the TeamCity configuration data directory (.BuildServer/config). (See sample database.mysql.properties located in .BuildServer/config folder.) Installation how to configure TeamCity to use MySQL.

  8. If you use custom plugins, put their jars to <TeamCity installation folder>/ROOT/WEB-INF/lib for server-side plugins and to <TeamCity installation folder>/ROOT/update/plugins for build agent plugins.

  9. Start up the TeamCity server (and agent if it was installed together with the installer).

  10. If you project contains build configurations related to *.ipr and inspections, it is required to update and correct build configuration settings. To do it, visit build configuration page/build runner section. The first visit to this page may take time, because TeamCity will download and analyze all project module (*.iml) files to detect used global libraries, path variables, jdk and so on. Subsequent visits will be much faster. Look through the settings and make sure that all settings are correct.

Manual Upgrading on Linux and for WAR Distribution

  1. Shut the server down.

  2. Locate the .BuildServer folder on the disk and TeamCity Data Backup of this folder (usually this folder is created in the home directory of the user under which the TeamCity server is running).

  3. Back up old TeamCity files (either the whole TeamCity directory or [TOMCAT_HOME]/webapps/TeamCity/* in case of war file installation).

  4. Remove old installation files (either the whole TeamCity directory or [TOMCAT_HOME]/webapps/TeamCity/* in case of war file installation).

  5. Unpack the new archive where TeamCity was previously installed.

  6. If you use MySQL put MySQL Connector jar to the WEB-INF/lib directory. Note: If you are upgrading from TeamCity 1.x, it is recommended to move your database settings form backed-up WEB-INF/buildServerSpring.xml file to database.properties file located in the TeamCity configuration data directory (.BuildServer/config). (See sample database.mysql.properties located in .BuildServer/config folder.) Installation how to configure TeamCity to use MySQL.

  7. If you use custom plugins, put their jars to ROOT/WEB-INF/lib for server-side plugins and to ROOT/update/plugins for build agent plugins.

  8. Specify additional System Properties for Running the Server, if required.

  9. Start up the TeamCity server.

  10. If you project contains build configurations related to *.ipr and inspections, it is required to update and correct build configuration settings. To do it, visit build configuration page/build runner section. The first visit to this page may take time, because TeamCity will download and analyze all project module (*.iml) files to detect used global libraries, path variables, jdk and so on. Subsequent visits will be much faster.Look through the settings and make sure that all settings are correct.

All the configuration data and database scheme will by updated by our converters upon the first startup after the upgrade.

Upgrading Build Agent

Core and plugins of build agents are updated automatically. However, there are two parts that require manual upgrading procedure: Windows service wrapper and agent launcher. Both were updated in version 2.0 of TeamCity so it is recommended that operations described by these instructions are performed.

The easiest way to upgrade an agent is perform build agent uninstallation and then installation.

Upgrading Build Agent Launcher

You only need to perform this step if you do not want to uninstall and then install the agent again, which is the preferred way of agent upgrade.

Agent launcher is the process that is first started for the agent and manages other child processes that actually connect to the server and perform the build.

  1. Wait till agent is upgraded automatically.

  2. Check <agent>\lib\latest folder. If it does not exist, no further steps are needed, you have the latest launcher version installed.

  3. Stop agent.

  4. Move content of the <agent>\lib\latest folder to the <agent>\lib folder, overwriting exising files, if needed.

  5. Start the agent.

Upgrading Build Agent Windows Service Wrapper

Upgrade from TeamCity version 1.x

Version 2.0 of TeamCity migrated to new way of managing Windows service (service wrapper) for build agent: Java Service Wrapper library.

One of advantages of using new service wrapper is ability to change any JVM parameters of the build agent process.

1.x versions installed Windows service under name agentd, while 2.x versions use TeamCity Build Agent Service <build number> name.

The service wrapper will not be migrated to new variant automatically. You do not need to use new service wrapper, unless you need to use its functionality (like changing agent JVM parameters).

To use new service wrapper you should uninstall old version of the agent (with Control Panel | Add/Remove Programs) and then install a new one.

If you customized user under which the service is started, do not forget to customize it in the newly installed service.

Upgrade from TeamCity 2.x versions

In case service wrapper needs an update, the new version is downloaded into <agent>/launcher.latest folder, but the changes are not applied automatically.

To upgrade the service wrapper manually, do the following:

  1. Ensure <agent>/launcher.latest folder exists.

  2. Stop the service using <agent>\bin\service.stop.bat.

  3. Uninstall the service using service.uninstall.bat.

  4. Backup <agent>/launcher/conf/wrapper.conf file.

  5. Delete <agent>/launcher.

  6. Rename <agent>/launcher.latest to <agent>/launcher.

  7. Edit <agent>/launcher/conf/wrapper.conf file. Check 'wrapper.java.command' property to point to java.exe file. Leave blank to use registry to lookup for java. Leave 'java.exe' to lookup java.exe in PATH. For standalone agent service value should be ../jre/bin/java, For installation with server value should be ../../jre/bin/java. Backup version of wrapper.conf file may be used.

  8. Install the service using <agent>\bin\service.install.bat.

  9. Make sure the service is running under the proper user account. Please note that using SYSTEM can result in failing the builds of MSBuild/Sln2005 configurations.

  10. Start the service using <agent>\bin\service.start.bat.

Last modified: 20 April 2023