Migrating TFS 2010 to TFS 2012

I just migrated my company's Team Foundation Server (TFS) from 2010 to 2012 yesterday. Although I felt that the exercise was no simple feat, I think the product has improved a lot since the previous versions. Like all migration exercises, I would encourage you to plan well and always read the documentation.

The environment which I have migrated is a TFS 2010 SP1 running with SharePoint Foundation 2010 SP1 on a SQL Server 2008 R2 SP1 and Windows Server 2008 R2 SP1. My new environment was a TFS 2012 with SharePoint Foundation 2010 SP1 on a SQL Server 2012 SP1 and Windows Server 2008 R2 SP1. Both environments are single server configurations on the same Active Directory domain.

The reason I did not use Windows Server 2012 and SharePoint 2013 on the new environment was because SharePoint 2013 was not RTM at the time my Infra department provisioned the server and SharePoint 2010 cannot run on Windows Server 2012.

I will share with you some of the experiences that I had encountered while following the instructions provided on MSDN. I'm not going to detail the steps to perform the migration since the documentation has done a pretty good job in listing them. I would encourage you to read it thoroughly (don't skip any lines!) to avoid any missing steps and saving you time in redo-ing everything again.

Tip #1 Team Foundation Server 2012 with Update 1

The first thing to know before you begin is that there is a TFS 2012 Update 1. This is not a service pack that you can just click to apply but an entire updated TFS 2012 package. You can download it from your MSDN Subscriber downloads. Remember not to accidentally download the trial version from the Visual Studio 2012 public site. On MSDN Subscriber Downloads, look for Visual Studio Team Foundation Server 2012 with Update 1.

If you missed the above step (like me), you will need to schedule an extra step to Upgrade the TFS 2012 later.

Tip #2 Installing and Configuring SQL Server 2012

Install your Windows Server and SQL Server. Make sure your SQL Server 2012 collation is set correctly! For some odd reasons, my default SQL Server 2012 collation is not set to SQL_Latin1_General_CP1_CI_AS. Also please grant the appropriate rights to the TFS-Service account in the database and analysis service. To play it safe, I used 1 service account for all the services (that allows configurable accounts).

Tip #3 Installing TFS and SharePoint 2010

You can proceed to install TFS but when it is done, DO NOT configure it. Instead, go to Configure Extensions for SharePoint Products. There should be a big button that says Install SharePoint Foundation if you pass the verification checks.

Should the verification checks fail for some reason and you are required to exit from the TFS Configuration Center. You can relaunch it later by running the TFS Administration Console or (TFSMgmt.exe) and selecting Extensions for SharePoint Products and then click Configure Installed Features.

Follow the instructions here and you should have a fully configured SharePoint Foundation 2010 with a default Web Application and Site Collection created. Remember to add the TFS-Service account into the Farm Administrator Group and also Detach the WSS_Content database. (All are explained in the link).

Once again, DO NOT configure your TFS 2012!

Tip #4 Backing up TFS 2010 databases

If you followed the MSDN instructions, you should be ready to perform a backup on your TFS 2010 database now. Just in case you used a different service account for your TFS 2012, you will need to grant it access on the TFS 2010 database server.

At this point you may want to down the access to your TFS 2010 to prevent any more changes to the TFS data. You can do so by shutting the IIS on the TFS 2010 server. (The Developers and Testers should be screaming by now if you did not inform them). Just shut-down the IIS, NOT the server!

Run the TFSBackup.exe (in C:\Program Files\Microsoft Team Foundation Server 11.0\Tools) to start backing up your databases. In case you are loss, the instructions are here. Please ensure that the ReportServer databases and WSS_Content database are marked for backup from the TFS 2010. Please ensure that the path to store the backups is a network path i.e. \\SomeServer\Backups

Remember to also backup your Reporting Services Encryption Key! Place it on a network share where your TFS 2012 can access it.

Tip #5 Restoring TFS 2010 databases

Run the TFSRestore.exe (in C:\Program Files\Microsoft Team Foundation Server 11.0\Tools) to restore the databases. Make sure you are restoring to your new SQL Server! Please ensure the Report Server databases and WSS_Content are selected for restoration. Please double make sure everything before you click on the "Overwrite the existing Databases" checkbox!

After it is done, both your Report Server and SharePoint will be in a coma. You will need to fix them up as stated in the instructions. Restore your Reporting Services encryption key. When fixing your Scale-out Deployment, you may encounter an error that prevents you from removing the old TFS 2010 report server.

An alternative is to fire-up a command prompt in Administrator mode and type RSKeyMgmt -r [id of the report server]. The id can be obtained from the error message when you try to remove it from the Reporting Services Configuration Manager.

Check to see whether you can access your Report Server URL from your browser. If you are getting an error about not having permission to view the Report Server site, please launch Internet Explorer in Administrator mode to try again.

Use the stsadm command line to fix up your SharePoint Foundation as stated in the instructions. Provide the correct site and service account i.e. TFS-Service.

Tip #6 Upgrade to TFS 2012

You are now all set to perform the upgrade! In case you are loss, the instructions are here. Remember! If you somehow closed the Configuration Center, you can launch it again from TFS Administration Console and click Configure Installed Features. Please don't go and reinstall everything again! (I had to stressed on this because that's what my Associate did!)

There will be a point in the Upgrade wizard where you really don't know which option to choose for SharePoint. It is like telling you, "this also can, that also can". When that page comes, choose Use an existing server farm for SharePoint. Make sure the URLs are pointing to the new SharePoint Foundation that you have setup earlier for your TFS 2012. Test all your URLs and make sure there is a green tick.

When everything is verified, proceed to the grand finale and perform the upgrade. Depending on your server specifications and number of Team Project Collections, it will take some time. Each Project Collection takes about 305 steps. This is the time when you go make coffee, surf facebook and most importantly... PRAY! Pray that you don't see any red circles on the statuses!

Take note that if you have more than one Team Project Collection to migrate, they will all run in parallel. Up to some point, the wizard will seemingly show you that all Team Project Collections have been successfully migrated and the Close is button is enabled. Do not Close it! Scroll to the bottom to make sure that there are no Team Project Collections that are still in the progress of migration.

When the migration completes, you should see a Complete status screen instead.

Tip #7 Testing the Result and Reprocessing the Warehouse

If you thought that everything will be done when the Upgrade wizard ends, well, that's not the case. Remember to perform the last steps in the instructions to remap the URLs!

At this point since the instructions ended, you may assume it is now safe to test the migration. Fire-up Visual Studio 2012 and connect to the TFS 2012. Everything should work fine except for your reports. You will see all your reporting web-parts giving errors on your SharePoint sites.

This is because your TFS Warehouse has not been processed on SSAS. Before you start to go into SQL Server Management Studio to process the Cube, take note that you will get gazillion errors if you do that. The right way is to do it is to use the TFS WarehouseControlWebService. Follow the instructions here to repopulate and reprocess your cubes.

Tip #8 Upgrading The Projects

You will realized that some cool new features i.e. Code Review, are not enabled on your migrated projects. You will need to manually enable them. You can do that from the instructions in the new VS 2012 Team Explorer or simply by visiting the Project's site (TF Web Access). It will also update their process templates to v6.0.

So there you have it! Hope you have a fun time migrating :p You may want to try it on a Virtualize Environment first if you are unsure.

No comments:

Post a Comment

Popular Post