Wednesday, April 26, 2017

TFS 2017 – Upgrade from TFS 2015

Current scenario: TFS 2015 Update 2 (Application Tier) on Windows 2012 R2. SQL Server 2012 (Data Tier) on Windows 2012 R2. Two TFS Build servers on Windows 2012 R2. SharePoint 2013 on Windows 2012 R2. Reporting Services configured on AT as well.

New Scenario: Upgrade AT with 2017 Update 1 on the same hardware. New hardware for SQL 2016 SP1 (DT). In-place upgrade for Build servers with TFS 2015 Update 3. Also, in-place upgrade of TFS extensions on all SPS WFEs.

So to summarize, we need to migrate current DT to new proposed 2016 DT (Since TFS 2017 requires SQL 2014 or above). And everything else will be the in-place upgrade.

There were a couple of snags which I had initially hence I need to re-run the whole process in the Test environment to gain some confidence before Production move. I’m grateful that we have virtualized servers.

I have put the whole process in step by step list for anyone interested.

1.     Pre-deployment Plan

Step
Details
PRE01      
Database backups

Request the full backups of TFS databases running on Data Tier (DT). Make sure backups of databases from Database and Analysis engine both are made.
PRE02      
Server Snapshots

Request snapshots of all servers including Application Tier (AT) and build servers.
PRE03      
Free space availability

·         Make sure you have 50 gigs of free space in E: drive on AT for cache.
·         Make sure you have enough space in C: drive on AT for 2017 install.
·         Make sure you have enough space in E: and F: drive on new 2016 DT for DB restore operation.
PRE04      
Install Team Foundation Server extensions for SharePoint Products onto a remote installation of SharePoint Products

SPS needs to be updated with TFS 2017 extensions before you can configure TFS on AT.
PRE05      
Ensure Services are running

1.       Make sure “Remote Access Connection Manager” service is running and startup type is Automatic on all Build Servers. (Ensure one of the dependent services “Telephony” is also running and startup type should be Automatic.)
PRE06      
New SQL 2016 server for TFS

1.       Setup a new SQL 2016 server for hosting TFS databases, analysis services and SSRS.
2.       Configure DNS aliases if required.
3.       Migrate existing security logins from current SQL 2012 onto new SQL 2016.
4.       Make sure SP1 is installed for SQL and SSRS 2016
5.       Make sure you have the full-text search feature installed on new 2016 DT. This feature is required for Team Foundation Server to operate correctly. Verify here.
PRE07      
Configure new SQL 2016 server for TFS

On 2016 DT:
1.       Add “TFSSERVICE” to
a.       “Log on as a service” permission.
b.       “Content Manager” role on the SQL Server Reporting Services.
c.       “TFSExecRole”, or if this role does not exist in the database, a combination of the following roles for any databases that Team Foundation Server uses:
                                                               i.      db_owner
                                                             ii.      db_create
2.       Add “TFSREPORTS” to
a.       “Allow Log on locally” permission on Application Tier, Data Tier and Build servers.
b. "TFSWareHouseDataReader" permission on the report server.
3.       Add “TFSINSTALL” as:
a.       Local admin
b.       SA role on databases and Analysis services

2.     Deployment Plan

Step
Details
DEP01      
Stop IIS and TFS Services.

On AT login as TFSInstall service account and follow the steps below.

Execute following statement from an elevated command prompt:

"C:\Program Files\Microsoft Team Foundation Server 14.0\Tools\TfsServiceControl.exe" quiesce

Note: If the above statement fails, manually stop IIS App pools and sites.
DEP02      
Apply Update 3 to TFS 2015 server

On AT login as TFSInstall service account and follow the steps below.


Launch TfsServer2015.3.exe to begin the installation:



  










  
DEP03      
Start IIS and TFS Services.

On AT login as TFSInstall service account and follow the steps below.

Execute following statement from an elevated command prompt:

"C:\Program Files\Microsoft Team Foundation Server 14.0\Tools\TfsServiceControl.exe" unquiesce

Note: If the above statement fails, manually start IIS App pools and sites.
DEP04      
Install Team Foundation Build Service

Follow the below-mentioned steps on all the build servers.

On Build server login as TFSInstall service account and follow the steps below.

Launch TfsServer2015.3.exe to begin the installation:

1.       Choose the default location, and then click Install. The TFS Upgrade wizard appears.
2.       On TFS Configuration Center screen, chose Configure XAML Build Service and click Start Wizard
3.       On the Welcome screen, click Next.

Chose Yes on Use Existing resources confirmation.
4.       Make sure the concerned collection appears on the following screen.

5.       Specify credentials for TFSService account. Under Run Team Foundation Build Service as, make the following selection, and then click Next:
a.       Choose Use a user account, and then enter the account name (TFSSERVICE) and password.
b.       Click Test. Make sure it succeeds.

6.       Click Next
7.       Click Next on Review screen.
8.       Click Configure

Restart build controller after the upgrade is successful.
DEP05      
Backup TFS SQL 2012

1.       Stop IIS (follow DEP01 above).
2.       Execute following command from elevated command prompt:

“C:\Program Files\Microsoft Team Foundation Server 15.0\Tools\TfsBackup.exe”

Select Old DT as source sql server instance.
Enter network path for backup database location.

DEP06      
Backup SSRS encryption key

On AT login as TFSInstall service account and follow the steps below:

