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.

Hold on a second! How would you like to view this content?
Just the title! A brief blurb! Gimme everything!

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

  1. Do you backup your databases?

    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.

    tfs scheduled.jpg

    Figure: TFS Scheduled Backups Tool

    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.

    tfs backup.jpg

    Figure: TFS Backup tool failed to restore the Tfs_Configuration DB – known bug in TFS 2012 Power Tools RTM

    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_"


    backup all.jpg 

    Figure: Backup all relevant databases

    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  .


    add tbl.jpg 

    Figure: Add tbl_TfsTransactionLogMark table to every Tfs_* Database

    add spset.jpg

    Figure: Add sp_SetTransactionLogMark stored procedure to every Tfs_* Database

    If you manually backup the TFS Databases make sure you add additional jobs that execute 1 minute before the backup kick off.

    add additional.jpg

    Figure: Add additional jobs to SQL Server Agent

    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.

    backup reporting.jpg

    Figure: Backup Reporting Services encryption keys

  2. Do you disable connections?

    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 period
    Follow 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":

    stop each term.png

    Figure: Stop each Team Project Collection

     

    all team project.png

    Figure: All Team Project Collections are stopped


    f.               In Visual Studio, confirm you can no longer connect to TFS

    visual studio.png

    Figure: Visual Studio shows the message that you entered when you stopped the Team Project Collection

    Read more about Do you disable connections?
  3. Do you do a quick test after the upgrade finishes?

    After upgrading TFS, you should do a quick smoke test   to ensure TFS is running as expected.

    tfs title.png

    Figure: New TFS Title using our existing url

    a.      Navigate to the web access URL for your new TFS server.

    b.     If it loads correctly, click "Browse all..." to check all your Team Projects were migrated across correctly

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

  4. Do you get a developer to test the migration?

    It is important to get another developer to check the migration for issues.

    They should follow these steps:

    a.      Start Visual Studio 2013

    b.     Open Team Explorer and connect to the new TFS Server

    c.      Confirm that they can:

     .                Source Code - Browse the projects and code using the Source Code Explorer

    a.               Source Code Operations - Get Latest on a file, make a change and check in

    b.              Source Code History - View the history of a number of files in different projects

    c.               Work Items - Browse and view recent work items

    d.     Open Visual Studio 2015 and repeat steps 1 to 3.

    e.      Test that your builds complete successfully on the upgraded build controller(s) and agent(s).

    f.       Check that they can create a new Team Project in Visual Studio 2015

    Congratulations! You've completed a successful migration!

  5. Do you have a rollback plan?

    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.

  6. Do you know how to upgrade your TFS2013 Update 4 system? (the big one)

    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!


    depending size.png

    Figure: Depending on the size of your collections, the Project Collection upgrade process takes the longest out of all steps

     

    coffee.png

    Figure: Wait for the Project Collection upgrade to complete

     

    success.png

    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.

  7. Do you know to upgrade your third party tools

    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.

  8. Do you know your migration choices?

    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.

     

    Reducing downtime

    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.

  9. Do you plan your additional steps?

    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.

    sharepoint.png

    Figure: Repair your Sharepoint Connections

  10. Do you run Dog Food Stats (After)?

    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

     

    Checkins

    53302

     

    Shelvesets

    386

     

    Merge History

    846922

     

    Pending Changes

    947

     

    Workspaces

    259

     

    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

  11. Do you run your dog food stats (before)?

    Run the excellent DogFoodStats queries:

    o   For TFS 2010 - from Grant Holliday - http://blogs.msdn.com/b/granth/archive/2009/10/23/tfs2010-sql-queries-for-tfs-statistics.aspx   .

    o   For TFS 2012 – update from Erin Dormier -http://blogs.msdn.com/b/visualstudioalm/archive/2013/08/20/tfs-internal-usage-statistics-1st-half-cy-2013.aspx#comments 


    While the above scripts are intended for older versions of TFS, many of the SELECT statements also work with TFS 2013 Update 4.

     

    The above scripts give you some great information about the details of our collections you can use for comparison afterwards.

    Make sure you record these statistics so you can compare them after the upgrade.

    Recent Users

    ------------

    33

     

    Users with Assigned Work Items

    ------------------------------

    145

    Warning: Null value is eliminated by an aggregate or other SET operation.

     

    Version Control Users

    ---------------------

    244

     

    Total Work Items

    ----------------

    20608

     

    Areas and Iterations

    --------------------

    1838

     

    Work Item Versions

    ------------------

    93298

     

    Work Item Attachments

    ---------------------

    11331

     

    Work Item Queries

    -----------------

    12768

     

    Files

    -----------

    694604

     

    Compressed File Sizes

    ---------------------

    18042

     

    Uncompressed File Sizes

    -----------------------

    36315

     

    Checkins

    -----------

    53297

     

    Shelvesets

    -----------

    381

     

    Merge History

    --------------------

    846922

     

    Pending Changes

    ---------------

    906

     

    Workspaces

    -----------

    259

     

    Local Copies

    --------------------

    4197458

     

    Command Execution Count

    ------------------------

    Checkin               27

    Get                   578

    Shelve                96

    Upload                162

    VCDownloadHandler     1403

    GetWorkItem           558

    QueryWorkitems        830

    Update                272

    Figure: Example result of DogFoodStats on our TFS 2010 instance

  12. Do you turn off Database Mirroring before Upgrading your TFS databases?

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

  13. Do you verify that your server meets the minimum requirements?

    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

    Hardware Requirements

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

  14. Does your user account have SQL Server System Administrator privileges in SQL Server?

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