Restore a Single-Server Deployment to New Hardware

You can restore a deployment of Visual Studio Team Foundation Server to a different server even if all components in that deployment were installed on a single computer. To restore this type of deployment, you need access to a backup copy of the data and the installation media for Team Foundation Server, SharePoint Products, and SQL Server. The following diagram shows an example of a single-server deployment:

Simple Server Topology

To verify whether you are trying to restore a single-server deployment, see Examples of Simple Topology and Scenario: Installing Team Foundation Server on a Single-Server. If you are trying to restore a deployment that included multiple servers, see Restore Data to a Different Server or Instance.

If your deployment uses SharePoint Products, you must perform additional steps to back up and restore its databases, as detailed in the procedures in this topic.

Note

You can automate some procedures in this topic by using wizards in the September 2010 release of power tools for Team Foundation Server. These wizards help simplify the process for backing up and restoring your deployment. However, they do not help back up or restore Visual Studio Lab Management, and you should not use them to back up or restore the databases for SharePoint Products. For more information, see the following page on the Microsoft website: Team Foundation Server Power Tools September 2010.

The procedures in this topic describe how to restore an application tier that includes SharePoint Products and SQL Server Reporting Services and a data tier on a default instance of SQL Server, all installed on the same physical server or virtual machine. If your deployment differs from this configuration, you can still follow these procedures, but you might have to adjust the steps. For example, you would skip the procedures for restoring SharePoint Products if your deployment did not include it. You must perform extra steps if you use a named instance of SQL Server.

In this topic

To restore a single-server deployment of Team Foundation Server to new hardware, you must complete the procedures that are relevant for your deployment topology in the following sequence:

  1. Required Permissions

  2. Back Up Data

  3. Install and Configure Required Software on the New Hardware

  4. Restore the Databases

  5. Redirect SharePoint Products to the New Location of the Content Database

  6. Change the Database in Reporting Services Configuration Manager

  7. Prepare SQL Server for Team Foundation Server

  8. Redirect Team Foundation Server to its Databases

  9. Change the Ownership of the Restored Databases

  10. Update Service Accounts

  11. Install the Application Tier on New Hardware

  12. Register the Location of the Restored Databases

  13. Update the URL for the Application Tier

  14. Configure SharePoint Products

  15. Configure Reporting and Analysis Services

  16. Verify Permissions for Users, Groups, and Service Accounts

  17. Refresh the Data Cache on Client Computers

Required Permissions

To perform this procedure, you must be a member of the following groups or have the following permissions:

  • A member of the Administrators security group on the server or servers that are running the administration console for Team Foundation.

  • Either a member of the SQL Server System Administrator security group or your SQL Server Perform Back Up and Create Maintenance Plan permission must be set to Allow on the instance of SQL Server that will host the databases. 

  • A member of the sysadmin security group for the databases for Team Foundation and for the  Analysis Services database.

  • An authorized user of the TFS_Warehouse database.

  • If the deployment uses SharePoint Products, a member of the Farm Administrators group for the farm to which you are restoring the databases for SharePoint Products.

In addition to these permissions, you might have to address the following requirements on a computer that is running Windows Server 2008, Windows Server 2008 R2, Windows Vista, or Windows 7:

  • To follow a command-line procedure, you might have to open an elevated Command Prompt by clicking Start, right-clicking Command Prompt, and then clicking Run as Administrator.

  • To follow a procedure that requires Internet Explorer, you might have to start it as an administrator by clicking Start, clicking All Programs, right-clicking Internet Explorer, and then clicking Run as administrator.

  • To access Report Manager, reports, or websites for Reporting Services, you might have to add these sites to the list of trusted sites in Internet Explorer or start Internet Explorer as an administrator.

For more information, see the following topic on the Microsoft website: User Account Control.

Back Up Data

To restore a single-server deployment, you must have a complete set of data backups for the SQL Server databases. If the data was encrypted, you must also have the encryption key and its password.

These procedures assume that your single-server deployment is configured to use SQL Server Reporting Services and SharePoint Products. If your deployment includes these features, you must also back up those databases and restore them to the new hardware. For a successful restoration of a single-server deployment to new hardware, you must back up not only all Team Foundation databases but also all of the following databases that relate to your deployment:

  • TFS_Warehouse

  • TFS_Analysis

  • the administrative database for SharePoint Products (SharePoint_AdminContent_ID)

  • WSS_Content

  • WSS_Config

