Tim Elhajj

Off the Microsoft stack!

Back Up TFS Before You Upgrade


How to back up TFS before you upgrade

You need to back up Team Foundation Server and you might be using Windows SharePoint Services 3.0 and reporting. This is a three-part process. 1) Shutdown TFS using a command line too. 2) Back up the databases using SQL Server tools. 3) Back up the encryption key for reporting services, if you have reporting.

Required Permissions

You have to be an administrator in Windows, Team Foundation Server, SQL Server and SharePoint.* To perform these procedures, make sure you’re a member of the following groups:

  • The Administrators security group in Windows server.
  • The Team Foundation Administrators security group in Team Foundation Server.
  • The SQL Server System Administrator security group for the SQL Server hosting the data.
  • The Farm Administrators group in Windows SharePoint Services 3.0.*

*You don’t have to be a member of the Farm Administrators group in SharePoint, if SharePoint isn’t part of your deployment.

Shutdown Team Foundation Server

First, shut down Team Foundation Server using a command line tool. You don’t want anyone to make any updates to your data while the upgrade is in progress. Shutting down TFS will help ensure you get a good back up.

To shutdown Team Foundation Server
  1. On the application tier, open a command prompt as an administrator.
    commandpromptasadmin
  2. Run this command: cd %programfiles%\Microsoft Team Foundation Server 2010\Tools
  3. Now run this command: TFSServiceControl quiesce
    You’re screen should look like this:
    commandpromptasadmin2
  4. Now run this command: net stop WAS
  5. You’ll get a prompt about whether you want to stop W3SVC, too. Type Y and then press ENTER to shutdown IIS. You’re screen will look like this:commandpromptasadmin3

Back up the data in Team Foundation Server databases

Next, back up all the Team Foundation Server data.

One thing to keep in mind is that you don’t have to use the steps below to do your backup. If you have a different set of steps that you use to maintain your data, by all means use the steps you’re most comfortable with. These steps offer one way to get a backup, but they are not meant to be mandatory.

If you’re using SQL Server Express with TFS basic, you can download and install SQL Server 2008 Management Studio Express to follow these instructions. If you want a guide through the installation steps for SQL Server 2008 Management Studio Express, use this page.

Which databases should you back up?

Every installation of TFS uses these databases:

  • Tfs_Configuration*
  • Tfs_DefaultCollection**

If you have reporting, you will also have these databases:

  • Tfs_Warehouse*
  • ReportServer***
  • ReportServerTempDB***

If you have Windows SharePoint Server 3.0, you will also have these databases:

  • WSS_AdminContnet
  • WSS_Config
  • WSS_Content

* TFS database names can use a database label, which is embeded into the defualt name. This label is not requried.

** This is the default database name for the DefaultCollection. If you customized the name, make sure to use the customized name. If you have more than one collection, there is a database for each collection. Back up all of them.

***You should use the default names for your report server. SQL Server Reporting Services expects the string TempDB to appear following the same name of the report server database.

To back up Team Foundation Server databases
  1. From the start menu, launch SQL Server Management Studio.

    The Connect to Server dialog box appears.
  2. Connect to the Database Engine that hosts your TFS databases.
    For example, if you were using SQL Server Express, you might enter the server name followed by \SQLExpress.
  3. In SQL Server Management Studio, expand the Database node.
  4. Select the TFS_Configuration database and open the Tasks sub-menu, then choose Back up.
    The BackUp Database dialog box appears.
  5. Choose Ok.

    If the backup succeeds, a dialog box appears.
  6. Choose Ok.
  7. Repeat these steps for every database in your TFS installation. Don’t skip databases for TFS companion programs like SQL Server Reporting Services or SharePoint. See “Which databases should you back up” for the default names of all the databases.

If an error appears when you click Ok in the Backup Database dialog box, use the following tips to troubleshoot:

  • If you’ve never created a maintenance plan, SQL Server backs up your database to the default location, using the name of the database for the name of the backup file.
  • If you’ve already setup a destination to store back up files, you might have to enter the name of the back up file.
  • Use the same name as the database for the back up file.
  • The TFS Database Restore tool expects back up files with the default .bak extension used by SQL Server for backups.
  • The location for the back up file storage is based on the instance of SQL Server you’re using and is a hidden folder. To easily navigate to it after you make a backup, select the destination and choose Add, and then copy the location from the Select Backup Destination dialog box.

Back up the encryption key for reporting services

Next back up the encryption key for Reporting Services by using the Reporting Services Configuration tool.. You’ll use this key to restore the reporting data if you move the report server to new hardware.

To back up the encryption key
  1. On the server that is running SQL Server Reporting Services, launch Reporting Services Configuration Manager.
    For example, on Windows Server 2008 R2, you would choose Start, point to All Programs, point to Microsoft SQL Server, point to Configuration Tools, and then choose Reporting Services Configuration Manager.
    The Reporting Services Configuration Connection dialog box opens.
  2. Specify the name of the report server and its database instance, and then choose Connect.
  3. In the navigation bar on the left side, choose Encryption Keys, and then choose Backup.
    The Encryption Key Information dialog box opens.
  4. In File Location, specify the location where you want to store a copy of this key.
    You should consider storing this key on a separate computer from the one that is running Reporting Services.
  5. In Password, specify a password for the file.
  6. In Confirm Password, specify the password for the file again.
  7. Choose OK.

Next Step: What to do after you back up your data

What you do next depends upon the path you’re using. Take one of the following courses of action:

  1. If you’re using the basic or standard (in-place) upgrade paths,  it’s time to uninstall TFS and then run the TFS upgrade wizard.
  2. If you’re using the advanced (migration) upgrade path, you’ll want to Set up SQL Sever on your new hardware.

One thought on “Back Up TFS Before You Upgrade

  1. Excellent Thanks for your post… which helped me

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s