azure-devops-migration-tools

Unable to correctly configure TeamSettingsProcessor


I am trying to figure out how to use the TeamSettingsProcessor to migrate teams between two Azure DevOps Server Projects. At first, I tried the configuration stated in the GitHub docs page:

{
    "$type": "TeamMigrationConfig",
    "Enabled": true,
    "EnableTeamSettingsMigration": true,
    "FixTeamSettingsForExistingTeams": true,
    "PrefixProjectToNodes": false
}

That one simply returned:

[09:14:22 FTL] *************MIGRATION ALERT!!!!!!!!!
[09:14:22 FTL] TeamMigrationContext has been migrated to TfsTeamSettingsProcessor: https://nkdagility.github.io/azure-devops-migration-tools/Reference/Processors/TfsTeamSettingsProcessor.html"

So I switched to use the one referred to in the message (which apparently is in preview):

        {
            "$type": "TfsTeamSettingsProcessorOptions",
            "Enabled": true,
            "MigrateTeamSettings": true,
            "UpdateTeamSettings": true,
            "PrefixProjectToNodes": false,
            "Teams": null,
            "ProcessorEnrichers": null,
            "Source": {
              "$type": "TfsTeamSettingsEndpointOptions",
              "Organisation": "https://company.com/tfs/Collection/",
              "Project": "SourceProject",
              "AuthenticationMode": "Prompt",
              "ReflectedWorkItemIdField": "Custom.Field",
              "LanguageMaps": {
                "$type": "TfsLanguageMapOptions",
                "AreaPath": "Area",
                "IterationPath": "Iteration"
              },
              "EndpointEnrichers": null
            },
            "Target": {
              "$type": "TfsTeamSettingsEndpointOptions",
              "Organisation": "https://company.com/tfs/Collection/",
              "Project": "TargetProject",
              "AuthenticationMode": "Prompt",
              "ReflectedWorkItemIdField": "Custom.Field",
              "LanguageMaps": {
                "$type": "TfsLanguageMapOptions",
                "AreaPath": "Area",
                "IterationPath": "Iteration"
              },
              "EndpointEnrichers": null
            }
        }

But that simply returns the error

[09:38:40 INF] Start Time: 02/09/2021 09:38:40
[09:38:40 INF] Running with args: execute
[09:38:40 INF] OSVersion: Microsoft Windows NT 6.2.9200.0
[09:38:40 INF] Version: 11.9.31.0
[09:38:48 INF] Latest version detected as 11.9.31.0
[09:38:48 DBG] Hosting starting
[09:38:48 INF] Application started. Press Ctrl+C to shut down.
[09:38:48 INF] Hosting environment: Production
[09:38:48 INF] Content root path: C:\git\DevIT\WorkItemMigration
[09:38:48 INF] Press Ctrl+C to shut down.
[09:38:48 DBG] Hosting started
[09:38:48 INF] Config Found, creating engine host
[09:38:49 INF] Creating Migration Engine 1fa254e5-abbf-4342-b1f0-1a72863f0b49
[09:38:49 INF] ProcessorContainer: Of 3 configured Processors only 1 are enabled
[09:38:49 INF] ProcessorContainer: Adding Processor TfsTeamSettingsProcessor
[09:38:49 INF] Processor::Configure
[09:38:49 ERR] Unhandled exception!
System.ArgumentNullException: Value cannot be null.
Parameter name: name
   at MigrationTools.Endpoints.EndpointFactory.CreateEndpoint(String name) in D:\a\1\s\src\MigrationTools\Endpoints\EndpointFactory.cs:line 43
   at MigrationTools.Processors.Processor.Configure(IProcessorOptions options) in D:\a\1\s\src\MigrationTools\Processors\Processor.cs:line 50
   at MigrationTools.Processors.TfsTeamSettingsProcessor.Configure(IProcessorOptions options) in D:\a\1\s\src\MigrationTools.Clients.AzureDevops.ObjectModel\Processors\TfsTeamSettingsProcessor.cs:line 35
   at MigrationTools._EngineV1.Containers.ProcessorContainer.Configure() in D:\a\1\s\src\MigrationTools\_EngineV1\Containers\ProcessorContainer.cs:line 61
   at MigrationTools.MigrationEngine.Run() in D:\a\1\s\src\MigrationTools\MigrationEngine.cs:line 87
   at MigrationTools.Host.ExecuteHostedService.<StartAsync>b__5_1() in D:\a\1\s\src\MigrationTools.Host\ExecuteHostedService.cs:line 38

I fail to see what parameter name that is missing?


Solution

  • I use their migrator quite often and I took a look into your issue.

    I was able to replicate your issue exactly. When I dug into the exception, it looks like they changed their implementation of the TfsTeamSettingsProcessorOptions to not use the Source and Target nodes, despite this configuration being in their documentation.

    What you'll need to do is update your TfsTeamSettingsProcessorOptions to point to named TfsEndpoints configured within the Endpoints array using SourceName and TargetName attributes.

    It would look something like this in your case:

    {
        "$type": "TfsTeamSettingsProcessorOptions",
        "Enabled": true,
        "MigrateTeamSettings": true,
        "UpdateTeamSettings": true,
        "PrefixProjectToNodes": false,
        "Teams": null,
        "ProcessorEnrichers": null,
        "SourceName": "Source",
        "TargetName": "Target"
    }