Move from a Single-Server to a Dual-Server Deployment

You might be able to support more projects or improve performance by moving from a single-server to a dual-server deployment of Visual Studio Team Foundation Server. In a dual-server deployment, two or more physical servers host the components that compose the logical application and data tiers of Team Foundation. When you move from a single-server to a dual-server deployment, you convert the original server into the application-tier server, and you install and configure SQL Server on the new data-tier server. You then redirect SharePoint Products and SQL Server Reporting Services to the new data-tier server, and you restore the data from your original deployment to the new data-tier server. For more information, see Team Foundation Server Move Types.

The procedures in this topic assume that you have configured SharePoint Products and SQL Server Reporting Services as part of your single-server deployment, and that you want to move those resources as well as the databases for Team Foundation. Your topology does not have to exactly match this example, but you might need to perform different steps, or skip some steps for the components that you do not have.

Before you perform this type of move, you should read through this topic and consider printing all of the required steps. You should also consider printing those topics to which this topic links and that contain information about additional required steps.

To perform this type of move, you must complete the procedures in the following sections in the sequence listed:

  1. Stop Services that Team Foundation Server Uses

  2. Back Up the Databases and the Encryption Key

  3. Install Prerequisites and Prepare the New Hardware

  4. Restore the Databases

  5. Prepare SQL Server for Team Foundation Server

  6. Redirect Team Foundation Server to its Databases

  7. Change Ownership of the Restored Databases

  8. Update Service Accounts

  9. Register the Location of the Moved Databases

  10. Redirect SharePoint Products to its Databases

  11. Repair Connections to SharePoint Web Applications

  12. Configure Reporting and Analysis Services

  13. Restart Services that Team Foundation Server Uses

  14. Refresh the Data Cache on Client Computers

Required Permissions

To perform these procedures, 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 have the SQL Server Perform Back Up and Create Maintenance Plan permissions set to Allow on the instance of SQL Server that hosts the databases

  • a member of the sysadmin security group for the database instance for Team Foundation and for the SQL Server Analysis Services instance of the warehouse database

  • an authorized user of the TFS_Warehouse database

  • a member of the TFSEXECROLE database role

  • if the deployment uses SharePoint Products, a member of the Farm Administrators group for the farm where the SharePoint Products databases are being restored

In addition to these permissions, you might need 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 need to open an elevated Command Prompt by clicking Start, right-clicking Command Prompt, and clicking Run as Administrator.

  • To follow a procedure that requires Internet Explorer, you might need 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 Web sites for Reporting Services, you might need 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 Microsoft Web site.

Stop Services that Team Foundation Server Uses

To stop services that Team Foundation Server uses

  1. On the server that is running the application-tier services for Team Foundation, open a Command Prompt window, and change directories to Drive:\%programfiles%\ Microsoft Team Foundation Server 2010\Tools.

  2. Type the following command:

    TFSServiceControl quiesce

    For more information, see TFSServiceControl Command.

Back up the Databases and the Encryption Key

Before you can change your deployment from a single-server to a dual-server configuration, you must back up the databases for Team Foundation. You will restore these databases to the new data-tier server as part of the move.

Important

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

  • TFS_Warehouse

  • TFS_Analysis

  • the administrative database for SharePoint Products (SharePoint_AdminContent_ID)

  • WSS_Content

  • WSS_Config

To back up the databases and the encryption key

  1. Back up all the databases for Team Foundation.

    For more information, see Back Up Team Foundation Server.

    Note

    You must also back up any custom site definitions, custom site templates, or custom Web parts for SharePoint Products that you want to keep. For more information, see "Backup and Restore Options for Windows SharePoint Services 2.0" on the Microsoft Web site or, for Windows SharePoint Services 3.0, "Choose backup and recovery tools (Windows SharePoint Services)" on the Microsoft Web site. If SharePoint Products is installed on the application tier and you want to move the databases for SharePoint Products to the new data tier, make sure that you back up the administrative database for SharePoint Products. (SharePoint_AdminContent_ID) along with the content and configuration databases.

  2. Back up the encryption key for Reporting Services. Make sure that you store it in a secure location on a different computer from the server that is running Team Foundation Server and that the new application-tier server can access the key. You must also store the password with which the key is encrypted.

    For more information, see Back Up the Reporting Services Encryption Key.

Install Prerequisites and Prepare the New Hardware

After you back up the databases, you must install the required software on the computer that will be the new data-tier server for your deployment. This software includes the following components:

  • a supported operating system for your deployment configuration

  • Internet Information Services (IIS)

  • SQL Server

To install and configure required software

  • Install and configure Windows and SQL Server on the new hardware, and make sure that the server and its software are operational.

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

    • Internet Information Services (IIS)

    • SQL Server

    Note

    You can choose to change versions or editions of some software, such as the operating system, but not others. Changing versions or editions might complicate the restoration.

Restore the Databases

After you install the prerequisite software, you can restore data for Team Foundation to the new data-tier server by using the restore tools that are provided with SQL Server.

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. For more information, see Back Up Team Foundation Server.

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 about how to restore databases, see the following page on the Microsoft Web site: 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 make up 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.

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:

  • the administration database for SharePoint Products (WSS_AdminContent)

  • The configuration database for SharePoint Products (WSS_Config)

  • the content database for SharePoint Products (WSS_Content)

    Note

    The names of the databases that contain data for SharePoint Products will vary based on the version of SharePoint Products that is installed and whether the person who installed it customized the name.

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.

    The first backup that you restore must be a full backup, 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 selected in the Database list.

  13. Under Select the transaction log to restore, select the check box 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 next to the transaction mark that you want to use for the restoration, and then click OK.

    Important

    You must use the same 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 Web site: 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 Web site: Restoring the Encryption Key (Reporting Services Configuration).

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 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 is the name of the instance of SQL Server that hosts the databases for Team Foundation Server, in either ServerName or ServerName\InstanceName format:

    **TFSConfig PrepSQL /SQLInstance:**ServerName

    Note

    If you are using more than one instance of SQL Server in your deployment, you must run this command for each instance. For more information, see PrepSQL Command.

