TFS 2005: How to fail over to a Mirrored Data-Tier Server with Windows Sharepoint Service 2.0

 

 

I have reveiwed the TFS 2005 failover document, with TFS 2005 working with WSS 2.0, & have made the required corrections. The scenario is documented at:

https://msdn2.microsoft.com/en-us/library/aa980627(VS.80).aspx.

 

Please ensure that you follow the instructions in sequence suggested here.

 

====================================================================================================

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.

Note

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.

Note

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.

Steps 1-5 will cause the following error, Only Step 6 should be done:

“The database ReportServer exists on the SQL server. You must choose a different database or install Reporting Services into existing databases.”

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

Note

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.

Note

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 (https://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.

Note

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(These steps have to be done after - Map the Team Foundation Application-Tier Server to the New Principal Team Foundation Data-Tier Server)

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.

These steps have the potential of failing as TFSApp pool is stopped. So setupwarehouse will fail saying mturl parameter is required. A standard fix to that is to start the TFSApp pool, but this wont work at this stage because the AT is bound to the original principal server & we have not used the TFSAdminutil RenameDT yet… So the web.config is having an incorrect data source at this stage..

This statement should be used after the Map the Team Foundation Application-Tier Server to the New Principal Team Foundation Data-Tier Server step.

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

This is the time when” To build the data warehouse” will work & should be done. If the mturl missing error comes then one can start the TFSApp pool.

Also one would have to reprocess the TFSWarehouse DB in SSAS. Other wise reports will end up with error “The Team system cube either does not exist or has not been processed”. To process the ware house cube on the Mirrorred server..

a) In the Object Explorer pane, click Connect, and select Analysis Services.

b) On the Connect to Server dialog box, make sure that the server name and authentication values are correct, and then click Connect.

c) In the Object Explorer pane, expand Databases, right-click TFSWarehouse, and then click Process.

d) In Process Database - TFSWarehouse, click OK.

AT this time the Report Server app pool needs to be started & the default web site should be started(I feel the default web site should not have been stopped at all…). The reason I say this is we can’t browse

https://applTierName/Reports when the default web site is stopped & ReportServer application pool is stopped. An attempt to open Report Manager will give “Page Not Found”…

Starting just the ReportServer app pool wont also help..

Staring Just the Default Web Site wont also help…

Start both the ReportServer app pool & the Default Web Site..

Note that it this stage the Report Server Instance(in RSConfig) is already stopped… Therefore you will get the following error while browsing the Reports Manager site(https://AppTierName/Reports):

“The report server is not responding. Verify that the report server is running & can be accessed from this computer.”

Therefore use the RSConfig tool to:

a. Start the RSServer instance

b. Restore the encryption key backp

c. Go to Database Setup, give the new Server name(the mirrored server) & click Connect & OK.

d. Click Apply & Ok.

e. Check Event Viewer ->Application Logs to verify that RS initialized without errors.

Proceed with the below steps..

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

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

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

b. Select Credential stored securely in the report server.

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

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

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

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

Data source= newDataTierServerName ;initial catalog=TfsWarehouse

b. Select Credential stored securely in the report server.

c. 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 toin 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.

You would have to add the STS_Content_TFS DB as the content database of the defualt web site.

a) Click Start, click Administrative Tools, and then click SharePoint Central Administration.

b) On the Central Administration page, click Configure virtual server settings.

c) On the Virtual Server List page, click Default Web Site.

d) On the Virtual Server Settings page, click Manage content databases.

e) On the Manage Content Databases page, click Add a content database.

f) On the Add Content Database page, in Database Information, click Specify database server settings and in Database name, type STS_Content_TFS.

g) In Database Capacity Settings, in Number of sites before a warning event is generated, type 9000, and in Maximum number of sites that can be created in this database, type 15000, 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.

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

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