Rules to Better TFS 2015 Migration
Since 1990, SSW has supported the developer community by publishing all our best practices and rules for everyone to see.
If you still need help, visit Application Lifecycle Management and book in a consultant.
Migrating from TFS 2013 Update 4 to TFS 2015.
Upgrading Team Foundation Server can be a daunting task. Be assured that things have become easier and if you follow this guide, it will minimize your downtime.
In this page we will look at performing an in-place upgrade from TFS 2013 Update 4 to TFS 2015. In this walkthrough, we assume you are currently using a single server configuration, but might want to separate your SQL Server from your TFS server. We also assume you have a DNS entry setup for external access at tfs.northwind.com.
Before starting your upgrade, you should back up all your TFS databases.
It's important that you backup TFS by using one of the supported methods, to ensure that you can reliably restore your data if needed.
Tip: The Team Foundation Server Team Foundation Server 2012 Update 2 and above has a built in Scheduled Backup tool which helps you to easily backup all TFS Databases. For versions prior to TFS 2012 Update 2 you have to use Backups tool from the TFS Power Tools package.
In some cases you won't be able to use this tool e.g. with TFS 2012 Power Tools RTM. This version has a bug which causes a failure of Tfs_Configuration DB when you try to restore it.
In such case you will have to manually backup databases. Make sure all relevant databases have been backed up. This includes all those starting with "Tfs_"
Important: Manual backup requires additional user steps which involve creation of additional tables and stored procedures. These tables has to be created to keep TFS databases in sync.
Follow this instructions to properly backup your databases: Manually back up Team Foundation Server.
If you manually backup the TFS Databases make sure you add additional jobs that execute 1 minute before the backup kick off.
Make sure you back up the Reporting Services database if you'd like your reports to come across as well.
For Reporting Services make sure you have backed up the encryption key.
It is important that while you're upgrading, nobody can check in. Any check-ins after you backup your database will be lost.
To make sure that nobody can change anything during the upgrade, follow these steps.
a. Send out an email notifying everyone TFS will be unavailable for the upgrade periodFollow Rules to better Networks
b. Make sure nobody can check in files:
c. Open the TFS Administration Console on the server.
d. Navigate to Application Tier / Team Project Collections.
e. For each Team Project Collection, select it, and click "Stop Collection". Enter a useful message (this will be displayed to users trying to connect from Visual Studio) and click "Stop":
Figure: Stop each Team Project Collection
Figure: All Team Project Collections are stopped
f. In Visual Studio, confirm you can no longer connect to TFS
Figure: Visual Studio shows the message that you entered when you stopped the Team Project Collection
After upgrading TFS, you should do a quick smoke test to ensure TFS is running as expected.
- Navigate to the web access URL for your new TFS server.
- If it loads correctly, click "Browse all..." to check all your Team Projects were migrated across correctly
In Visual Studio, connect to TFS, then:
- Do a Get Latest on a project or file
- Make a change, and ensure you can Check In
It is important to get another developer to check the migration for issues.
They should follow these steps:
- Start Visual Studio 2013
- Open Team Explorer and connect to the new TFS Server
- Confirm that they can:
- Source Code - Browse the projects and code using the Source Code Explorer
- Source Code Operations - Get Latest on a file, make a change and check in
- Source Code History - View the history of a number of files in different projects
- Work Items - Browse and view recent work items
- Open Visual Studio 2015 and repeat steps 1 to 3.
- Test that your builds complete successfully on the upgraded build controller(s) and agent(s).
- Check that they can create a new Team Project in Visual Studio 2015
Congratulations! You've completed a successful migration!
Always plan for a catastrophic disaster. This means backing up your environment, and making sure you have a working plan to recover from that backup should you need to.
If you are doing an in-place upgrade and need to roll back, we'd advise using the TFS upgrade wizard, or the TFS Administration Console to create a backup of your project collections. You can find instructions over on MSDN in the article Back up and restore TFS.
If you are running in a virtual environment, you can also use server snapshots to back up your TFS system. This is only a viable option if your TFS installation contains everything on a single server (including SQL), and you shut down the server before taking a snapshot. It is not sufficient to create a regular SQL database backup and snapshot the server!
Ideally, you should test your rollback plan to make sure that you can recover successfully. The easiest way to do this is to recover to an isolated virtual environment.
Once you have prepared your environment by creating backups, testing your rollback plan, and set your Project Collections to be offline, you're ready to run the setup process that will perform the upgrade.
Here we assume that you are performing an in-place upgrade. Below are the high level steps that you should follow:
a. Send an email to let everyone know the TFS server will be offline.
b. Ensure that your Project Collections are offline.
c. Run the setup tool from the TFS 2015 media (or ISO).
. Run through the wizard. It should remember most of your existing settings, so not much configuration is required.
d. Make sure you have access to coffee while it's upgrading your Project Collections- it could take a while!
Figure: Depending on the size of your collections, the Project Collection upgrade process takes the longest out of all steps
Figure: Wait for the Project Collection upgrade to complete
Figure: TFS Upgrade wizard success!
Now you're almost done! That covers the core upgrade of your TFS server, your TFS configuration database, and Project Collections.
Next, you'll need to make sure that additional services like XAML Build Configuration and SharePoint integration are configured before testing.
After upgrading, some third-party tools will no longer work. Check for updates for these tools.
a. TeamCompanion TeamCompanion version 5.2 Update 1 officially supports up to Outlook 2013 and Team Explorer 2013.
b. Team Foundation SideKicks Team Foundation Sidekicks Version 5.0 officially supports TFS 2013.
There are two main ways to move from TFS 2013 Update 4 to TFS 2015:
Option 1: In-place migration (Recommended)
With an in-place migration, you essentially install TFS 2015 over the top of an existing TFS 2013 Update 4 installation. The benefits of this approach are that you don't need additional hardware, and don't need to change network settings like DNS addresses to change between environments.
Option 2: Migration to a new environment
Migrating to a new environment may be required if you need to move to new upgraded hardware, or if you are not confident with your rollback plan. The key benefit with migrating to a new environment is that you can quickly switch back to your original environment should anything go wrong during the upgrade.
With both options, you can also use the TfsPreUpgrade tool to reduce downtime. As per the article, the TfsPreUpgrade tool will:
- Enable compression for a small number of tables that were not compressed in 2013 but will be in 2015.
- Scan for and fix a very rare but well understood data corruption in TFS version control data.
- Create new tables and migrate existing data to them.
- Create triggers.
- Update stored procedures.
- Create indexes.
By using the TfsPreUpgrade tool, you can thereby reduce the downtime for the actual cut-over to the new version by ensuring that your databases are updated in advance.
More steps will be required to integrate your SharePoint site and set up your Build servers.
After a TFS upgrade, you'll need to make sure your other servers are still integrated properly.a. Check your Build servers. You'll need to upgrade the TFS installation on them and make sure they're set up correctly.
Check your SharePoint servers. You'll need to install the latest SharePoint Extensions and make sure you repair your SharePoint connections in the Configuration Manager of your TFS Server.
Figure: Repair your Sharepoint Connections
Running the DogFoodStats queries over the new TFS 2015 server is a good way to see if the upgrade was successful.
You should check the new values against the stats you recorded from your TFS 2013 Update 4 databases.
- a. On your TFS 2015 databases, run the DogFoodStats queries and save the results.
- b. Check that the numbers are the same or very close. Note any big differences.
Note: The numbers may not be identical due to schema changes.
Recent Users 31
Users with Assigned Work Items 144
Version Control Users 244
Total Work Items 20608
Areas and Iterations 1838
Work Item Versions 93300
Work Item Attachments 11332
Work Item Queries 12768
Compressed File Sizes 21230
Uncompressed File Sizes 39504
Merge History 846922
Pending Changes 947
Local Copies 4197428
CheckIn 164 Get 474 Shelve 63 Upload 115 VCDownloadHandler 949 GetWorkItem 491 QueryWorkitems 601 Update 240
**Figure: Example DogFoodStats after the upgrade**
To avoid headaches while upgrading the TFS database schemas, you should manually turn off database mirroring prior to running the Verify step of your configuration.
If database mirroring is enabled on your TFS database, an additional step is required to temporarily turn it off when upgrading the database schema. This may require additional permissions that are difficult to check in the Verify step. Verification may hang with no sign of what's happening until you delve into the SQL Server logs. It's safer (and avoids problems) if you manually turn it off before you start.
Whenever you upgrade software, it's a good idea to make sure that your system meets the requirements for the newer version. This is particularly important for server applications like Team Foundation Server.
If you're upgrading from TFS 2013 Update 4 to TFS 2015, there is a small difference in system requirements. Make sure that your system meets the Visual Studio Team Foundation Server 2015 RC system requirements:
Server Supported Operating Systems
- Windows Server 2008 R2 SP1
- Windows Server 2012
- Windows Server 2012 R2
- Windows Small Business Server 2011
Client Supported Operating Systems
- Windows 7 Service Pack 1
- Windows 8.1
- Windows 8
- Windows 10 Technical Preview
- 2.2 GHz or faster processor
- 1 GB or more RAM
- 8 GB or more of available hard disk space
The old TFS 2013 Update 4 requirements are available at the following location: Description of Visual Studio 2013 Update 4.
If you're upgrading TFS 2010 to 2012, we recommend that you assign sysadmin privileges to the user account that's doing the upgrade.
Some database upgrade steps involve ALTER DATABASE statements and other commands that can't be done by a normal user. If a step fails, you are likely to end up with a corrupted Configuration database (so you have to restore from backup).