Redirect Team Foundation Server to its Databases

You must redirect Team Foundation Server to its moved databases on the new data-tier server.

To redirect Team Foundation Server to its databases

  1. Log on to the application-tier server for Team Foundation, 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, TFS_Configuration is the name of the restored configuration database for Team Foundation Server, and ServerName2 is the name of the server that hosts Analysis Services, if it differs from the server that hosts the configuration database. 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,ServerName2 **/AnalysisInstance:**ServerName2 **/AnalysisDatabaseName:**DatabaseName

    Note

    In /SQLInstances, you must specify all of the instances, separated by commas, of SQL Server that host databases for Team Foundation Server. If your deployment does not use reporting, you can skip using the /AnalysisInstance and /AnalysisDatabaseName options. 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 the user account with which you are logged on is an appropriate account. For example, you can use the account with which Team Foundation Server was installed, referred to in the installation guide as TFSSETUP. At a minimum, you must make sure that the account is 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 configuration database 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 of the databases for Team Foundation Server.

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 in order to help ensure that the identity and the format of the accounts are appropriate for the new data-tier 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 add 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 add the data sources account:

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

    For more information about the Accounts command-line utility, see Accounts Command.

Register the Location of the Moved Databases

After you update the service account information, you must redirect the application tier to the new location of the restored databases.

Note

If you have more than one application tier in your deployment, you must register the location of the databases on each of those servers.

To register the location of the databases

  1. On the application-tier server, 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, where DatabaseName is the name of the configuration database (by default, TFS_Configuration):

    **TfsConfig registerDB /SQLInstance:**ServerName **/DatabaseName:**DatabaseName

    For more information about how to use this command, see RegisterDB Command.

Redirect SharePoint Products to the New Location of Its Databases

You can skip this procedure if your deployment does not use SharePoint Products, or if you are not changing the location of the databases SharePoint Products uses as part of changing from a single-server to a dual-server deployment.

You must redirect SharePoint Products to the new location of its databases on the new data-tier server. This procedure presumes that you did not move the application tier for SharePoint Products, but you moved its databases as part of moving the logical data-tier to another server. This includes redirecting any Web sites for team projects to the content database on the new data-tier server for Team Foundation. 

To redirect SharePoint Products to its moved databases

Repair Connections to SharePoint Web Applications

As part of moving to a dual-server deployment, you should repair the connections to the SharePoint Web applications that the deployment uses. This will help ensure that all of the settings are set correctly.

To repair the connections to SharePoint Web applications

  1. Open the administration console for Team Foundation.

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

  3. In the SharePoint Web Applications list, click the Web application whose content database has changed location as part of moving to the new data tier, and then click Repair Connection.

  4. In Repair the connection to a SharePoint Web Application, click Repair.

  5. When the repair operation completes, click Close.

  6. Repeat steps 3-5 for each SharePoint Web application used by your deployment.

    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 reporting as part of your deployment. If your deployment uses a report server and you moved the reporting and Analysis Services databases as part of adding another server as a data-tier server, you must redirect Team Foundation Server to its location, restart the warehouse, and manually rebuild the database for Analysis Services.

To reconfigure reporting and Analysis Services

  1. Open the administration console for Team Foundation.

  2. In the navigation bar, click Reporting.

  3. In Reporting, 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 server where you restored the reporting databases.

  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.

  10. In the Server list, type or click the name of the server where you restored the database for Analysis Services.

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

    By default, the name of this database is TFS_Analysis.

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

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

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

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

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

  17. In Default Path, type the relative path for storing reports, and then click OK.

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

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

  20. 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).

  21. Wait until the command is successfully completed.

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

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

    The ControllerService page opens.

  23. Click GetWarehouseStatus, and then click Invoke.

    Important

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

  24. Return to the ControllerService page, click Run, and then click Invoke.

    This step initiates processing. The service returns True when it has successfully started the controller and False if the warehouse is still being processed.

  25. To determine when the warehouse has been processed, return to the ControllerService page, click GetWarehouseStatus, and then click Invoke.

    Processing is completed when the GetWarehouseStatus service returns a value of Idle.

Restart Services That Team Foundation Server Uses

To restart services that Team Foundation Server uses

  1. On the server that is running the application-tier services for Team Foundation, open a Command Prompt window, and change directories to Drive:\%programfiles%\ Microsoft Team Foundation Server 2010\Tools.

  2. Type the following command:

    TFSServiceControl unquiesce

    For more information, see TFSServiceControl Command.

Refresh the Data Cache on Client Computers

To refresh the data cache on client computers

  • Use the ClientService Web service to force clients to update the cache for tracking work items and for version control the next time that the client connects to the application-tier server.

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

See Also

Tasks

Move Team Foundation Server from One Environment to Another

Move Team Foundation Server from One Hardware Configuration to Another

Concepts

Team Foundation Server Move Types

Team Foundation Server Architecture

Restore a Single-Server Deployment to New Hardware