Best practices for installing TFS updates

Plan for the update

  1. 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.
  2. 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.
  3. 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. 
  4. 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.
  5. 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: https://blogs.msdn.com/b/tfsao/archive/2013/03/05/upgrading-alwayson-and-mirrored-environments.aspx
  6. 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.
  • For details on the exact SQL server permissions required to install and configure TFS, you can refer to the below link: https://blogs.msdn.com/b/bharry/archive/2010/08/20/database-permissions-required-to-configure-tfs.aspx

Perform a trial update

Performing a trial update has the below benefits:

  • Helps in identifying and resolving any possible issues that might arise during the update.
  • Gives an idea on the time that will be required for the update to complete.
  • Comparing the size of the databases before and after the update gives an estimate for the space requirements in the DB sever.

Refer the article for moving Team Foundation Server from one hardware to another to create a test environment. https://msdn.microsoft.com/en-us/library/ms404869(v=vs.110).aspx#Prepare

Then install the update.

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.

For detailed information on running these commands, please refer the link: https://blogs.msdn.com/b/buckh/archive/2006/10/17/creating-a-new-server-from-an-old-one-beware-of-the-instanceid.aspx

Performing the update

  • 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 : https://msdn.microsoft.com/en-us/library/ff470382.aspx

Running the TFSServiceControl command:

clip_image002[4]

  • 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.

For more information on using maintenance plans and marked transactions for backing up databases, refer the link: https://msdn.microsoft.com/en-us/library/ms253070(v=vs.100).aspx

  • Backup Encryption Key for Reporting Services – This can be done from Reporting Services Configuration Manager or RSKEYMGMT command-line tool.
  • Update – Install the update and run the upgrade wizard.

Content created by – Sreeraj Rajendran
Content reviewed by – Romit Gulati