Welcome to MSDN Blogs Sign in | Join | Help

Creating a new server from an old one: Beware of the InstanceId

Grant Holliday wrote a post called, TFS InstanceId, ServerMap.xml and havoc.  In it he describes his experience with backing up a production server and restoring it to a test environment.  The problem he ran into is that every server has a unique ID called an InstanceId, which is just a GUID.  That GUID is the real name of a server, as all other names can change for any number of reasons, from renaming a server to internet vs. intranet access.

Grant references the MSDN forum post where Keith Hill ran into the same issue.  By far, the common case is restoring the same server, perhaps after a hardware failure.  In that case, you absolutely don't want to change the InstanceId.

However, if you want a copy of your server to experiment with or you're trying to split a server by cloning it and deleting what you don't want (Keith's scenario), the situation is a little different.  We've done this a number of times internally where we take a backup the dogfood server and restore it to a pre-production test machine.  In such a case, we'd change the InstanceId in the pre-production test machine so that there's no confusion with the real server (it's important that the ID in the test server be changed -- not the other way around :-).

Unfortunately, I don't believe that we have released a tool that will change the InstanceId.  I've sent email to a few folks to make sure I'm not simply forgetting something.  I'll post a follow up if there's anything available to change it, as that's what's needed when "splitting" a server.

For now, the best approach for creating a test server is to make sure that the machines that access the test server aren't also used to access the real server.  If in testing you need to switch between the two, you'll need to delete the cache directory, as Grant noted.  To do that, delete the directory %userprofile%\Local Settings\Application Data\Microsoft\Team Foundation\1.0\Cache (%userprofile% is typically c:\Documents and Settings\<your login>\).  That will delete the ServerMap.xml file, which caches server name and InstanceId pairs, the work item tracking cache that's partitioned by InstanceId, and the version control cache file VersionControl.config that contains a list of workspaces per server InstanceId.

[UPDATE 10/18/2006]  The forum thread that James Manning references below shows how to change the InstanceId using the instanceinfo.exe tool.  Here are Dan Kershaw's instructions from that thread.

It's really important to make sure that you change the InstanceId in the correct data tier, such as the test server or the new separate server created by restoring the databases mentioned above.  You do not want to change the InstanceId when just restoring a production server that folks are using (if you do, you'll have to go clear every user's local cache directory).

I double checked with one of our devs and there is a way to "restamp" the cloned machine using a shipping command-line tool called InstanceInfo.exe (which can be found under the TFS install directory in the Tools folder on the Application Tier machine - along with the other server command line tools, like TFsAdminUtil).  You should restamp the server after following the other "move" steps.

After making this change it should be safe to connect a client to both the original server and the cloned server.  Here are the instructions (please replace the variables with your own settings).

Rem Clear the instance info

“%TFSInstallDir%\Tools\InstanceInfo.exe" stamp /setup /install /rollback /d TFSWorkItemTracking,TFSBuild,TFSVersionControl,TFSIntegration,TfsWarehouse /s <<your new data tier>> 

Rem Re-stamp it with a new instance id

"% TFSInstallDir %\Tools\InstanceInfo.exe" stamp /d TFSWorkItemTracking,TFSBuild,TFSVersionControl,TFSIntegration,TfsWarehouse /s <<your new data tier>>

[UPDATE 1/21/09]  I've added the warehouse DB to the list.  Thanks for the comment, Wendell!

[UPDATE 2/8/2009]  If you have used build prior to creating a clone of the server, watch out for the TF214007: No build was found with the URI problem Mac Noland ran into.

tags: ,

Published Tuesday, October 17, 2006 9:14 PM by buckh

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

# re: Creating a new server from an old one: Beware of the InstanceId

If InstanceID of the server is the same as the called SID, then you can use Sysinternal's tool NewSID. Also very useful for making copies of a virtual server.

Wednesday, October 18, 2006 3:39 AM by Thys

# re: Creating a new server from an old one: Beware of the InstanceId

There should already be tool to change the guid called InstanceInfo.exe - Dan Kershaw already mentioned it in a forum thread.

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=698261&SiteID=1

Here's the relevant bit:

I double checked with one of our devs and there is a way to "restamp" the cloned machine using a shipping command-line tool called InstanceInfo.exe (which can be found under the TFS install directory in the Tools folder on the Application Tier machine - along with the other server command line tools, like TFsAdminUtil).  You should restamp the server after following the other "move" steps.

Wednesday, October 18, 2006 5:07 AM by James Manning

# re: Creating a new server from an old one: Beware of the InstanceId

Thys, the InstanceId is a GUID stored in the database, so it's independent of the Windows SID.

Buck

Wednesday, October 18, 2006 8:26 AM by buckh

# re: Creating a new server from an old one: Beware of the InstanceId

James, thanks for pointing that out.  I couldn't find anything last night.

Buck

Wednesday, October 18, 2006 8:27 AM by buckh

# VSTS Links - 10/18/2006

Etienne Tremblay on Team Build the ins and outs and TFS Install Scripts V2. Sanjeev Garg on So I am...

Wednesday, October 18, 2006 9:21 AM by Team System News

# Respaldo de Team Foundation Server hacia otro Servidor ...

Aunque en MSDN hay un artículo que explica el proceso de restauración de un TFS, un punto en tomar en...

Wednesday, October 18, 2006 3:15 PM by B³: Beto Borbolla Blog

# Team System Chat - December 5, 2007

DavidKean_MS (Moderator): The Visual Studio Team System chat will begin in 15 minutes. DavidKean_MS...

Wednesday, December 05, 2007 2:04 PM by Team System News

# Visual studio gets confused between TFS servers

I&#39;ve been trying to figure out some issue: I choose TFS server (connect TFS server from VSTS), I

Wednesday, June 04, 2008 11:38 AM by SRLTeam

# re: Creating a new server from an old one: Beware of the InstanceId

The TFS_Instance GUID is also an extended property of the TfsWarehouse database in TFS 2008.  Make sure this value is also updated when you "clone" your server.  You can add TfsWarehouse to the comma delimited list of databases you are running the utility against.

Wednesday, January 21, 2009 8:49 PM by Wendell with MSFT TFS Support

# re: Creating a new server from an old one: Beware of the InstanceId

Wendell, I've updated the post.  Thanks!

Buck

Wednesday, January 21, 2009 9:05 PM by buckh

# restoring App Tier

I was hoping someone could help. We had our TFS AT on a virtual server that got deleted! I recreated another virtual server with the same name and IP. When trying to re-install the AT I get this message:An existing Team Foundation database was found, but it cannot be upgraded. Installation cannot continue.

It seems to think I am trying to perform an upgrade even though I am just re-installing the same TFS2008 again.

Any ideas ?

Saturday, April 11, 2009 7:42 PM by randy kibbe

# re: Creating a new server from an old one: Beware of the InstanceId

Randy, I would suggest using the integrated installation of TFS 2008 SP1.  If you had applied SP1 before, you would need to do this to install it and use the existing databases.

http://blogs.msdn.com/aabdou/archive/2008/05/13/team-foundation-server-sp1-beta-now-available.aspx

http://www.woodwardweb.com/vsts/creating_a_tfs.html

Buck

Monday, April 13, 2009 10:58 PM by buckh

Leave a Comment

(required) 
required 
(required) 
 
Page view tracker