I have been given a task to migrate existing Team Foundation Server (TFS) from version 2010 to 2012. The migration include hardware migration and database migration. The OS for both hardware are the same: Windows Server 2008 R2. The database will be upgraded from SQL Server 2008 R2 to SQL Server 2012. The following are the steps that I had done in a virtual environment and it is recommended to do so before start doing the actual work.
I have TFS2010 installed in one of my Hyper-V instances. I try to mimic one of the production TFS2010 Team Project Collections by replicating the projects source code to a different local folder and then check them into the virtual TFS2010. Before mapping the local folder with the TFS2010 and checking in all the source code, you need to remove all the existing source control binding first by deleting all the *.vssscc and *.vspscc files in the project folder and subfolders.
Now, perform a full database backup on TFS2010. If you have TFS2010 power tools installed, you can use it to perform full backup. You can get the power tools from here. Otherwise, use SQL Server Management Studio to do the job.
The backup files are actually *.bak and *.trn. Normally you would see tfs_Configuration.bak, it is the TFS core database. The rest of the *.bak files are your Team Project Collection database. Copy all the *.bak and *.trn files to a shared folder in the new server. The tfs_Configuration contains all your Team Project Collections information. The Team Project Collection database contain all your project source code, work item, etc.
Next, I want to setup TFS2012 in the new server. TFS2012 require minimum of 4GB RAM, you need to ensure you have enough memory for your virtual instance. But before that, I need to ensure all prerequisite software are installed first. So, I have to install Web Server (IIS) role to my new server then I have my SQL Server 2012 installed then follow by Sharepoint Foundation 2010. By the way, we need to include Full-Text Search, Reporting Services and Analysis Services features during the SQL Server installation.
Important note: Please make sure the database collation is Latin1_General_CI_AS. If you miss it, you can change the collation later.
After SQL Server 2012 setup is complete, proceed to restore all the databases which you had backup earlier to this new SQL Server 2012 by using SQL Server Management Studio.
Once all the databases are restored, proceed to run TFS setup. Start the Upgrade wizard.
Then, click Next and come to Database configuration. Then, click the "List Available Databases" link.
The TFS2010 database which you had restored just now will appear in the list. Make sure you check the checkbox at the window below to confirm you have a current backup. Click the Next button to proceed.
Then, enter the service account credential if you do not want to use the default service account. Click the Test link button and get a green check mark before proceed.
The reporting configuration will be copied from TFS2010 configuration automatically base on the tfs_Configuration. Change if you wish.
Configure to use Sharepoint with TFS2012 is optional.
Then, proceed to click Verify button.
Unfortunately I got the following error during the verification process. If you happen to encounter the same error, remain the window open.
Error:
TF255374: The following SQL Server instance is not compatible with Team Foundation Server.
Resolution:
TFS require default collation Latin1_General_CI_AS. I forgot to ensure the correct collation during the SQL Server 2012 installation just now. By default, SQL Server will pick Latin_General_CI_AI collation for Malaysia region. Suppose US folks won't encounter this issue.
Now, insert back the SQL Server 2012 ISO, and then open up command prompt, and then change the directory drive to where your ISO is mounted, and then execute the following command to change the collation:
After changing the SQL Server default collation, all the existing databases will be detached. Therefore, open up SQL Server Management Studio, reattach all the databases which you had restored just now and all the missing database.
Now, go back to the TFS Upgrade Wizard window, click the link button to rerun the readiness check. You should see all the green sign now. My SharePoint Integration is a warning sign is because I have not install and configure SharePoint yet. You still can proceed to click the "Configure" button then install the Sharepoint Foundation later.
Now, wait.....
Click the Next button, then wait again.....
Job done! It is the sign for you to open up Visual Studio 2012, use the Team Explorer to connect to your new TFS2012. View the code, and view the change history, ensure everything still in tact and correct.
But, I still miss the SharePoint integration. It seem like it is optional to have it. If you want it, you still can install it now by going back to the TFS setup wizard. Select the "Configure Extensions for SharePoint Products". If you already had installed SharePoint on your server, you still start the same wizard to configure it. Otherwise, you still can use TFS without SharePoint.
Then, install SharePoint Foundation 2010.
I have TFS2010 installed in one of my Hyper-V instances. I try to mimic one of the production TFS2010 Team Project Collections by replicating the projects source code to a different local folder and then check them into the virtual TFS2010. Before mapping the local folder with the TFS2010 and checking in all the source code, you need to remove all the existing source control binding first by deleting all the *.vssscc and *.vspscc files in the project folder and subfolders.
Now, perform a full database backup on TFS2010. If you have TFS2010 power tools installed, you can use it to perform full backup. You can get the power tools from here. Otherwise, use SQL Server Management Studio to do the job.
The backup files are actually *.bak and *.trn. Normally you would see tfs_Configuration.bak, it is the TFS core database. The rest of the *.bak files are your Team Project Collection database. Copy all the *.bak and *.trn files to a shared folder in the new server. The tfs_Configuration contains all your Team Project Collections information. The Team Project Collection database contain all your project source code, work item, etc.
Next, I want to setup TFS2012 in the new server. TFS2012 require minimum of 4GB RAM, you need to ensure you have enough memory for your virtual instance. But before that, I need to ensure all prerequisite software are installed first. So, I have to install Web Server (IIS) role to my new server then I have my SQL Server 2012 installed then follow by Sharepoint Foundation 2010. By the way, we need to include Full-Text Search, Reporting Services and Analysis Services features during the SQL Server installation.
Important note: Please make sure the database collation is Latin1_General_CI_AS. If you miss it, you can change the collation later.
After SQL Server 2012 setup is complete, proceed to restore all the databases which you had backup earlier to this new SQL Server 2012 by using SQL Server Management Studio.
Once all the databases are restored, proceed to run TFS setup. Start the Upgrade wizard.
Then, click Next and come to Database configuration. Then, click the "List Available Databases" link.
The TFS2010 database which you had restored just now will appear in the list. Make sure you check the checkbox at the window below to confirm you have a current backup. Click the Next button to proceed.
Then, enter the service account credential if you do not want to use the default service account. Click the Test link button and get a green check mark before proceed.
The reporting configuration will be copied from TFS2010 configuration automatically base on the tfs_Configuration. Change if you wish.
Configure to use Sharepoint with TFS2012 is optional.
Then, proceed to click Verify button.
Unfortunately I got the following error during the verification process. If you happen to encounter the same error, remain the window open.
Error:
TF255374: The following SQL Server instance is not compatible with Team Foundation Server.
Resolution:
TFS require default collation Latin1_General_CI_AS. I forgot to ensure the correct collation during the SQL Server 2012 installation just now. By default, SQL Server will pick Latin_General_CI_AI collation for Malaysia region. Suppose US folks won't encounter this issue.
Now, insert back the SQL Server 2012 ISO, and then open up command prompt, and then change the directory drive to where your ISO is mounted, and then execute the following command to change the collation:
Setup /QUIET /ACTION=REBUILDDATABASE /INSTANCENAME=MSSQLSERVER /SQLSYSADMINACCOUNTS=Administrator /SAPWD=p@ssw0rd /SQLCOLLATION=Latin1_General_CI_AS
After changing the SQL Server default collation, all the existing databases will be detached. Therefore, open up SQL Server Management Studio, reattach all the databases which you had restored just now and all the missing database.
Now, go back to the TFS Upgrade Wizard window, click the link button to rerun the readiness check. You should see all the green sign now. My SharePoint Integration is a warning sign is because I have not install and configure SharePoint yet. You still can proceed to click the "Configure" button then install the Sharepoint Foundation later.
Now, wait.....
Click the Next button, then wait again.....
Job done! It is the sign for you to open up Visual Studio 2012, use the Team Explorer to connect to your new TFS2012. View the code, and view the change history, ensure everything still in tact and correct.
But, I still miss the SharePoint integration. It seem like it is optional to have it. If you want it, you still can install it now by going back to the TFS setup wizard. Select the "Configure Extensions for SharePoint Products". If you already had installed SharePoint on your server, you still start the same wizard to configure it. Otherwise, you still can use TFS without SharePoint.
Then, install SharePoint Foundation 2010.