To back up data for Team Foundation

Install and Configure Required Software on the New Hardware

Before you restore the single-server deployment on a new server, you must first install and configure the software that Team Foundation Server requires. This software includes the following components:

  • A supported operating system for your deployment configuration

  • Internet Information Services (IIS)

  • SQL Server

  • SharePoint Products (required only if your deployment includes team project portals)

Note

When you restore a deployment of Team Foundation Server to a new server, you cannot install SharePoint Products when you install Team Foundation Server. You must install the same version and edition of SharePoint Products that you used in your previous deployment.

To install and configure required software

  • Install and configure a supported operating system, SQL Server, and SharePoint Products in the new environment, and make sure that the server and its software are operational. 

    For more information, see Installing Team Foundation Components, or you can download the most recent version of the installation guide for Team Foundation from the following page on the Microsoft website: Installation Guide for Team Foundation. In that guide, follow the instructions in the "Installing Prerequisites" section for the following components:

    • IIS

    • SQL Server

    • SharePoint Products

    Note

    You can install different versions or editions of some software, such as SharePoint Products, but not others. However, you might discover that changing versions or editions complicates the restoration. For optimal results, consider restoring to exactly the same software and then upgrading after you restore your deployment.

Restore the Databases

After you install the prerequisite software, you can restore data for Team Foundation by using the tools that SQL Server provides.

Warning

You must restore all databases to the same point in time, or the databases will be out of synchronization. The following procedures assume that you use marked transactions to help guarantee synchronization of the databases that Team Foundation Server uses. For more information, see Back Up Team Foundation Server. If your deployment uses SharePoint Products, you should follow the guidance for the version of that product in your deployment. For more information, see Backup and Recovery (SharePoint Server 2010), Protecting and restoring a farm (Office SharePoint Server 2007), or Protecting and restoring a farm (Windows SharePoint Services 3.0).

To open the Restore Database dialog box

  1. Click Start, point to All Programs, point to Microsoft SQL Server 2008, and then click SQL Server Management Studio.

    Note

    For more information, see the following page on the Microsoft website: Implementing Restore Scenarios for SQL Server Databases.

    The Connect to Server dialog box opens.

  2. In the Server type list, click Database Engine.

  3. In Server name, click or type the name of the server and instance, and then click Connect.

    SQL Server Management Studio opens.

  4. Expand the Databases node to show the list of databases that compose the data tier for Team Foundation.

Complete the next procedure, "To restore a database," for the following databases:

Databases for Team Foundation Server:

  • TFS_Configuration

    Note

    This database name might include additional characters between TFS_ and Configuration.

  • TFS_CollectionName

    Note

    Each team project collection has its own database. For example, if you have five team project collections, you will have five databases, each distinguished by the name of the team project collection.

  • TFS_Warehouse

    Note

    This database name might include additional characters between TFS_ and Warehouse.

  • VirtualManagerDB (if your single-server deployment uses Visual Studio Lab Management)

    The administration database for System Center Virtual Machine Manager (SCVMM) contains the information that you view in the SCVMM Administrator Console, such as virtual machines, virtual machine hosts, virtual machine library servers, and their properties.

Reporting Services:

  • ReportServer

    Note

    If you used a named instance, this database will be named ReportServer$InstanceName.

  • ReportServerTempDB

    Note

    If you used a named instance, this database will be named ReportServerTempDB$InstanceName.

SharePoint Products:

Analysis Services:

  • TFS_Analysis

For more information about these databases, see Understanding Backing Up Team Foundation Server.

