azure-devops-migration-tools icon indicating copy to clipboard operation
azure-devops-migration-tools copied to clipboard

Work items not migrating if they once belonged in a project that no longer exists

Open johnmuff opened this issue 3 years ago • 7 comments

I've done a couple of test migrations from one Azure DevOps to another organisation DevOps having already migrated the Process. Everything transfers as expected except work items that USED to belong in a now deleted project.

Some work items in my source once belonged to another project that has since been deleted. They contain a history record of them moving from the old project. These work items throw an error during the migration and are not migrated - the error is "TF26192: The team project specified by ID 17 does not exist. Check the team project ID and try again" Have you seen this before and if so, is there a workaround? Thanks

johnmuff avatar Nov 11 '21 16:11 johnmuff

I'm facing the same issue.

stevns avatar Nov 19 '21 12:11 stevns

@MrHinsh : Maybe we can use a replace filter?

stevns avatar Nov 19 '21 12:11 stevns

Output from run:

[14:08:01 ERR] Microsoft.TeamFoundation.WorkItemTracking.Client.DeniedOrNotExistException: TF26192: The team project specified by the ID 37 does not exist. Check the team project ID and try again.
   at Microsoft.TeamFoundation.WorkItemTracking.Client.ProjectCollection.GetById(Int32 projectId)
   at Microsoft.TeamFoundation.WorkItemTracking.Client.WorkItem.CheckUpdateCachedData(Boolean projectChanged, Boolean typeChanged)
   at Microsoft.TeamFoundation.WorkItemTracking.Client.WorkItem.get_Type()
   at Microsoft.TeamFoundation.WorkItemTracking.Client.WorkItemFieldData.Microsoft.TeamFoundation.WorkItemTracking.Internals.IWorkItemOpenFieldDataHelper.SetLatestData(Dictionary`2 latestData)
   at Microsoft.TeamFoundation.WorkItemTracking.Internals.WorkItemHelper.LoadWorkItemFieldData(IRowSetCollectionHelper tables, IWorkItemOpenFieldDataHelper helper)
   at Microsoft.TeamFoundation.WorkItemTracking.Client.WorkItem.LoadWorkItemFromRowSetInternal(Int32 rev, Nullable`1 asof, IWorkItemRowSets witem)
   at Microsoft.TeamFoundation.WorkItemTracking.Client.WorkItem..ctor(WorkItemStore store, Int32 id, Int32 revision)
   at MigrationTools.TfsExtensions.GetRevision(WorkItemData context, Int32 rev) in D:\a\1\s\src\MigrationTools.Clients.AzureDevops.ObjectModel\TfsExtensions.cs:line 35
   at VstsSyncMigrator.Engine.WorkItemMigrationContext.ReplayRevisions(List`1 revisionsToMigrate, WorkItemData sourceWorkItem, WorkItemData targetWorkItem) in D:\a\1\s\src\VstsSyncMigrator.Core\Execution\MigrationContext\WorkItemMigrationContext.cs:line 484

stevns avatar Nov 19 '21 13:11 stevns

@MrHinsh - Any advice on this? I'm running into this issue as well. Except the project these work items that were migrated from still exist - but in a different org.

Wollman19 avatar Jun 16 '22 21:06 Wollman19

Hey all, I was using this tool to migrate a project from one org to another with one small caveat - about 200 work items had already been migrated from a project outside the organization I'm working in. Plus, the work items that had already been migrated once still existed in the old org. So although mine weren't from a project that had been deleted, I was getting the same error as @johnmuff . The work around for me was to alter the "maxrevisions" param to 1 (is defaulted to 0). Hope this helps!

Wollman19 avatar Jun 30 '22 13:06 Wollman19

I am also getting this error. If anyone has any resolution or 'fix' that allows you to import these items (maybe without the history) I would appreciate it.

SensFanInBoston avatar Jul 18 '22 11:07 SensFanInBoston

You can turn off history and it will only import the latest.

The next easiest way to resolve this is for one of those with the error to debug and resolve it with a PR.

MrHinsh avatar Aug 15 '22 13:08 MrHinsh