nkdAgility / azure-devops-migration-tools

Azure DevOps Migration Tools allow you to migrate Teams, Backlogs, Tasks, Test Cases, and Plans & Suits from one Project to another in Azure DevOps / TFS both within the same Organisation, and between Organisations.
https://nkdagility.com/learn/azure-devops-migration-tools/
MIT License
493 stars 328 forks source link

System.NullReferenceException: Object reference not set to an instance of an object #2254

Closed muthu3758 closed 1 month ago

muthu3758 commented 1 month ago

Version

Source Version

Azure DevOps Service

Target Version

Azure DevOps Service

Relevant configuration

{
  "Version": "15.1",
  "LogLevel": "Debug",
  "workaroundForQuerySOAPBugEnabled": false,
  "WorkItemTypeDefinition":
  {
      "Risk": "Task",
      "Dependency": "Improvement",
  },
  "Source": {
    "$type": "TfsTeamProjectConfig",
    "Collection": "https://dev.azure.com/",
    "Project": "Rhelp",
    "ReflectedWorkItemIDFieldName": "Custom.ReflectedWorkItemId",
    "AllowCrossProjectLinking": true,
    "PersonalAccessToken": "",
    "LanguageMaps": {
      "AreaPath": "Area",
      "IterationPath": "Iteration"
    }
  },
  "Target": {
    "$type": "TfsTeamProjectConfig",
    "Collection": "https://dev.azure.com/",
    "Project": "RHelp",
    "ReflectedWorkItemIDFieldName": "Custom.ReflectedWorkItemId",
    "AllowCrossProjectLinking": true,
    "PersonalAccessToken": "",
    "LanguageMaps": {
      "AreaPath": "Area",
      "IterationPath": "Iteration"
    }
  },
    "CommonEnrichersConfig": [
    {
      "$type": "TfsNodeStructureOptions",
      //"RefName": "TfsNodeStructure",
      "CreateMissingNodes": true,
      "Enabled": true,
      "NodeBasePaths": [],
      "AreaMaps": {
          "^Rhelp([\\\\]?.*)$": "RHelp",
          "^Rhelp_Migration1([\\\\]?.*)$": "RHelp",
          "^Rhelp One time projects([\\\\]?.*)$": "RHelp",
          "^Rhelp-SPIS([\\\\]?.*)$": "RHelp",
          "^Rhelp-SPIS\\\\Warehouse$": "RHelp\\Warehouse",

      },
      "IterationMaps": {
          "^Rhelp([\\\\]?.*)$": "RHelp",
          "^Rhelp_Migration1([\\\\]?.*)$": "RHelp",
          "^Rhelp One time projects([\\\\]?.*)$": "RHelp",
          "^Rhelp-SPIS([\\\\]?.*)$": "RHelp",
          "^Rhelp-SPIS\\\\Warehouse$": "RHelp\\Warehouse",
      },
      "ShouldCreateMissingRevisionPaths": true,
      "ReplicateAllExistingNodes": true
    },
    {
      "$type": "TfsWorkItemLinkEnricherOptions",
      "Enabled": false,
      "FilterIfLinkCountMatches": true,
      "SaveAfterEachLinkIsAdded": false
    },
    {
      "$type": "TfsRevisionManagerOptions",
      "Enabled": false,
      "ReplayRevisions": true,
      "MaxRevisions": 0
    },
    {
      "$type": "TfsAttachmentEnricherOptions",
      "Enabled": false,
      "ExportBasePath": "c:\\temp\\WorkItemAttachmentExport",
      "MaxRevisions": 480000000
    },
    {
      "$type": "StringManipulatorEnricherOptions",
      "Enabled": false,
      "MaxStringLength": 1000000,
      "Manipulators": [
        {
          "$type": "RegexStringManipulator",
          "Enabled": true,
          "Pattern": "[^( -~)\n\r\t]+",
          "Replacement": "",
          "Description": "Remove invalid characters from the end of the string"
        }
      ]
    },
    {
      "$type": "TfsUserMappingEnricherOptions",
      "Enabled": false,
      "UserMappingFile": "C:\\temp\\userExport.json",
      "IdentityFieldsToCheck": [
        "System.AssignedTo",
        "System.ChangedBy",
        "System.CreatedBy",
        "Microsoft.VSTS.Common.ActivatedBy",
        "Microsoft.VSTS.Common.ResolvedBy",
        "Microsoft.VSTS.Common.ClosedBy"
      ]
    }
  ], 
    "Processors": [
     {
      "$type": "TestConfigurationsMigrationConfig",
      "Enabled": false,
    },
    {
      "$type": "WorkItemMigrationConfig",
      "ReplayRevisions": true,
      "PrefixProjectToNodes": true,
      "UpdateCreatedDate": true,
      "UpdateCreatedBy": true,
      "BuildFieldTable": false,
      "AppendMigrationToolSignatureFooter": false,
      //"WIQLQuery": "SELECT [System.Id] FROM WorkItems WHERE [System.TeamProject] = @TeamProject AND [System.WorkItemType] NOT IN ('Test Suite', 'Test Plan','Shared Steps','Shared Parameter','Feedback Request') AND [System.WorkItemType] <> ''",
      "WIQLQuery": "SELECT [System.Id] FROM WorkItems WHERE [System.TeamProject] = @TeamProject And [System.Id] IN (2025)",
      //"WIQLQueryBit": "AND (NOT [System.WorkItemType] IN ('Test Suite', 'Test Plan','Code Review Request','Code Review Response','Feedback Request','Feedback Response','Shared Steps','Shared Parameter') AND [System.WorkItemType] <> '')",
      "WIQLOrderBit": "[System.ChangedDate] desc",
      "Enabled": true,
      "LinkMigration": true,
      "AttachmentMigration": true,
      "AttachmentWorkingPath": "c:\\temp\\WorkItemAttachmentWorkingFolder\\",
      "FixHtmlAttachmentLinks": true,
      "SkipToFinalRevisedWorkItemType": false,
      "WorkItemCreateRetryLimit": 5,
      "FilterWorkItemsThatAlreadyExistInTarget": true,
      "PauseAfterEachWorkItem": false,
      "AttachmentMaxSize": 480000000,
      "CollapseRevisions": false,
      "LinkMigrationSaveEachAsAdded": true,
      "GenerateMigrationComment": true,
      "StopMigrationOnMissingAreaIterationNodes": false,
      "SkipRevisionWithInvalidAreaPath": true,
      "SkipRevisionWithInvalidIterationPath": true,
      "AreaMaps": {
          "^SPIS":"RHelp",
          "^Rhelp Green team": "RHelp",
          "^Rhelp One time projects": "RHelp",
          "^Rhelp Technical Experts": "RHelp",
          "^RHELP Modernization": "RHelp",
          "^Inspire-Development":"RHelp",
          "^Rhelp Green team\\\\": "RHelp\\",
          "^SPIS\\\\": "RHelp\\",
          "^Rhelp One time projects\\\\": "RHelp\\",
          "^Rhelp One time projects\\\\Area\\\\": "RHelp\\",
          "^Rhelp Technical Experts\\\\": "RHelp\\",
          "^RHELP Modernization\\\\": "RHelp\\",
          "^Inspire-Development\\\\":"RHelp\\"

      },
      "IterationMaps": {
          "^SPIS":"RHelp",
          "^rhelp\\\\area": "RHelp",
          "^Rhelp Green team": "RHelp",
          "^Rhelp One time projects": "RHelp",
          "^Rhelp Technical Experts": "RHelp",
          "^RHELP Modernization": "RHelp",
          "^Inspire-Development":"RHelp",
          "^Rhelp Green team\\\\": "RHelp\\",
          "^SPIS\\\\": "RHelp\\",
          "^Rhelp One time projects\\\\": "RHelp\\",
          "^Rhelp Technical Experts\\\\": "RHelp\\",
          "^RHELP Modernization\\\\": "RHelp\\",
          "^Inspire-Development\\\\":"RHelp\\"
      },
    },
    {
      "$type": "TfsTeamSettingsProcessorOptions",
      "Enabled": false,
      "MigrateTeamSettings": true,
      "UpdateTeamSettings": true,
      "PrefixProjectToNodes": false,
      "Teams": ["Project - RHelp"],      
      "ProcessorEnrichers": null,
      "SourceName": "TeamSource",
      "TargetName": "TeamTarget"
    },
    {
      "$type": "TestPlansAndSuitesMigrationConfig",
      "Enabled": false,
      "PrefixProjectToNodes": false,
      "OnlyElementsWithTag": null,
      "OnlyElementsUnderAreaPath": null,
      "TestPlanQueryBit": null,
      "RemoveInvalidTestSuiteLinks": false,
      "FilterCompleted": false,
    },
    {
      "$type": "TfsSharedQueryProcessorOptions",
      "Enabled": false,
      "PrefixProjectToNodes": false,
      "SharedFolderName": "Shared Queries\\Forms",
      "SourceToTargetFieldMappings": null,
      "ProcessorEnrichers": null,
      "SourceName": "Source",
      "TargetName": "Target"
    }
  ],
  "Endpoints": {
    "TfsEndpoints": [
      {
        "Name": "Source",
        "Organisation": "https://dev.azure.com/",
        "Project": "Rhelp",
        "AccessToken": ""
      },
      {
        "Name": "Target",
        "Organisation": "https://dev.azure.com/",
        "Project": "RHelp",
        "AccessToken": ""
      }
    ],
  "TfsTeamSettingsEndpoints":[
      {
        "Name": "TeamSource",
        "Organisation": "https://dev.azure.com/",
        "Project": "Rhelp",
        "AccessToken": ""
      },
      {
        "Name": "TeamTarget",
        "Organisation": "https://dev.azure.com/",
        "Project": "RHelp",
        "AccessToken": ""
      }
    ]
  }
 }