1.       Launch Reporting Services Configuration Manager
2.       Connect to MSSQLServer.
3.       Select Encryption keys from the left pane and click Backup.
4.       Enter file location and password
5.       Confirm the presence of key under specified location as in #4.
DEP07      
Restore SQL 2012 databases onto SQL 2016 instance

On new DT login as TFSInstall service account and follow the steps below:

1.       Detach ReportServerDB and ReportServerTempDB.

On AT login as TFSInstall service account and follow the steps below:

1.       Execute following command from elevated command prompt:

“C:\Program Files\Microsoft Team Foundation Server 15.0\Tools\TfsRestore.exe”

SelectNew DT as target SQL server instance.
Enter network path for backup database location.

Ask DBAs to restore Tfs_Analysis DB from old DT to New DT. Use backups as specified in Pre-deployment step PRE01.
DEP08      
Restore SSRS encryption key

On new DT login as TFSInstall service account and follow the steps below:

1.       Launch Reporting Services Configuration Manager
2.       Select Encryption keys from left pane and click Restore.
3.       Refer backup
4.       If Scale-out deployment shows old and new SSRS instances both, delete old one.
a.       rskeymgmt –l
b.       rskeymgmt -r [remove old one]

DEP09      
Remap and configure TFS 2015.3 for new SQL 2016 server

On new AT login as TFSInstall service account and follow the steps below:

1.       Open an elevated command prompt.
2.       Set pwd to “C:\Program Files\Microsoft Team Foundation Server 14.0\Tools”
3.       Execute:

TfsConfig.exe RemapDBs /DatabaseName:;Tfs_Configuration /SQLInstances: /AnalysisInstance:< NewDTServer > /AnalysisDatabaseName:Tfs_Analysis

TfsConfig.exe Accounts /Add /AccountType:ApplicationTier /Account: /Password: /SqlInstance: < NewDTServer > /DatabaseName:Tfs_Configuration

TfsConfig.exe Accounts /Add /AccountType:ReportingDataSource /Account: /Password: /SqlInstance:< NewDTServer > /DatabaseName:Tfs_Configuration

[Close Console if its open]
TfsConfig.exe RegisterDB /SqlInstance:< NewDTServer > /databaseName:Tfs_Configuration

4.       Open TFS Administration Console

·         Select Reporting tab and click Edit.
·         Click OK to stop jobs.
·         Verify and Update the new settings. Under Reporting tab enter new “NewDTServer” as the server. May need to re-enter creds.
·         Start Jobs.
DEP10      
Restart TFS

Restart services on AT.

DEP11      
Update connection for OLAP data source

Open browser (with TfsService account) with Url as http://< NewDTServer >/Reports/manage/catalogitem/properties/Tfs2010OlapReportDS

Under connection string update Data Source with “NewDTServer”.
Supply the password for Report Reader account (TFSREPORTS).
Test connection. If success, click Apply.
DEP12      
Upgrade Team Foundation Server 2017 Update 1

On AT login as TFSInstall service account and follow the steps below.

1.       Stop AT
2.       Mount following iso and launch Tfs2017.1 to begin the installation:
3.       After successful completion, if prompted to restart, agree.
4.       TFS Configuration Center window will pop up after reboot.

5.       In the Team Foundation Server Configuration wizard (Welcome screen), choose No, I do not want to participate, and then click Next.
6.       Choose the second option of “I have existing databases to use for this TFS deployment” and click Next 




7.      
8.       Select “Production Upgrade” and click Next
9.       Specify credentials for TFSservice account and ensure Test pass.
10.  
11.   Don’t install or configure Search feature at this time. Click Next
12.   Click “Configure Reporting for use with TFS”. Click Next
13.   For reporting services instance enter “ReportServerAlias”





14.   Select “Enable integration with SharePoint”
15.   Verify and confirm.
16.   Click Configure, Next
17.   Save the logs.
18.   Click Close
19.   Revert authentication protocol to NTLM (optional)

Execute following command from an elevated command prompt:

“C:\Program Files\Microsoft Team Foundation Server 15.0\Tools\TFSConfig.exe Authentication /provider:NTLM /siteType: ApplicationTier”
DEP13      
Restart TFS Build Controllers

Follow the below-mentioned steps on both the build servers.

On Build server login as TFSInstall service account and follow the steps below.

1.       Open TFS Administration Console.
2.       Select XAML Build Configuration
3.       Restart controller
DEP14      
Update SSRS data source

Follow here (DEP011)
      

3.     Post-deployment Plan


Step
Details
PST01 
Provision TFS Service account

Make sure following roles exists under Tfs_Analysis SSAS database called:
a.        TfsWarwhouseDataReader:  (members=TFSREPORTS, SPSFarmAdmin) with none permissions
b.       TfsWarehouseAdministrator: with full control and members TFSSERVICE, TFSINSTALL

PST02 
Configure Security and new Features in TFS 2017.1

·         Enable the “New Work Item“ form.
Go to collection admin page. Click “Enable the new work item form”.
Click “Configure the opt-in model” and select “Enable opt-in for all users”.


PST03 
Repair SharePoint connection

On AT server login as TFSInstall service account and follow the steps below.

Open TFS Admin console.
Select SharePoint Web Applications and click Repair Connection.

Note: If SharePoint portal widgets throw an error about TFS project not found then either wait for TFS sync jobs to finish (24 hrs.) or clear cache on all SPS WFE and TFS AT. Cache is located under “C:\ProgramData\Microsoft\Team Foundation\Web Access”.

Reset IIS on all WFEs.
PST04 
Deprovision old TFS databases

Request de-provision of old TFS databases on old DT.


No comments: