Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

How to: Fail Over to a Mirrored Data-Tier Server

If you have configured SQL Server mirroring for the Team Foundation databases, you can manually swap the roles of the principal and mirrored Team Foundation data-tier servers in case the principal Team Foundation data-tier server must be taken off-line. This can help minimize disruption of your Team Foundation Server deployment. For more information about Team Foundation Server and SQL Server Mirroring, see Mirroring the Team Foundation Data-Tier Server.

NoteNote

The following procedures are for use if the principal data-tier server is available. If the principal data-tier server is unavailable, follow the procedures in How to: Fail Over to a Mirrored Data-Tier Server if the Principal Data-Tier Server is Unavailable.

Required Permissions

To perform these procedures, you must be a member of the Administrators group and a member of the SQL Server Administrator group on the principal and mirroring Team Foundation data-tier servers. For more information, see Team Foundation Server Permissions.

Prepare and Stop the Team Foundation Application-Tier Services

Before you fail over the Team Foundation data-tier server, you must stop the services from using the principal Team Foundation data-tier server and prepare the Team Foundation application-tier server to use the mirroring Team Foundation data-tier server.

To re-configure and stop the Report Server

  1. On the Team Foundation application-tier server, open the Reporting Services Configuration tool and connect to the Report Server instance.

    To open the Reporting Services Configuration tool, click Start, click All Programs, click Microsoft SQL Server 2005, click Configuration Tools, and then click Reporting Services Configuration.

  2. In the Explorer pane, click Database Setup, type the new database server name in Server Name, and then click New.

  3. In the SQL Server Connection dialog box, type ReportServer in Database Name, click OK, and then click Apply.

    NoteNote

    If the Team Foundation data-tier server is offline, applying the connection might take several minutes.

  4. In the Explorer pane, click Windows Service Identity.

  5. On the Windows Service Identity page, in the Built-in Service Account drop-down box, Network Service should be selected, but Apply is unavailable. To grant the Team Foundation application-tier server log on permissions to the SQL Server on the Team Foundation data-tier, in the Built-in Service drop-down box, select Local Service. Do not click Apply, but instead return to the Built-in Service drop-down box and re-select Network Service. When Network Service is selected and Apply is available, click Apply.

  6. To stop the Report Server, click Server Status, and then click Stop.

To stop and configure the Web Sites

  1. On the Team Foundation application-tier server, click Start, click Administrative Tools, and then click Internet Information Services (IIS) Manager.

  2. Expand the computer node, expand the Web Sites node, select the Default Web Site, and then click Stop.

  3. On the Team Foundation application-tier server, click Start, click Administrative Tools, and then click Windows SharePoint Central Administration.

  4. Click Configure virtual server settings, click Default Web Site, click Manage content databases, click the name of the content database, select Remove content database, and then click OK.

  5. On the SharePoint Central Administration page, click Configure virtual server settings, click Default Web Site, click Remove Windows SharePoint Services from virtual server, click Remove without deleting content databases, and then click OK.

To stop the remaining services used by Team Foundation Server

  1. On the Team Foundation application-tier server, click Start, click Administrative Tools, and then click Services.

  2. In Services Manager, locate the following services, right-click the service, and then click Stop:

    • SharePoint Timer Service

    • TfsServerScheduler Service

    NoteNote

    To open Services Manager, click Start, click Administrative Tools, and then click Services.

  3. On the Team Foundation application-tier server, click Start, click Administrative Tools, and then click Internet Information Services (IIS) Manager.

  4. Expand the Application Pools node, locate and right-click the application pools, and then click Stop for the following application pools:

    • ReportServer

    • TFS AppPool

Add Service Accounts to the Mirroring Team Foundation Data-Tier Server

After stopping the services, you must add the Team Foundation service account and the SQL Server Reporting Services service account to the mirroring Team Foundation data-tier server.

To add the service accounts to the mirroring Team Foundation data-tier server

  1. On the mirroring Team Foundation data-tier server, click Start, click All Programs, click Microsoft SQL Server, and then click SQL Server Management Studio.

  2. Select Database Engine for the Server type. Select the appropriate Server name and Authentication scheme for the server. Provide a valid User name and Password if it is required by your SQL Server, and then click Connect.

  3. In SQL Server Management Studio, click File, click New, and then click Query with Current Connection.

    A new query window opens.

  4. In the new query, type the following, where domain is the name of the domain to which your service accounts belong, TFSService is the name of the Team Foundation service account, and TFSReports is the name of the SQL Server Reporting Services service account:

    CREATE LOGIN [ domain / TFSService ] FROM WINDOWS;

    CREATE LOGIN [ domain / TFSReports ] FROM WINDOWS;

    GO

  5. On the SQL Server Management Studio toolbar, click Execute. Verify that the command executed correctly, and then close SQL Server Management Studio.

    NoteNote

    If either the TFSService service account, the TFSReports service account, or both service accounts already exist on the mirroring Team Foundation data-tier server, you will see an error that indicates that these accounts already exist. You can safely ignore this error message and continue with the next procedure.

Manually Swap the Roles of the Principal and Mirroring Databases

After you have added the TFSService and TFSReports service accounts to the mirroring Team Foundation data-tier server, you can manually fail over the Team Foundation databases so that the principal Team Foundation data-tier server becomes the mirroring server, and the mirroring Team Foundation data-tier server becomes the principal Team Foundation data-tier server. For more information about manually failing over databases in SQL Server Management Studio, see the Microsoft Web site (http://go.microsoft.com/fwlink/?LinkId=76086).

To open SQL Server Management Studio on the principal Team Foundation data-tier server

  1. On the principal Team Foundation data-tier server, click Start, click All Programs, click Microsoft SQL Server, and then click SQL Server Management Studio.

  2. Select Database Engine for the Server type. Select the appropriate Server name and Authentication scheme for the server. Provide a valid User name and Password if it is required by your SQL Server, and then click Connect.

  3. Expand the Databases node to show the list of databases that make up the Team Foundation data tier.

Complete the "To fail over each database" procedure for the following databases:

  • ReportServer

  • ReportServerTempDB

  • STS_Config_TFS

  • STS_Content_TFS

  • TfsBuild

  • TfsIntegration

  • TfsVersionControl

  • TfsWarehouse

  • TfsWorkItemTracking

  • TfsWorkItemTrackingAttachments

  • TfsActivityLogging

To fail over each database

  1. Right-click the database that you want to fail over, and then click Properties.

  2. On the Database Properties page, in Select a page, click Mirroring.

  3. Click Failover.

    NoteNote

    If the Failover button is not active, you have not configured the database for mirroring. For more information, see How to: Configure SQL Server Mirroring for the Team Foundation Data-Tier Server.

Build the Data Warehouse

After swapping the databases, you must build the data warehouse.

To build the data warehouse

  1. On the Team Foundation application-tier server, click Start, click All Programs, click Accessories, and then click Command Prompt.

    The Command Prompt window opens.

  2. Open the Program Files\Microsoft Visual Studio 2005 Team Foundation Server\Tools folder using the command line. For example:

    cd C:\Program Files\Microsoft Visual Studio 2005 Team Foundation Server\Tools

  3. Open a Command Prompt window and build the data warehouse by typing the following command, where newDataTierServerName is the name of the mirrored Team Foundation data-tier server that you have failed over to, TFSReportServiceAccount is the name of the reporting services service account, and TFSServiceAccount is the name of the Team Foundation Server service account:

    setupwarehouse -o -s newDataTierServerName -d TfsWarehouse -c warehouseschema.xml -ra TFSReportAccount -a TFSServiceAccount -v

  4. On the Team Foundation data-tier server, click Start, click All Programs, click Microsoft SQL Server, and then click SQL Server Management Studio.

  5. Select Analysis Server for the Server type. Select the appropriate Server name and Authentication scheme for the server. Provide a valid User name and Password if it is required by your SQL Server, and then click Connect.

  6. Expand the Databases node to see the list of databases that make up the Team Foundation Server data tier.

  7. Right-click the TFSWarehouse and then click Process.

  8. In the Process Database dialog box, click OK to process the warehouse.

Map the Team Foundation Application-Tier Server to the New Principal Team Foundation Data-Tier Server

After you have failed over all the Team Foundation databases, the mirroring Team Foundation data-tier server becomes the principal Team Foundation data-tier server for the deployment. To complete the fail-over, you must redirect the Team Foundation application-tier server to that server.

To redirect the Team Foundation application-tier server and restart services

  1. On the Team Foundation application-tier server, click Start, click All Programs, click Accessories, and then click Command Prompt.

    The Command Prompt window opens.

  2. Open the Program Files\Microsoft Visual Studio 2005 Team Foundation Server\Tools folder using the command line. For example:

    cd C:\Program Files\Microsoft Visual Studio 2005 Team Foundation Server\Tools

  3. Run the TFSAdminUtil tool with the RenameDT option to connect to the Team Foundation data-tier server that is now acting as the principal server (the server that was the mirroring server). For example:

    TFSAdminUtil RenameDT MirrorDataTierServer

    In this example, MirrorDataTierServer represents the name of the Team Foundation data-tier server to which you want to connect.

  4. Click Start, click Administrative Tools, and then click Internet Information Services (IIS) Manager.

  5. In the Explorer pane, right-click the name of the application-tier server, click All Tasks, and then click Restart IIS.

  6. In Stop/Start/Reset, verify that you are restarting services on the correct server, and then click OK. Wait for the services to stop and restart, and then close IIS Manager.

  7. On the Team Foundation application-tier server, open Internet Explorer and in the address bar, type http://applicationTierServerName/reports.

  8. On the SQL Server Reporting Services home page, click TfsOlapReportDS.

    1. Verify that the correct connection information appears in Connection String.

      The string should include the name of the mirrored Team Foundation data-tier server that you have failed over to, and the initial catalog should be TfsWarehouse.

      Data source= newDataTierServerName ;initial catalog=TfsWarehouse

    2. Select Credential stored securely in the report server.

    3. Enter the domain, account name, and password for the Reporting Services service account specified for Reporting Services.

    4. Select Use as windows credentials when connecting to the data source.

  9. On the SQL Server Reporting Services home page, click TfsReportDS.

    1. Make sure Connection String contains the mirrored Team Foundation data-tier server that you have failed over to.

      Data source= newDataTierServerName ;initial catalog=TfsWarehouse

    2. Select Credential stored securely in the report server.

    3. Enter domain, account name, and password for the TFSREPORTS service.

  10. Select Use as windows credentials when connecting to the data source.

  11. On the Team Foundation application-tier server, click Start, click Programs, click Administrative Tools, and then click SharePoint Central Administration.

  12. Select Set configuration database server, type the name of the mirrored Team Foundation data-tier server that you have failed over to in the Database server field, select the Connect to existing configuration database, and then click OK.

  13. Select Set default content database server, type the name of the mirrored Team Foundation data-tier server that you have failed over to, and then click OK.

  14. In SharePoint Central Administration, select Extend or upgrade virtual server, click Default Web Site, click Extend and map to another virtual server.

  15. Select Default Web Site in the Server Mapping list, select the Use an existing application pool option, and then click OK.

  16. On the Team Foundation application-tier server, click Start, click Administrative Tools, click Services, select SharePoint Timer Service, and then click Start.

  17. Open Internet Explorer and type the server name as the address to verify that the SharePoint portal site appears.

  18. On the Team Foundation application-tier server, open Internet Information Services (IIS) Manager. To open Internet Information Services (IIS) Manager, click Start, click Administrative Tools, and then click Internet Information Services (IIS) Manager.

  19. Expand the Application Pools node, locate and right-click the application pools, and then click Start for the following application pools:

    • ReportServer

    • TFS AppPool

  20. Open the Reporting Services Configuration tool, click Server Status, and then click Start.

  21. On the Team Foundation application-tier server, open Internet Explorer.

  22. In the address bar, type the following address to connect to the ClientService Web service.

    http:// applicationTierServerName :8080/WorkItemTracking/v1.0/ClientService.asmx

  23. Select the StampWorkitemCache Web method and then click Invoke.

See Also

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.