TFS Upgrade from 2013 to TFS 2017 without detachin

2019-08-09 02:35发布

问题:

We already use TFS 2013 for a long time and it has a very big collection and so many team projects. Now I am trying to set up a TFS 2017 POC on a new server. I have taken the backup of the existing TFS 2013 databases such as the Collection,Configuration,Reporting and restored them on the new TFS 2017 db server.

I tried attaching this 2013 collection with the TFS 2017 , but it gives me the following error.

"No attachable databases were found on the following instance of SQL Server. Verify that both the name of the server and the name of the instance are correct and that the database was properly detached using the detach command in the Team Foundation Server Admin Console"

Is there a way I can backup and restore the db without detaching the db from the main TFS 2013 and attach it to TFS 2017 ??

Thanks in advance!

回答1:

It is not possible to attach a TFS collection that was not detached. And it's not suggest to do a detach-attach upgrade. The normally walkthrough of upgrade is as below:

  1. Take the production server offline using TFSServiceControl's quiesce command. The goal here is to ensure that the backups we use to move to our new hardware are complete and we don't lose any user data.
  2. Take new backups of each database.
  3. Copy the backups to our new SQL instance.
  4. Install TFS 2017 on our new application tier.
  5. Use the scheduled backups wizard to restore the database backups.
  6. Run through the upgrade wizard, using our desired production service account.
  7. Optionally configure new features which require changes to our existing team projects.

More details please refer this tutorial: Upgrade walkthrough


Since you have mentioned you are working on a very big collection. Another way is using TfsPreUpgrade.exe tool , which works by creating new copies of the tables most impacted by the schema changes present in TFS 2017 and then migrating data from the original tables to the new copies.

With this tool you could upgrade to TFS 2017 while your TFS 2013 deployment is still online. However there are also some requirements and limitations for using this tool.

About the requirements and detail steps to perform the upgrade, please took a look at official tutorials in MSDN: Use TfsPreUpgrade to reduce downtime