To restore a database

  1. Right-click the database that you want to restore, point to Tasks, point to Restore, and then click Database.

    The Restore Database dialog box opens.

  2. Under Source for restore, click From Device, and then click the ellipsis button ().

  3. In the Specify Backup dialog box, specify the location of the backup file, and then click OK.

    You must restore the full backup first, followed by the differential backup, and then the transaction log backups, in the order in which they were created.

  4. Under Select the backup sets to restore, specify the backup sets to restore.

  5. If you created marked transaction backup sets, make sure that you restore the full, differential, and transaction log databases.

    For examples of marked transaction backup sets, see Back Up Team Foundation Server.

  6. In the Select a page pane, click Options, and then select the Overwrite the existing database check box.

  7. In the Restore the database files as list, verify that the paths match your current database paths.

  8. Under Recovery state, perform one of the following tasks:

    • If you are using marked transactions, click Leave the database non-operational, and do not roll back uncommitted transactions. Additional transaction logs can be restored. (RESTORE WITH RECOVERY).

    • If you are not using marked transactions and you are not applying additional transaction logs, click Leave the database ready to use.

    • If you are not using marked transactions but you are applying additional transaction logs, click Leave the database non-operational.

  9. Click OK.

    A progress icon appears.

  10. When the SQL Server Management Studio dialog box appears and confirms successful restoration, click OK to return to Object Explorer.

  11. If you are using marked transactions, right-click the database that you just restored, point to Tasks, point to Restore, and then click Transaction Log.

    The Restore Transaction Log window opens.

  12. On the General page, make sure that the appropriate database is highlighted in the Database list.

  13. Under Select the transaction log to restore, select the check box that is next to the log that you want to restore.

  14. Under Restore to, click Marked transaction.

    The Select Marked Transaction window opens.

  15. In the Select the marked transaction to stop the restore at list, select the check box that is next to the transaction mark that you want to use for the restoration, and then click OK.

    Important

    You must use the transaction mark that has the same date and time for all databases to successfully restore the data.

  16. In the Restore Transaction Log window, click OK.

    A progress icon appears.

  17. When the SQL Server Management Studio dialog box appears and confirms successful restoration, click OK.

    For more information, see the following page on the Microsoft website: Applying Transaction Log Backups.

Note

If you restored the databases for Reporting Services, you must also restore their encryption key. For more information, see the following topic on the Microsoft website: Restoring the Encryption Key (Reporting Services Configuration).

Redirect SharePoint Products to the New Location of the Content Database

After you have restored the content database for SharePoint Products (WSS_Content), you must redirect the server that is running SharePoint Products to the new location of that database. This database must be operational before you can reconfigure Team Foundation Server with the new locations of its databases.

To redirect project sites to use the content database that you restored

Change the Database in Reporting Services Configuration Manager

After you redirect SharePoint Products to the new content database, you must redirect Reporting Services to the new location of its databases (ReportServer and ReportServer_TempDB). Unless you perform this procedure, no reports will be available for any team project. These databases must be operational before you can reconfigure Team Foundation Server with the new locations of its databases.

To redirect Reporting Services to connect to the new server

Prepare SQL Server for Team Foundation Server

Before the restored databases will work correctly, you must use the TFSConfig PrepSQL command to prepare SQL Server to host databases for Team Foundation Server. This command creates the TFSEXECROLE and TFSADMINROLE groups on the new server or instance and also adds the system messages that are required for operation.

To prepare SQL Server to host databases for Team Foundation Server

  1. Log on to the server, open a Command Prompt window, and then change directories to Drive:\%programfiles%\Microsoft Team Foundation Server 2010\Tools.

  2. Type the following command, where ServerName (in either ServerName or ServerName\InstanceName format) is the name of the instance of SQL Server that hosts the databases for Team Foundation Server:

    **TFSConfig PrepSQL /SQLInstance:**ServerName

Redirect Team Foundation Server to Its Moved Databases

You must redirect Team Foundation Server to the databases that you have moved to the new hardware. In addition, you must run the RemapDBs command if you are using a named instance.

To redirect Team Foundation Server

  1. Log on to the server, open a Command Prompt window, and change directories to Drive:\%programfiles%\Microsoft Team Foundation Server 2010\Tools.

  2. Type the following command, where ServerName is the name of the instance of SQL Server that hosts the configuration database for Team Foundation Server and TFS_Configuration is the name of the restored configuration database for Team Foundation Server. You can specify ServerName in either ServerName or ServerName\InstanceName format. You must specify the instance name if you are not using the default instance:

    **TFSConfig RemapDBs /DatabaseName:ServerName;**TFS_Configuration **/SQLInstances:**ServerName **/AnalysisInstance:**ServerName **/AnalysisDatabaseName:**DatabaseName

    Note

    In /SQLInstances, you must specify all instances, separated by commas, of SQL Server that host databases for Team Foundation Server. For more information, see RemapDBs Command.

Change the Ownership of the Restored Databases

