azure-devops-migration-tools

Re-migrate a work item that has been deleted on target server


I'm starting to use the great ADO Migration Tool by MrHinsh. I've succeeded to configure it as I want but I have some problem in a particular case : let's say I've migrate WI #67604 (TFS 2017) to WI #217 (ADO). Then I've deleted the new WI (#217).

And I'm trying to run the migration tool again but I've an error Microsoft.TeamFoundation.WorkItemTracking.Client.ValidationException: TF237124: l'élément de travail n'est pas prêt à être enregistré

I've tried to restore it from the bin, it works now. I've tried to permanently delete it, same error. I've tried to remove the ReflectedWorkItemIDFieldName in the source WI on TFS but I'm unable to find the field...

Here is my config file :

{
  "ChangeSetMappingFile": null,
  "Source": {
    "$type": "TfsTeamProjectConfig",
    "Collection": "XXX",
    "Project": "TEST1",
    "ReflectedWorkItemIDFieldName": "Custom.ReflectedWorkItemId",
    "AllowCrossProjectLinking": false,
    "AuthenticationMode": "Prompt",
    "PersonalAccessToken": "aaaa",
    "LanguageMaps": {
      "AreaPath": "Area",
      "IterationPath": "Iteration"
    }
  },
  "Target": {
    "$type": "TfsTeamProjectConfig",
    "Collection": "YYY",
    "Project": "TEST2",
    "ReflectedWorkItemIDFieldName": "Custom.ReflectedWorkItemId",
    "AllowCrossProjectLinking": false,
    "AuthenticationMode": "Prompt",
    "PersonalAccessToken": "yyyy",
    "LanguageMaps": {
      "AreaPath": "Area",
      "IterationPath": "Iteration"
    }
  },
  "FieldMaps": [],
  "GitRepoMapping": null,
  "LogLevel": "Information",
  "Processors": [
    {
      "$type": "WorkItemMigrationConfig",
      "Enabled": true,
      "ReplayRevisions": true,
      "PrefixProjectToNodes": true,
      "UpdateCreatedDate": true,
      "UpdateCreatedBy": true,
      "WIQLQueryBit": "AND  ID = 69949 OR ID = 67604",
      "WIQLOrderBit": "[System.ChangedDate] desc",
      "LinkMigration": true,
      "AttachmentMigration": true,
      "AttachmentWorkingPath": "c:\\temp\\WorkItemAttachmentWorkingFolder\\",
      "FixHtmlAttachmentLinks": true,
      "SkipToFinalRevisedWorkItemType": true,
      "WorkItemCreateRetryLimit": 5,
      "FilterWorkItemsThatAlreadyExistInTarget": true,
      "PauseAfterEachWorkItem": false,
      "AttachmentMaxSize": 480000000,
      "AttachRevisionHistory": false,
      "LinkMigrationSaveEachAsAdded": false,
      "GenerateMigrationComment": true,
      "NodeStructureEnricherEnabled": null,
      "NodeBasePaths": [],
      "WorkItemIDs": null,
      "MaxRevisions": 0
    }
  ],
  "Version": "11.11",
  "workaroundForQuerySOAPBugEnabled": false,
  "WorkItemTypeDefinition": {
    "sourceWorkItemTypeName": "targetWorkItemTypeName"
  },
  "Endpoints": {
    "InMemoryWorkItemEndpoints": [
      {
        "Name": "Source",
        "EndpointEnrichers": null
      },
      {
        "Name": "Target",
        "EndpointEnrichers": null
      }
    ]
  }
}

Solution

  • Enabling "LogLevel" to "Debug" helps me find the problem and it was a mistake in the config file... Now I can migrate, sync and if I delete WI in target DevOps collection I can migrate it again.

    Everything's fine !