Relevant log output

No response

What happened?

The source project work items are moved from different source projects, so even though I have provided the maaping I'm not able to migrate the work items migration-3.log

Debug in Visual Studio

MrHinsh commented 1 month ago

Your config is a mess of old stuff and new. Very confusing.

The log file shows the error under:

"Invalid Field Object"

You are missing a mapping.

muthu3758 commented 1 month ago

I have removed the IterationMaps and AreaMaps from the WorkItemMigrationConfig processor but still getting the same error.

Whatever Area and Iteration mapping displays is the error message is updated under the TfsNodeStructureOptions, but still getting the same error message.

"CommonEnrichersConfig": [ { "$type": "TfsNodeStructureOptions", //"RefName": "TfsNodeStructure", "CreateMissingNodes": true, "Enabled": true, "NodeBasePaths": [], "AreaMaps": { "^Rhelp([\\]?.)$": "RHelp", "^Rhelp_Migration1([\\]?.)$": "RHelp", "^Rhelp One time projects([\\]?.*)$": "RHelp", "^Rhelp_Migration1\\Warehouse$": "RHelp\Warehouse",

  },
  "IterationMaps": {
      "^Rhelp([\\\\]?.*)$": "RHelp",
      "^Rhelp_Migration1([\\\\]?.*)$": "RHelp",
      "^Rhelp One time projects([\\\\]?.*)$": "RHelp",
      "^Rhelp_Migration1\\\\Warehouse$": "RHelp\\Warehouse",
  },
  "ShouldCreateMissingRevisionPaths": true,
  "ReplicateAllExistingNodes": true
},
MrHinsh commented 1 month ago

Those arena maps are not escaped correctly.