You must use the TFSConfig Accounts ResetOwner command to change the database owner login for the restored databases to the current user. Before you perform the next sequence of steps, make sure that you are logged on with an appropriate user account. For example, you can use the same account with which Team Foundation Server was installed, which is referred to in the installation guide as TFSSETUP. At a minimum, the account must be a member of the Team Foundation Administrators group in Team Foundation Server and a member of the sysadmin group in SQL Server.

To change the ownership of the restored databases to the current user

  1. Open a Command Prompt window, and change directories to Drive:\%programfiles%\Microsoft Team Foundation Server 2010\Tools.

  2. Type the following command, where ServerName (in either ServerName or ServerName\InstanceName format) is the name of the instance of SQL Server that hosts the databases for Team Foundation Server and DatabaseName is the name of the configuration database (by default, TFS_Configuration):

    **TFSConfig Accounts /ResetOwner /SQLInstance:**ServerName **/DatabaseName:**DatabaseName

    If you specify the configuration database, this command will change the ownership for all databases that Team Foundation Server uses.

Update All Service Accounts

You must update the service account for Team Foundation Server (TFSService) and the data sources account (TFSReports). Even if these accounts have not changed, you must update the information to help ensure that the identity and the format of the accounts are appropriate for the new server.

To update service accounts

  1. Open a Command Prompt window, and change directories to Drive:\%programfiles%\Microsoft Team Foundation Server 2010\Tools.

  2. At the command prompt, type the following command to update the service account for Team Foundation, where DatabaseName is the name of the configuration database (by default, TFS_Configuration):

    **TfsConfig Accounts /add /AccountType:ApplicationTier /account:**AccountName **/SQLInstance:**ServerName **/DatabaseName:**DatabaseName

  3. At the command prompt, type the following command to update the data sources account:

    **TfsConfig Accounts /add /AccountType:ReportingDataSource /account:**AccountName **/SQLInstance:**ServerName **/DatabaseName:**DatabaseName

    For more information, see Accounts Command.

Install the Application Tier on New Hardware

After you update the service account, you must install the application tier and point it to the location of the restored databases.

Note

If you are using a named instance of SQL Server instead of the default instance, you must run the RemapDBs command before you complete the following procedure. You do not have to run this command if you are using the default instance. For more information, see RemapDBs Command.

To install and configure the application tier

  1. Download the most recent version of the installation guide from the following page on the Microsoft website: Installation Guide for Team Foundation.

  2. In the installation guide, follow the instructions to install an application tier by using the Application-Tier Only wizard.

  3. In the Application-Tier Only wizard, on the SQL Server Instance page, type the names of the server and the instance of SQL Server where you restored the configuration database.

  4. Follow the instructions to complete the installation of the application tier.

Update the URL for the Application-Tier Server

You can skip this procedure if you are not changing the name of the server as part of restoring to new hardware.

To update the URL for the application-tier server

  1. Open the administration console for Team Foundation.

    For more information, see Open the Team Foundation Administration Console.

  2. In the navigation bar, click Application Tier, and then click Change URLs.

    The Change URLs window opens.

  3. In Public URL, type the URL for the new application-tier server, and then click OK.

Configure SharePoint Products

As part of restoring to a new server, you must install the extensions for SharePoint Products and reconfigure the settings for the SharePoint web applications that the deployment uses.

To install extensions and configure the settings for SharePoint web applications

  1. Open the installation guide, and follow the instructions to install the Team Foundation Server Extensions for SharePoint Products on the server.

    For more information, see Extensions for SharePoint Products.

  2. Open the administration console for Team Foundation.

  3. In the navigation bar, click SharePoint Web Applications.

  4. In the SharePoint Web Applications list, click the Web application whose server has changed as part of moving to a new server, and then click Change SharePoint Web Application.

  5. In Web Application URL and Central Administration URL, change the values to reflect the URLs on the new server. If necessary, change the value of Default location for team project collection sites to the new default location for this web application.

  6. Click OK.

    For more information about how to configure SharePoint web applications as part of your deployment, see Add a SharePoint Web Application to Your Deployment and Interactions Between SharePoint Products and Team Foundation Server.

Configure Reporting and Analysis Services

You can skip this procedure if you are not using a server that is running SQL Server Reporting Services as part of your deployment. If your deployment uses a report server, you must redirect Team Foundation Server to its location, restart the warehouse, and manually rebuild the database for Analysis Services.

