SSW Foursquare

Rules to Better TFS 2012 Migration - 5 Rules

Update: TFS 2012 has been replaced by TFS 2015 - if you're moving to TFS 2015, see our Rules to Better TFS 2015 Migration.

In this page we will look at upgrading an existing TFS 2010 server to a new TFS 2012 server. 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.

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.

If you still need help, visit Application Lifecycle Management and book in a consultant.

  1. Do you get a new TFS 2012 Server ready?

    1. Prepare a new image. We recommend running Windows 2008 R2 Server x64using Hyper-V Manager. Your options are:

      1. Manually build a server
      2. Use a syspreped image (this will be quicker)
      3. System Center Virtual Machine Manager (recommended, quickest)
    2. Add the roles

      1. Application Server
      2. IIS
    3. Install SQL Server 2012 components for reporting and analysis (on the TFS server)

      1. Install (but don't configure) SQL Server 2012 Reporting Services
      2. Install (but don't configure) SQL Server 2012 Analysis Services
    4. You'll also need a SQL Server instance for the TFS databases if you don't already have one

      1. Install SQL Server 2012 x64 default configuration
  2. Do you know how to upgrade your TFS 2010 databases? (the big one)

    We recommend doing a move to a new environment because it has a much easier rollback path if something goes wrong.

    Note that these steps will also work for upgrading from TFS 2012 RC to RTM, or RTM to Update 1.

    These are the steps to migrate and upgrade to a new environment:

    1. Send an email to let everyone know the server will be offline
    2. Take the TFS 2010 server offline
    3. Copy the TFS 2010 database backups to the TFS server or the new SQL Server instance. Make sure the URL is accessible from the TFS server via a network share.
    4. Install Team Foundation Server 2012 or TFS 2012 Update 1 (see Damian Brady's experiences).
    5. Make sure you have access to coffee while it's installing - it could take a while! ssw coffee
    6. After the install has completed, the Team Foundation Server Configuration Center will start
    7. Select Upgrade | Start Wizard tfs upgrade existing
    8. Launch the Database Restore tool by clicking on the link
    9. If necessary, change the Target SQL Server Instance and click Connect
    10. In the Restore Database screen, Browse, then navigate to the folder with your database backups. Make sure all of them are ticked, then click Restore. tfs restore dbs
    11. Click Close, then click Next in the Upgrade Wizard
    12. Choose the configuration database by specifying the SQL Server Instance and clicking List Available Databases
    13. Check "By checking this box, I confirm that I have a current backup.", then click Next tfs config db
    14. Leave Network Service as the service account for the Application Tier, then click Next
    15. Check the checkbox to confirm we want to configure Reporting Services, then click Next
    16. Make sure the Reporting Services instance and URLs are correct, then click Next tfs config reporting
    17. Update the SQL Server Instance for our Warehouse Database, and click Test to test the connection
    18. Click List Available Databases and check the Tfs_Warehouse database is shown, then click Next tfs warehouse
    19. Click Next on the Analysis Services page
    20. Provide details of the TFSService account your reports will run as then click Next tfs reports run as
    21. Check the checkbox to say we want to configure SharePoint, then click Next
    22. Choose "Use current SharePoint settings", then click Next tfs sharepoint
    23. Confirm the details on the Summary page and click Verify tfs summary Note: At this point, you may be asked to reboot and start the wizard again. Don't despair - it's quicker the second time!
    24. Once you have all green ticks, click Configure tfs final configure
    25. Have a coffee ssw coffee
    26. Click Next tfs upgrade complete
    27. Click Close, then Close again.
    28. Change the DNS entries for your TFS server to point to the new TFS 2012 server tfs dns Note: It's a good idea to get the SysAdmins involved at this stage
  3. Do you backup your databases for TFS 2012 migration?

    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
    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
    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
    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
    Figure: Add tbl_TfsTransactionLogMark table to every Tfs_* Database

    add spset
    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
    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
    Figure: Backup Reporting Services encryption keys

  4. Do you plan your additional steps for TFS 2012 migration?

    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.

    1. Check your Build servers. You'll need to upgrade the TFS installation on them and make sure they're set up correctly.
    2. 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 repair

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

    If you’re upgrading TFS 2010 to 2012, it’s highly recommended 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).

We open source. Powered by GitHub