Best practices for installing TFS updates

Install the latest update -- Always plan to install the latest update which is available for Team Foundation Server as it will include the bug fixes for the previous updates. Each update released will have an associated KB article that includes the details such as bugs fixed, install links etc. It is always good to check the KB for the update before installing.

Read the latest installation guide -- Download and go through the latest installation guide for the update you are planning to install from Microsoft download center.

Prerequisites – Check the prerequisites for the update as new prerequisite requirements may be introduced with the release of an update such as a SQL service pack.

TFS Downtime – TFS updates can take considerable amount of time depending on the number and size of the databases to upgrade. TFS updates upgrades the collection databases as well. Schedule a downtime and communicate the same to all the TFS users well in advance.

Check space in the DB server – The TFS databases will grow considerably during an update and it also depends on the recovery model set for the databases. Insufficient storage will cause the update to fail. Database upgrades in FULL recovery model will require more space during the process. TFS switches the databases to SIMPLE recovery model by default before processing them. But this might not be the case when upgrading SQL Always On and Mirrored environments. Refer to this blog post for more details: http://blogs.msdn.com/b/tfsao/archive/2013/03/05/upgrading-alwayson-and-mirrored-environments.aspx

Permissions – Make sure the account which will be used to install the update has the below permissions:

You must be a member of the Administrators security group on the server on which Team Foundation Server is installed.

If reporting is configured with TFS, make sure you are a part of the Content Manager role on the reporting site.

If you are using SharePoint Products, you must be a member of the Farm Administrators group on the SharePoint Products administration site.

Make sure you are a member of the sysadmin Server role in SQL Server. This is required as the update might make changes to the TFS database schemas.

Note: If you are following the above article to create a clone of your existing TFS setup on a test environment, you may have to run the below commands as well on the test environment once the hardware move is complete (including SharePoint and Reporting configuration if you have them enabled) :

TFSConfig ChangeServerID and TFSConfig RegisterDB

Running these commands will ensure that the two TFS instances (prod and test) will remain separate and changes made to one doesn’t affect the other.

Stop the TFS services using the TFSServiceControl command when the down time window begins. This will ensure that no user connects to TFS and tries to make changes during the update. For more information on the command refer : http://msdn.microsoft.com/en-us/library/ff470382.aspx

Running the TFSServiceControl command:

Backup the Databases: TFS, Reporting and SharePoint – Make sure you have all the database backups before the update. This can be done either from SQL server or by using TfsBackup.exe. The default location for TfsBackup.exe is C:\Program Files\Microsoft Team Foundation Server \Tools.

Creating separate maintenance plans for full and differential backups of the databases can reduce the time needed for taking the backups and hence reduce the downtime. You can take a full back up using a maintenance plan before the downtime and once the downtime window starts and TFS services are stopped, run a differential backup.