Note

You must complete this procedure even if you restored the TFS_Warehouse and TFS_Analysis databases, as the previous section describes.

To reconfigure reporting and Analysis Services

  1. Open the administration console for Team Foundation.

  2. In the navigation bar, click Reporting.

  3. On the Reporting page, click Edit.

  4. In the Take Offline dialog box, click OK.

    The Reporting Services dialog box opens.

  5. Select the Use Report Server check box.

  6. Click the Warehouse tab, and, in Server, type or click the name of the report server.

  7. In Database, type the name of the warehouse database for Team Foundation Server.

    By default, this database is named TFS_Warehouse.

  8. (Optional) Click Test Connection to make sure that the database that you specified is valid.

  9. Click the Analysis Services tab, and, in the Server list, type or click the name of the server that is running SQL Server Analysis Services.

  10. In Database, type the name of the Analysis Services database for Team Foundation Server.

    By default, the name of this database is TFS_Analysis.

  11. If you are not using the default instance for the database, select the Specify nondefault instance check box, and then type or click the name of the instance.

  12. (Optional) Click Test Connection to make sure that the database that you specified is valid.

  13. In Username and Password, type the account name and password (if any) for the data sources account (TFSReports).

  14. Click the Reports tab, and, in the Server list, type or click the name of the report server, and then click Populate URLs.

  15. In Username and Password, type the account name and password (if any) for the data sources account (TFSReports).

  16. In Default Path, type the relative path of the location in which reports are stored, and then click OK.

  17. In the administration console, click Start Jobs to restart reporting.

  18. Open a Command Prompt window, and then change directories to %ProgramFiles%\Microsoft Team Foundation Server 2010\Tools.

  19. Type the following command to rebuild the database for Analysis Services:

    TFSConfig RebuildWarehouse /AnalysisServices /ReportingDataSourcePassword:Password

    Password is the password for the data sources account for Reporting Services (TFSReports).

  20. Wait until the command is successfully completed.

  21. On the report server, open Internet Explorer, type the following string in the Address bar, and then press ENTER:

    https://localhost:8080/VirtualDirectory/TeamFoundation/Administration/v3.0/WarehouseControlService.asmx

    For VirtualDirectory, type the name of the virtual directory for IIS that was specified when Team Foundation Server was installed. By default, the virtual directory is named tfs.

    The WarehouseControlWebService page opens.

    Note

    The Microsoft Team Foundation Server Application Pool must be running for the Warehouse Control Web service to be available.

  22. Click GetProcessingStatus, and then click Invoke.

    Important

    The service should return a value of Idle for all jobs, which indicates that the cube is not being processed. If a different value is returned, repeat this step until Idle is returned for all jobs.

  23. Return to the WarehouseControlWebService page, click ProcessAnalysisDatabase, and then click Invoke.

    A browser window opens. The service returns True when it successfully starts the processing of the cube and False if it is not successful or if the cube is currently being processed.

  24. To determine when the cube has been processed, return to the WarehouseControlWebService page, click GetProcessingStatus, and then click Invoke.

    Processing has completed when the GetProcessingStatus service returns a value of Idle for all jobs.

    For more information, see Manually Process the Data Warehouse and Analysis Services Cube for Team Foundation Server.

Verify Permissions for Users, Groups, and Service Accounts

After you move a deployment to new hardware, make sure that all users, groups, and service accounts for your deployment are configured with the permissions that they require to perform tasks and function correctly. You cannot automatically migrate all permissions. For example, administrators for Team Foundation must be members of the local Administrators group on the server so that they can open the administration console, and you must manually add them to that group.

To verify permissions

Refresh the Data Cache on Client Computers

To refresh the data cache on client computers

  • Log on to the server, and use the ClientService web service to force clients to update the cache for tracking work items.

    For more information, see Refresh the Data Caches on Client Computers.

    Note

    If you restored your databases to a different point in time, you must also refresh the version control cache.

See Also

Tasks

Restore Data to the Same Location

Refresh the Data Caches on Client Computers

Concepts

Backing up and Restoring Your Deployment

Restore Lab Management Components

Team Foundation Server Architecture

Service Accounts and Dependencies in Team Foundation Server

Interactions Between SharePoint Products and Team Foundation Server

Extensions for SharePoint Products

SQL Server and Team Foundation Server