3
votes

I wish to upgrade my current TFS 2015.3 instance to 2017. It's not going to be quite as easy as advertised, however, due to some complicating factors. My scenario appears to be undocumented.

  1. I'll be installing a new domain controller (moving from Server Essentials 2012 R2 to Server Essentials 2016).
  2. The current OS is Server 2012 R2; I will be upgrading this as well, to Server 2016 (a clean install to a new VM).
  3. Both of these new VMs must retain the same NETBIOS names as before.
  4. The current SQL Server instance is 2014; I will be upgrading this as well, to SQL Server 2016.
  5. The SQL Server instance for the current TFS instance is on a separate VM. I would like to consolidate this and put everything on a single VM. (I'm a solo developer putting a very light load on my server and I want to shed the extra complexity and overhead.)

Is it merely a matter of installing TFS 2017 and restoring from a 2015.3-generated backup? Will 2017 automatically apply any schema changes etc. during the restore process? Could it be that simple?

The closest question I could find to this is here, but unfortunately it doesn't quite address my situation.

2

2 Answers

7
votes

Instead of doing a detach/attach upgrade there is another option available to you. detach/attach upgrades have had issues in the past and though most of these issues have been fixed, it's considered a suboptimal solution.

Instead, perform an Upgrade Installation.

Take a full backup of all your TFS 2015u3 databases and restore them to the new SQL server instance. You can create the full backup using the Team Foundation Server Admin Console, or use SQL Server Management Studio after stopping all TFS services on each Application Tier (in your case there is probably only one) using

TFSServiceControl quiesce

Now install TFS 2017 and perform the "upgrade" installation and point it to your existing databases. It will ask you if you want to upgrade them and whether you have a valid backup.

And after some time (upgrades can take a while, as data is moved around the databases), your TFS server will come back online. The installation wizard usually does all the mapping work required.

There is one big caveat, and that has to do with domain changes. If you are installing in the same Windows Active Directory domain, you're good. But if your server is running in Workgroup mode you may want to remap all the identities in your TFS database prior to running the upgrade step. So install TFS, but do not configure yet. Run the following command

TFSConfig Identities /change /fromdomain:Domain1 /todomain:Domain2

Then use the upgrade option to have TFS use your database backups. The full explanation on doing a cross domain server migration is documented on MSDN. Be sure to safeguard your pre-upgrade backup until you've verified a successful upgrade.

1
votes

We face almost the same thing, as our server was created for TFS 2013 and therefore has SQL 2012 installed.

Yes, it actually is as easy as your question states. When you attach the collection that you restored form the backup all the schema changes will be applied. Before then you configure the app tier of TFS and skip

An important thing though is to detach the collection before doing the backup. This copies various configuration into the collection database so that it is self-contained and can be moved to another server. You then only move the collection database to the new server.

Here is how in list form:

  1. Detach collection using TFS Admin Console
  2. Backup collection database using SSMS, e.g. Tfs_YourCollection
  3. Restore collection database on new server using SSMS
  4. Install TFS
  5. Configure app tier, skip creation of new DefaultCollection
  6. Attach collection in the TFS Admin Console, might take some time depending on your collection size.

You can do 4+5 before 3.

Note: Changing domain can add complexity. SharePoint and Reporting sites are not migrated!