无法正确配置 TeamSettingsProcessor

Unable to correctly configure TeamSettingsProcessor

我正在尝试弄清楚如何使用 TeamSettingsProcessor 在两个 Azure DevOps Server 项目之间迁移团队。起初,我尝试了 GitHub docs page:

中所述的配置
{
    "$type": "TeamMigrationConfig",
    "Enabled": true,
    "EnableTeamSettingsMigration": true,
    "FixTeamSettingsForExistingTeams": true,
    "PrefixProjectToNodes": false
}

那个简单地返回:

[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"

所以我改用 message 中提到的那个(显然是预览版):

        {
            "$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
            }
        }

但这只是 returns 错误

[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\s\src\MigrationTools\Endpoints\EndpointFactory.cs:line 43
   at MigrationTools.Processors.Processor.Configure(IProcessorOptions options) in D:\a\s\src\MigrationTools\Processors\Processor.cs:line 50
   at MigrationTools.Processors.TfsTeamSettingsProcessor.Configure(IProcessorOptions options) in D:\a\s\src\MigrationTools.Clients.AzureDevops.ObjectModel\Processors\TfsTeamSettingsProcessor.cs:line 35
   at MigrationTools._EngineV1.Containers.ProcessorContainer.Configure() in D:\a\s\src\MigrationTools\_EngineV1\Containers\ProcessorContainer.cs:line 61
   at MigrationTools.MigrationEngine.Run() in D:\a\s\src\MigrationTools\MigrationEngine.cs:line 87
   at MigrationTools.Host.ExecuteHostedService.<StartAsync>b__5_1() in D:\a\s\src\MigrationTools.Host\ExecuteHostedService.cs:line 38

我没看到缺少什么参数 name

我经常使用他们的迁移器,我查看了您的问题。

我能够准确地重现您的问题。当我深入研究异常时,看起来他们改变了 TfsTeamSettingsProcessorOptions 的实现,不使用 SourceTarget 节点,尽管此配置在其文档中。

您需要做的是更新 TfsTeamSettingsProcessorOptions 以指向在 Endpoints 中配置的命名 TfsEndpoints 数组使用 SourceNameTargetName 属性。

在你的情况下看起来像这样:

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