Subversion to TFS 2010: The migration engine is unable to resolve a conflict where two changes have the same target item
Join the DZone community and get the full member experience.Join For Free
running into problems when migrating a subversion repository to team foundation server is what to so with conflicts resulting from svn being case sensitive and tfs not.
note: case sensitivity is mostly a bad idea for files, url’s and code.
on of the problems with subversion is that it treats “/trunk/a.txt” and “/trunk/a.txt” as two different files. this can cause conflicts during the migration that need to be resolved.
for the smaller sets that i migrated to test this tool it worked just fine, but the larger the data set, the more likely you are to encounter errors. the first set was 1700+ changes, but this one is 24000+ which mean that it is more than 10 times more likely to encounter a conflict.
dam, but conflicts suck. this particular conflict is due to two changes from subversion are being applied to the same file in a single changes. we need to be able to resolve this as you will not be able to make changes to what is migrated and then rerun that portion.
logicaloperationstack=migrate, main datetime=2011-08-26t16:21:57.8098771z [8, 4532, 8/26/2011 9:21:57 am, migrate] stopping (overall: 00:00:01.1687929) migrationconsole.exe warning: 0 : the migration engine is unable to resolve a conflict where two changes have the same target item: logicaloperationstack=main datetime=2011-08-26t16:21:57.8108537z migrationconsole.exe information: 0 : microsoft.teamfoundation.migration.toolkit.unresolvableconflictexception: the migration engine is unable to resolve a conflict where two changes have the same target item: at microsoft.teamfoundation.migration.toolkit.changeoptimizer.detectconflicts() at microsoft.teamfoundation.migration.toolkit.changeoptimizer.resolve() at microsoft.teamfoundation.migration.toolkit.batchingcontext.flush() at microsoft.teamfoundation.migration.toolkit.vc.sourcetotfsmigrationengine.flush(batchingcontext context) at rledq7v0ex0lxcb8ef.3rbgrnxcby0g0kr3z1.flush(batchingcontext context) at microsoft.teamfoundation.migration.toolkit.vc.sourcetotfsmigrationengine.processchangegroup(changegrouping group) at rledq7v0ex0lxcb8ef.3rbgrnxcby0g0kr3z1.processchangegroup(changegrouping ) at kknila3qw3uw4h2h4l.f8pb0cqoqnxv42wuir.processchangegroup(changegrouping ) at microsoft.teamfoundation.migration.toolkit.vc.vcmigrationengine.migrateeach() at microsoft.teamfoundation.migration.toolkit.vc.vcmigrationengine.run() at microsoft.teamfoundation.migration.toolkit.vc.sourcetotfsmigrationengine.run() at rledq7v0ex0lxcb8ef.3rbgrnxcby0g0kr3z1.run() at ojkza5fw18b01gf9op.bkfnhgsrxn5aainiof.vonztpjt0() logicaloperationstack=main datetime=2011-08-26t16:21:57.8118303z migrationconsole.exe information: 0 : svn2tfs_cgx: the migration engine is unable to resolve a conflict where two changes have the same target item: logicaloperationstack=main datetime=2011-08-26t16:21:57.8118303z migrationconsole.exe warning: 0 : thread was being aborted. logicaloperationstack=main datetime=2011-08-26t16:21:57.8235495z migrationconsole.exe information: 0 : system.threading.threadabortexception: thread was being aborted. at system.threading.thread.abortinternal() at system.threading.thread.abort() at ojkza5fw18b01gf9op.bkfnhgsrxn5aainiof.ey3tcupoh(thread ) logicaloperationstack=main datetime=2011-08-26t16:21:57.8264793z
figure: well, this is going to be fun
luckily timely migration have a little support tools to help us. fire up “migration support”, which is in the install folder, and have a bunch of tools to make things easier.
figure: which support tool would you like to use
most migration tools forget about this bit and i have only really seen it in timely and in the integration platform. what i need to be able to do is open the session analysis and make a couple of changes to fix the issue. luckily there is a “session viewer” which will open the tfstimelymigration database that you created as part of your configuration.
figure: there are a bunch of features to edit the “session” data
the first thing we need to do is find out where we are. clicking the “get pending change group” will load up that pesky 17018 item that is causing the block.
figure: you can edit the change group to bypass the problem
it is now a case of figuring out what the problem actually is. there are no “rename”’s so it is not a case of a rename causing a conflict, but what is the problem…
i could not figure it out from just scrolling through this list so i though to use the “save actions as”, but the output from that provided to be nasty. real nasty:
figure: what the heck use is this!
so what i decided to do was install the snagit 10 trial and use the “capture text” function.
figure: snagit capture text function gives you grab the entire vertical area in one go
figure: now i have it as a kind of notepad format
taking this output, pasting it into excel, creating the data as a table and ordering by “tfs source” produces an interesting result.
figure: you can see the dups
where you might ask, did these come from. well, in the settings file there was an option for “itemexistshandler” that for most cases can be set to “changetpedit”, the only problem is if the file is already an “add” then you are going to get a conflict like this one.
figure: item exists handler default to change to edit
while this is indeed desired behaviour, it can case this sort of issue when there are files that have slightly different casing when they are added.
change the option to “ignore”
while this would remove the conflicts, it would poise the real risk of loosing data.
figure: risky option, change setting to ignore existing items
for each item in the list, determine which one is in conflict and remove it manually. this is likely to happen ever time a large number of changes is checked in or reorgs of code happen.
figure: safe option, remove each bad change
it would be really nice if timely could add the ability to view the conflicts only and be able to bulk apply the resolution as i am looking at 300+ conflicts in a single check-in. at least we are 68% of the way through this particular migration and the chances are (fingers crossed) that there will only be a few conflicts.
let me know how you get on with your own migrations!
Published at DZone with permission of Martin Hinshelwood, DZone MVB. See the original article here.
Opinions expressed by DZone contributors are their own.