Servers in different domains

Mar 9, 2009 at 6:51 PM
I need to migrate data between 2 servers that are in different domains.  I tried creating a local account named tfsmigration on each server and on the PC that is running the tool.  I added this account to the administrators group on all 3 boxes and the [SERVER]\Service Accounts and [SERVER][Team Foundation Administrators] group on both servers.  Team explorer is able to log in to both servers with this name.  I run the migration tool and set up a new session with no issues.  When I try to run it I get an error saying TfsMigrationWindowsServiceHost is not run by an account in the Windows Adminitstrators group.  Your session will be pending until you grant the server owner with the requisite permission.  The account is an admin on all 3 boxes.  Any idea why this doesn't work?


Mar 9, 2009 at 8:08 PM
OK, I found the code that returns that error and figured out how to get it to accept a local account.  Now I can start the session, but it just seems to run forever without doing anything.  All I see in the log is this.

Before call: 3/9/2009 2:52:08 PM
After call: 3/9/2009 2:52:08 PM
Before call: 3/9/2009 2:52:11 PM
After call: 3/9/2009 2:52:11 PM
Before call: 3/9/2009 2:52:14 PM
After call: 3/9/2009 2:52:14 PM
Before call: 3/9/2009 2:52:17 PM
After call: 3/9/2009 2:52:17 PM

Any ideas?
Mar 9, 2009 at 8:49 PM
Can you check the trace logs and see if there is any related information?

'Suppose you install the migration tools to the default location. Under folder 
'%ProgramFiles%\Microsoft Team Foundation Server Migration Tools\TFS to TFS Migration Tool', you will see two configuration files. 
TfsMigrationWindowsServiceHost.exe.config and TfsToTfsMigrationToolUI.exe.config.
The trace log file paths are specified in these 2 config files. By default, they are 
'%ProgramFiles%\Microsoft Team Foundation Server Migration Tools\TFS to TFS Migration Tool\TfsToTfsMigrationTool-trace.txt'
and 'C:\temp\TfsToTfsMigrationTool-trace.txt'

Mar 10, 2009 at 7:42 PM

Hi Pei,

There were a few different issues here.  I think I've solved some of them but could use some help.

In order to fix the admin group issue, I had to change the source code.  I added this to IsUserInAdminGroup in ServiceOwnerValidator.cs.


// The name returned by GetAdminGroupUsers is a little different when the service

// is running as a local Windows accout.

// TODO: The domain name should be looked up, not hard coded.

string domainName = @"OFFICE/";

string userPath2 = CPATHTOCOMPUTER + domainName + username.Replace(@"\", "/");

if (member.Path.Equals(userPath2, StringComparison.OrdinalIgnoreCase))


return true;


I was trying to run TfsToTfsMigrationToolUI from Visual Studio.  The app.config file in the solution I am running for the UI tells it to put the log file at C:\temp\TfsToTfsMigrationTool-trace.txt.  This is the file that has the output above.  The app.config (and .exe.config) is basically the same as the one in the folder where the tool got installed except for this path and WorkspaceRootDefaultFolder.  When I try to run from VS, even without the code change, I get the behavior I described earlier.  It seems to hang and never connects to the Windows service.

I copied my compiled TfsToTfsMigrationToolUI.exe and TfsToTfsMigrationToolUI.exe.config to the install folder (C:\Program Files\Microsoft Team Foundation Server Migration Tools\TFS to TFS Migration Tool) and ran the app from there and it ran and converted some workitems. (Woot!)  I suspect that something is different in the .xml files it uses and that caused the problem when I tried to run from VS.

Two other issues came up during this run.

1. I found this in the log for the UI tool

TFS::Authenticate : Caught exception : Microsoft.TeamFoundation.TeamFoundationServerUnauthorizedException: TF30063: You are not authorized to access tfsrtm08.
   at Microsoft.TeamFoundation.Client.TeamFoundationSoapProxy.ThrowIfUnauthorized(HttpWebResponse response)
   at Microsoft.TeamFoundation.Client.TeamFoundationSoapProxy.GetWebResponse(WebRequest request)
   at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)
   at Microsoft.TeamFoundation.Client.CheckAuthenticationProxy.CheckAuthentication()
   at Microsoft.TeamFoundation.Client.TeamFoundationServer.Authenticate(Boolean useProvider, ICredentialsProvider provider)

This happens when I connect to the source server in the UI Tool.  This is the server that is in another domain.  I am using stored credentials to connect to the source TFS server.  I'm pretty sure I was using different credentials the first time I tried this and I don't see any way to change them.  Is there a way to clear these?  

Even though this fails the list of projects gets populated and I am able to continue.

2.  I started the session and it converted a lot of data, but then it just hung.  I stopped the session and tried to stop the service but it would not stop.  I ended up having to reboot to get the service to stop.  The log files looked good, but I did find some errors in the application event log.  (see below)

I repeated the test with a different target and though the session never completed I was able to stop it, close the UI and stop the service.  This was in the app event log 9 times.

Message: An error occurred trying to store an event to the database.
 Call Stack: Column 'SessionInstanceID' does not allow nulls.    at System.Data.DataColumn.CheckNullable(DataRow row)
   at System.Data.DataColumn.CheckColumnConstraint(DataRow row, DataRowAction action)
   at System.Data.DataTable.RaiseRowChanging(DataRowChangeEventArgs args, DataRow eRow, DataRowAction eAction, Boolean fireEvent)
   at System.Data.DataTable.SetNewRecordWorker(DataRow row, Int32 proposedRecord, DataRowAction action, Boolean isInMerge, Int32 position, Boolean fireEvent, Exception& deferredException)
   at System.Data.DataTable.InsertRow(DataRow row, Int32 proposedID, Int32 pos, Boolean fireEvent)
   at System.Data.DataRowCollection.Add(DataRow row)
   at Microsoft.Vsts.Ranger.Migration.TfsToTfs.Service.Data.EventData.StoreEventRow(EventsRow row)
   at Microsoft.Vsts.Ranger.Migration.TfsToTfs.Service.Business.SessionEventManager.LogEvent(MigrationEvents migrationEventType, MigrationEventArgs e)

Anhy idea what could cause this?

Thanks for your help,


Mar 10, 2009 at 8:03 PM
I'll review your code changes later. Regarding your 2 observations:
1. Stored credential is not currently support. It is the limitation for the current release 'Credentials must match on both the source and target server'.
2. This is a know issue and will be resolved. However, this is for logging only. It shouldn't block your migration. I suspect there's other errors in your trace logs. Can you verify that?

Mar 10, 2009 at 8:19 PM
The user I am running as does not have access to the source TFS server (its in an untrused domain).  If I type in the server name and click Connect I get error TF30063 connecting to the server.  This is what I expect.  If I check Use Stored Credentials it looks like it works, although I get the message in the log.  When I first ran this I used an account in the server's domain, not the local account that exists on both servers and my laptop.  NBD, but something is different when the box is checked.

I don't see anything in the log files that looks like an error.  A quick check makes it appear that all of the workitems did get converted.  I'll look closer and let you know.