Mapping of a field with date change the date on target - azure-devops-migration-tools

I'm trying to map the field with date, but on the target the date is changed to previous date.
On the source:
Integration Date: 30.11.2019 00:00
On the target:
Integration Date: 29.11.2019 23:00
I was trying also with Regexp mapping, just to map the date, but was not able to make it working. Below there is my configuration. It's a migration from Azure Devops Services to Azure Devops Services.
{
"ChangeSetMappingFile": null,
"Source": {
"$type": "TfsTeamProjectConfig",
"Collection": "https://dev.azure.com/XXX",
"Project": "Reach CSA",
"ReflectedWorkItemIDFieldName": "ReflectedWorkItemId",
"AllowCrossProjectLinking": true,
"AuthenticationMode": "Prompt",
"PersonalAccessToken": "XXX",
"LanguageMaps": {
"AreaPath": "Area",
"IterationPath": "Iteration"
}
},
"Target": {
"$type": "TfsTeamProjectConfig",
"Collection": "https://dev.azure.com/XXX",
"Project": "ReachCSA-Migration-DryRun",
"ReflectedWorkItemIDFieldName": "ReflectedWorkItemId",
"AllowCrossProjectLinking": true,
"AuthenticationMode": "Prompt",
"PersonalAccessToken": "XXX",
"LanguageMaps": {
"AreaPath": "Area",
"IterationPath": "Iteration"
}
},
"GitRepoMapping": null,
"LogLevel": "Verbose",
"FieldMaps": [
{
"$type": "FieldtoFieldMultiMapConfig",
"WorkItemTypeName": "*",
"SourceToTargetMappings": {
"CSAReach.Rationale": "Rationale",
"System.Reason": "ReachCSA_Reason",
"CSAReach.TargetRelease": "ReachCSA Target Release",
"CSAReach.Source": "ReachCSA_Origin_Source",
"CSAReach.Contact1": "Contact 1",
"CSAReach.Contact2": "Contact 2",
"CSAReach.Contact3": "Contact 3",
"Microsoft.VSTS.Common.Priority": "ReachCSA_Priority",
"CSAReach.RequirementType": "ReachCSA_Type",
"CSAReach.Target": "Target Platform",
"CSAReach.IntegrationDate": "Integration Date",
"CSAReach.MarketDate": "Market Date"
}
},
{
"$type": "FieldtoFieldMultiMapConfig",
"WorkItemTypeName": "Query",
"SourceToTargetMappings": {
"CSAReach.SystemInfo": "System Information",
"Microsoft.VSTS.TCM.ReproSteps": "Steps to Reproduce",
"System.Reason": "ReachCSA_Reason",
"CSAReach.Source": "ReachCSA_Origin_Source",
"CSAReach.Contact1": "Contact 1",
"CSAReach.Contact2": "Contact 2",
"CSAReach.Contact3": "Contact 3",
"Microsoft.VSTS.Common.Priority": "ReachCSA_Severity",
"CSAReach.Target": "Target Platform",
"CSAReach.DueDate": "Due Date",
"CSAReach.FoundInRelease": "CSA Release"
}
}
],
"Processors": [
{
"$type": "WorkItemMigrationConfig",
"Enabled": true,
"ReplayRevisions": true,
"PrefixProjectToNodes": false,
"UpdateCreatedDate": true,
"UpdateCreatedBy": true,
"BuildFieldTable": false,
"AppendMigrationToolSignatureFooter": false,
"WIQLQueryBit": "AND [System.Id] IN ('42249')",
"WIQLOrderBit": "[System.ChangedDate] desc",
"LinkMigration": true,
"AttachmentMigration": true,
"AttachmentWorkingPath": "D:\\Workspaces\\projects\\PG-CT migration\\ReachCSA\\attachments\\",
"FixHtmlAttachmentLinks": false,
"SkipToFinalRevisedWorkItemType": true,
"WorkItemCreateRetryLimit": 5,
"FilterWorkItemsThatAlreadyExistInTarget": true,
"PauseAfterEachWorkItem": false,
"AttachmentMaxSize": 480000000,
"CollapseRevisions": false,
"LinkMigrationSaveEachAsAdded": false,
"GenerateMigrationComment": true
}
],
"Version": "11.9",
"workaroundForQuerySOAPBugEnabled": false,
"WorkItemTypeDefinition": {
"sourceWorkItemTypeName": "targetWorkItemTypeName"
}
}
Thanks for any help!

OK, got the issue here. It's time settings between the azure organization (UTC) and my profile. The profile needs to be set to my local timezone.

Related

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
}
]
}
}
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 !

Migration of Work Items from TFS 2018 to Azure DevOps 2020 fails to migrate links between Work Items

I am exploring different possibilities to move our organisations Work Items from a TFS 2018 (v. 16.131.28507.4) to Azure DevOps 2020 (v. Dev18.M170.6). with Azure DevOps Migration Tools.
I am now struggling with parts of the migration tools (v. 11.11)
All Work Items do copy to the target environment, the iterations and areas are in place as well as the teams and team areas. The field "ReflectedWorkItemId" is also updated correctly in my target.
But looking in Azure, not one work item in the target environment has any links to its children or parents. In the migration tools logs there's a lot of warnings which I guess are related to my problem.
"[SKIP] [LINK_CAPTURE_RELATED] [RegisteredLinkType] target not found. wiSourceL=38673, wiSourceR=null, wiTargetL=12410"
The parent and the children WI's is present in Azure with but I am guessing I am missing something in the configuration.
In my source I am using the project type "Agile". In my target I've created an inherited project from Agile (with name "OrgAgile" to be able to add the "ReflectedWorkItemId" field in the process templates. Can that be an issue?
I see one issue have been posted on the tools GitHub (https://github.com/nkdAgility/azure-devops-migration-tools/issues/964) and I've posted a question there myself but no answers yet so I thought I try here. It could be a bug, but I want to make sure I haven't done the configuration wrong.
Below is the configuration.json. Perhaps I've removed/missed configuration from the default file that is crucial for a correct link migration or have redundant/conflicting parts in it.
Any help, pointers or roasts is most welcome.
configuration.json
{
"Version": "11.11",
"workaroundForQuerySOAPBugEnabled": false,
"GitRepoMapping": null,
"LogLevel": "Information",
"Source": {
"$type": "TfsTeamProjectConfig",
"Collection": "http://<sourceServer>/DefaultCollection",
"Project": "<sourceProject>",
"ReflectedWorkItemIDFieldName": "TfsMigrationTool.ReflectedWorkItemId2",
"AllowCrossProjectLinking": false,
"AuthenticationMode": "Prompt",
"PersonalAccessToken": "",
"LanguageMaps": {
"AreaPath": "Area",
"IterationPath": "Iteration"
}
},
"Target": {
"$type": "TfsTeamProjectConfig",
"Collection": "http://<targetServer>/DefaultCollection",
"Project": "<targetProject>",
"ReflectedWorkItemIDFieldName": "ReflectedWorkItemId",
"AllowCrossProjectLinking": false,
"AuthenticationMode": "Prompt",
"PersonalAccessToken": "",
"LanguageMaps": {
"AreaPath": "Area",
"IterationPath": "Iteration"
}
},
"Processors": [
{
"$type": "TfsAreaAndIterationProcessorOptions",
"Enabled": true,
"PrefixProjectToNodes": false,
"NodeBasePaths": null,
"ProcessorEnrichers": null,
"SourceName": "IterationSettingsSource",
"TargetName": "IterationSettingsTarget"
},
{
"$type": "TfsTeamSettingsProcessorOptions",
"Enabled": true,
"MigrateTeamSettings": true,
"UpdateTeamSettings": true,
"PrefixProjectToNodes": false,
"Teams": null,
"ProcessorEnrichers": null,
"SourceName": "TeamSettingsSource",
"TargetName": "TeamSettingsTarget"
},
{
"$type": "WorkItemMigrationConfig",
"Enabled": true,
"ReplayRevisions": true,
"PrefixProjectToNodes": false,
"UpdateCreatedDate": true,
"UpdateCreatedBy": true,
"BuildFieldTable": false,
"AppendMigrationToolSignatureFooter": false,
"WIQLQueryBit": "AND [System.WorkItemType] NOT IN ('Test Suite', 'Test Plan', 'Shared Steps', 'Shared Parameter', 'Test Case')",
"WIQLOrderBit": "[System.ChangedDate] desc",
"LinkMigration": true,
"AttachmentMigration": false,
"AttachmentWorkingPath": "c:\\temp\\WorkItemAttachmentWorkingFolder\\",
"FixHtmlAttachmentLinks": false,
"SkipToFinalRevisedWorkItemType": true,
"WorkItemCreateRetryLimit": 5,
"FilterWorkItemsThatAlreadyExistInTarget": true,
"PauseAfterEachWorkItem": false,
"AttachmentMaxSize": 480000000,
"AttachRevisionHistory": false,
"LinkMigrationSaveEachAsAdded": false,
"GenerateMigrationComment": true,
"NodeBasePaths": [],
"WorkItemIDs": null,
"MaxRevisions": 5
}
],
"Endpoints": {
"TfsEndpoints": [
{
"Name": "IterationSettingsSource",
"AccessToken": "",
"Organisation": "http://<sourceServer>/DefaultCollection",
"Project": "<sourceProject>",
"ReflectedWorkItemIdField": "TfsMigrationTool.ReflectedWorkItemId",
"AuthenticationMode": "Prompt",
"AllowCrossProjectLinking": false,
"LanguageMaps": {
"Area": "Area",
"Iteration": "Iteration"
}
},
{
"Name": "IterationSettingsTarget",
"AccessToken": "",
"Organisation": "http://<targetServer>/DefaultCollection",
"Project": "<targetProject>",
"ReflectedWorkItemIdField": "ReflectedWorkItemId",
"AuthenticationMode": "Prompt",
"AllowCrossProjectLinking": false,
"LanguageMaps": {
"AreaPath": "Area",
"IterationPath": "Iteration"
}
}
],
"TfsTeamSettingsEndpoints": [
{
"Name": "TeamSettingsSource",
"AccessToken": "",
"Organisation": "http://<sourceServer>/DefaultCollection",
"Project": "<sourceProject>",
"ReflectedWorkItemIdField": "TfsMigrationTool.ReflectedWorkItemId",
"AuthenticationMode": "Prompt",
"AllowCrossProjectLinking": false,
"LanguageMaps": {
"Area": "Area",
"Iteration": "Iteration"
}
},
{
"Name": "TeamSettingsTarget",
"AccessToken": "",
"Organisation": "http://<targetServer>/DefaultCollection",
"Project": "<targetProject>",
"ReflectedWorkItemIdField": "ReflectedWorkItemId",
"AuthenticationMode": "Prompt",
"AllowCrossProjectLinking": false,
"LanguageMaps": {
"AreaPath": "Area",
"Iteration": "Iteration"
}
}
]
}
}
This was probably caused by a bug.
Discussion and possible solution is found here:
https://github.com/nkdAgility/azure-devops-migration-tools/issues/964

Is There Sample Test Plan Migration Config for Version 11.5?

Is There Sample Test Plan Migration Config for Version 11.5?
I was able to migrated all test cases, but now want to re-create the test plans.
For older version (like version 10), I was able to use below config to re-create the test plans after migrating all test cases:
"Processors": [
{
"ObjectType": "MigrationTools.Core.Configuration.Processing.NodeStructuresMigrationConfig",
"PrefixProjectToNodes": false,
"Enabled": true,
"BasePaths": []
},
{
"Enabled": true,
"ObjectType": "MigrationTools.Core.Configuration.Processing.TestVariablesMigrationConfig"
},
{
"Enabled": true,
"ObjectType": "MigrationTools.Core.Configuration.Processing.TestConfigurationsMigrationConfig"
},
{
"Enabled": true,
"ObjectType": "MigrationTools.Core.Configuration.Processing.TestPlansAndSuitesMigrationConfig",
"PrefixProjectToNodes": false,
"OnlyElementsWithTag": null,
"RemoveInvalidTestSuiteLinks": true
}
]
However, I am now getting an exception.
[22:32:54 INF] Config Found, creating engine host
[22:32:55 ERR] An Unhandled exception occured.
System.ArgumentNullException: Value cannot be null.
Parameter name: type
at System.Activator.CreateInstance(Type type, Boolean nonPublic)
at System.Activator.CreateInstance(Type type)
at MigrationTools.Configuration.ProcessorConfigJsonConverter.Create(Type objectType, JObject jObject) in D:\a\1\s\src\MigrationTools\Configuration\ProcessorConfigJsonConverter.cs:line 14
I migrated all test cases using below config:
"Processors": [
{
"ObjectType": "WorkItemMigrationConfig",
"ReplayRevisions": true,
"PrefixProjectToNodes": false,
"UpdateCreatedDate": true,
"UpdateCreatedBy": true,
"BuildFieldTable": false,
"AppendMigrationToolSignatureFooter": false,
"WIQLQueryBit": "AND [System.WorkItemType] IN ('Test Case')",
"WIQLOrderBit": "[System.ChangedDate] desc",
"Enabled": true,
"LinkMigration": true,
"AttachmentMigration": true,
"AttachmentWorkingPath": "c:\\temp\\WorkItemAttachmentWorkingFolder\\",
"FixHtmlAttachmentLinks": false,
"SkipToFinalRevisedWorkItemType": false,
"WorkItemCreateRetryLimit": 5,
"FilterWorkItemsThatAlreadyExistInTarget": true,
"PauseAfterEachWorkItem": false,
"AttachmentMaxSize": 480000000,
"CollapseRevisions": false,
"LinkMigrationSaveEachAsAdded": false,
"NodeBasePaths": [],
"WorkItemIDs": null
}
Can someone please provide some insight?
Thanks,
Dennis
We are constantly making changes to the tool and when we bump the version number for major or minor it means we have changes something that impacts the configuration.json. In order to simplify the migration.exe init we reduced the output to just that necessary to migrate work items, the most common usage.
If you run migration.exe init --options Full it will give you the complete configuration options that are available.
For example here is the config from v11.6.
{
"Version": "11.6",
"workaroundForQuerySOAPBugEnabled": false,
"WorkItemTypeDefinition": {
"sourceWorkItemTypeName": "targetWorkItemTypeName"
},
"ChangeSetMappingFile": null,
"Source": {
"ObjectType": "TeamProjectConfig",
"Collection": "https://dev.azure.com/nkdagility-preview/",
"Project": "myProjectName",
"ReflectedWorkItemIDFieldName": "Custom.ReflectedWorkItemId",
"AllowCrossProjectLinking": false,
"PersonalAccessToken": "",
"LanguageMaps": {
"AreaPath": "Area",
"IterationPath": "Iteration"
}
},
"Target": {
"ObjectType": "TeamProjectConfig",
"Collection": "https://dev.azure.com/nkdagility-preview/",
"Project": "myProjectName",
"ReflectedWorkItemIDFieldName": "Custom.ReflectedWorkItemId",
"AllowCrossProjectLinking": false,
"PersonalAccessToken": "",
"LanguageMaps": {
"AreaPath": "Area",
"IterationPath": "Iteration"
}
},
"FieldMaps": [
{
"ObjectType": "MultiValueConditionalMapConfig",
"WorkItemTypeName": "*",
"sourceFieldsAndValues": {
"Field1": "Value1",
"Field2": "Value2"
},
"targetFieldsAndValues": {
"Field1": "Value1",
"Field2": "Value2"
}
},
{
"ObjectType": "FieldBlankMapConfig",
"WorkItemTypeName": "*",
"targetField": "TfsMigrationTool.ReflectedWorkItemId"
},
{
"ObjectType": "FieldValueMapConfig",
"WorkItemTypeName": "*",
"sourceField": "System.State",
"targetField": "System.State",
"defaultValue": "New",
"valueMapping": {
"Approved": "New",
"New": "New",
"Committed": "Active",
"In Progress": "Active",
"To Do": "New",
"Done": "Closed",
"Removed": "Removed"
}
},
{
"ObjectType": "FieldtoFieldMapConfig",
"WorkItemTypeName": "*",
"sourceField": "Microsoft.VSTS.Common.BacklogPriority",
"targetField": "Microsoft.VSTS.Common.StackRank",
"defaultValue": null
},
{
"ObjectType": "FieldtoFieldMultiMapConfig",
"WorkItemTypeName": "*",
"SourceToTargetMappings": {
"SourceField1": "TargetField1",
"SourceField2": "TargetField2"
}
},
{
"ObjectType": "FieldtoTagMapConfig",
"WorkItemTypeName": "*",
"sourceField": "System.State",
"formatExpression": "ScrumState:{0}"
},
{
"ObjectType": "FieldMergeMapConfig",
"WorkItemTypeName": "*",
"sourceField1": "System.Description",
"sourceField2": "Microsoft.VSTS.Common.AcceptanceCriteria",
"targetField": "System.Description",
"formatExpression": "{0} <br/><br/><h3>Acceptance Criteria</h3>{1}",
"doneMatch": "##DONE##"
},
{
"ObjectType": "RegexFieldMapConfig",
"WorkItemTypeName": "*",
"sourceField": "COMPANY.PRODUCT.Release",
"targetField": "COMPANY.DEVISION.MinorReleaseVersion",
"pattern": "PRODUCT \\d{4}.(\\d{1})",
"replacement": "$1"
},
{
"ObjectType": "FieldValuetoTagMapConfig",
"WorkItemTypeName": "*",
"sourceField": "Microsoft.VSTS.CMMI.Blocked",
"pattern": "Yes",
"formatExpression": "{0}"
},
{
"ObjectType": "TreeToTagMapConfig",
"WorkItemTypeName": "*",
"toSkip": 3,
"timeTravel": 1
}
],
"GitRepoMapping": null,
"LogLevel": "Information",
"Processors": [
{
"ObjectType": "WorkItemMigrationConfig",
"ReplayRevisions": true,
"PrefixProjectToNodes": false,
"UpdateCreatedDate": true,
"UpdateCreatedBy": true,
"BuildFieldTable": false,
"AppendMigrationToolSignatureFooter": false,
"WIQLQueryBit": "AND [Microsoft.VSTS.Common.ClosedDate] = '' AND [System.WorkItemType] NOT IN ('Test Suite', 'Test Plan')",
"WIQLOrderBit": "[System.ChangedDate] desc",
"Enabled": false,
"LinkMigration": true,
"AttachmentMigration": true,
"AttachmentWorkingPath": "c:\\temp\\WorkItemAttachmentWorkingFolder\\",
"FixHtmlAttachmentLinks": false,
"SkipToFinalRevisedWorkItemType": false,
"WorkItemCreateRetryLimit": 5,
"FilterWorkItemsThatAlreadyExistInTarget": true,
"PauseAfterEachWorkItem": false,
"AttachmentMaxSize": 480000000,
"CollapseRevisions": false,
"LinkMigrationSaveEachAsAdded": false,
"GenerateMigrationComment": true,
"NodeBasePaths": [
"Product\\Area\\Path1",
"Product\\Area\\Path2"
],
"WorkItemIDs": null
},
{
"ObjectType": "TestVariablesMigrationConfig",
"Enabled": false
},
{
"ObjectType": "TestConfigurationsMigrationConfig",
"Enabled": false
},
{
"ObjectType": "TestPlansAndSuitesMigrationConfig",
"PrefixProjectToNodes": false,
"Enabled": false,
"OnlyElementsWithTag": null,
"TestPlanQueryBit": null,
"RemoveInvalidTestSuiteLinks": false,
"FilterCompleted": false
},
{
"ObjectType": "ImportProfilePictureConfig",
"Enabled": false
},
{
"ObjectType": "ExportProfilePictureFromADConfig",
"Domain": null,
"Username": null,
"Password": null,
"PictureEmpIDFormat": null,
"Enabled": false
},
{
"ObjectType": "FixGitCommitLinksConfig",
"TargetRepository": "targetProjectName",
"Enabled": false,
"QueryBit": null,
"OrderBit": null
},
{
"ObjectType": "WorkItemUpdateConfig",
"WhatIf": false,
"Enabled": false,
"WIQLQueryBit": "AND [TfsMigrationTool.ReflectedWorkItemId] = '' AND [Microsoft.VSTS.Common.ClosedDate] = '' AND [System.WorkItemType] IN ('Shared Steps', 'Shared Parameter', 'Test Case', 'Requirement', 'Task', 'User Story', 'Bug')",
"WIQLOrderBit": null,
"WorkItemIDs": null,
"FilterWorkItemsThatAlreadyExistInTarget": false,
"PauseAfterEachWorkItem": false,
"WorkItemCreateRetryLimit": 0
},
{
"ObjectType": "WorkItemPostProcessingConfig",
"WorkItemIDs": [
1,
2,
3
],
"Enabled": false,
"WIQLQueryBit": "AND [TfsMigrationTool.ReflectedWorkItemId] = '' ",
"WIQLOrderBit": null,
"FilterWorkItemsThatAlreadyExistInTarget": false,
"PauseAfterEachWorkItem": false,
"WorkItemCreateRetryLimit": 0
},
{
"ObjectType": "WorkItemDeleteConfig",
"Enabled": false,
"WIQLQueryBit": "AND [Microsoft.VSTS.Common.ClosedDate] = '' AND [System.WorkItemType] NOT IN ('Test Suite', 'Test Plan')",
"WIQLOrderBit": "[System.ChangedDate] desc",
"WorkItemIDs": null,
"FilterWorkItemsThatAlreadyExistInTarget": false,
"PauseAfterEachWorkItem": false,
"WorkItemCreateRetryLimit": 0
},
{
"ObjectType": "WorkItemQueryMigrationConfig",
"PrefixProjectToNodes": false,
"SharedFolderName": "Shared Queries",
"SourceToTargetFieldMappings": {
"SourceFieldRef": "TargetFieldRef"
},
"Enabled": false
},
{
"ObjectType": "TeamMigrationConfig",
"Enabled": false,
"PrefixProjectToNodes": false,
"EnableTeamSettingsMigration": true
}
]
}

Are there sample configuration files to migrate team-specific work items when splitting and merging Azure DevOps Projects

We need to migrate selected work item types for a specific team (under area path X) from an on-prem TFS Server to Azure DevOps. We have tried to set the QueryBit and BasePaths to the source area path but are not having any success to filter the work items for the team.
Should we be using QueryBit or BasePaths, or both?
Are there any sample configuration files that can be used as a quick start or reference?
We have watched the overview video a couple of times and battling to find the relevant documentation.
You should be using the QueryBit to scope the workitem to just what you want. For a Team you should look to scope to specific area paths that are owned by that team.
The latest version has some example configs (not all in date) for reference in the SampleConfigs folder.
e.g.
{
"Version": "0.0",
"TelemetryEnableTrace": false,
"workaroundForQuerySOAPBugEnabled": false,
"ChangeSetMappingFile": null,
"Source": {
"Collection": "https://dev.azure.com/nkdagility-preview/",
"Project": "migrationSource1",
"ReflectedWorkItemIDFieldName": "Custom.ReflectedWorkItemId",
"AllowCrossProjectLinking": false,
"PersonalAccessToken": "",
"LanguageMaps": {
"AreaPath": "Area",
"IterationPath": "Iteration"
}
},
"Target": {
"Collection": "https://dev.azure.com/nkdagility-preview/",
"Project": "migrationTarget1",
"ReflectedWorkItemIDFieldName": "Custom.ReflectedWorkItemId",
"AllowCrossProjectLinking": false,
"PersonalAccessToken": "",
"LanguageMaps": {
"AreaPath": "Area",
"IterationPath": "Iteration"
}
},
"FieldMaps": [
{
"ObjectType": "MultiValueConditionalMapConfig",
"WorkItemTypeName": "*",
"sourceFieldsAndValues": {
"Field1": "Value1",
"Field2": "Value2"
},
"targetFieldsAndValues": {
"Field1": "Value1",
"Field2": "Value2"
}
},
{
"ObjectType": "FieldBlankMapConfig",
"WorkItemTypeName": "*",
"targetField": "TfsMigrationTool.ReflectedWorkItemId"
},
{
"ObjectType": "FieldValueMapConfig",
"WorkItemTypeName": "*",
"sourceField": "System.State",
"targetField": "System.State",
"defaultValue": "New",
"valueMapping": {
"Approved": "New",
"New": "New",
"Committed": "Active",
"In Progress": "Active",
"To Do": "New",
"Done": "Closed",
"Removed": "Removed"
}
},
{
"ObjectType": "FieldtoFieldMapConfig",
"WorkItemTypeName": "*",
"sourceField": "Microsoft.VSTS.Common.BacklogPriority",
"targetField": "Microsoft.VSTS.Common.StackRank",
"defaultValue": null
},
{
"ObjectType": "FieldtoFieldMultiMapConfig",
"WorkItemTypeName": "*",
"SourceToTargetMappings": {
"SourceField1": "TargetField1",
"SourceField2": "TargetField2"
}
},
{
"ObjectType": "FieldtoTagMapConfig",
"WorkItemTypeName": "*",
"sourceField": "System.State",
"formatExpression": "ScrumState:{0}"
},
{
"ObjectType": "FieldMergeMapConfig",
"WorkItemTypeName": "*",
"sourceField1": "System.Description",
"sourceField2": "Microsoft.VSTS.Common.AcceptanceCriteria",
"targetField": "System.Description",
"formatExpression": "{0} <br/><br/><h3>Acceptance Criteria</h3>{1}",
"doneMatch": "##DONE##"
},
{
"ObjectType": "RegexFieldMapConfig",
"WorkItemTypeName": "*",
"sourceField": "COMPANY.PRODUCT.Release",
"targetField": "COMPANY.DEVISION.MinorReleaseVersion",
"pattern": "PRODUCT \\d{4}.(\\d{1})",
"replacement": "$1"
},
{
"ObjectType": "FieldValuetoTagMapConfig",
"WorkItemTypeName": "*",
"sourceField": "Microsoft.VSTS.CMMI.Blocked",
"pattern": "Yes",
"formatExpression": "{0}"
},
{
"ObjectType": "TreeToTagMapConfig",
"WorkItemTypeName": "*",
"toSkip": 3,
"timeTravel": 1
}
],
"WorkItemTypeDefinition": { "sourceWorkItemTypeName": "targetWorkItemTypeName" },
"GitRepoMapping": null,
"Processors": [
{
"ObjectType": "NodeStructuresMigrationConfig",
"PrefixProjectToNodes": false,
"Enabled": false,
"BasePaths": [ "Product\\Area\\Path1", "Product\\Area\\Path2" ]
},
{
"ObjectType": "WorkItemMigrationConfig",
"ReplayRevisions": true,
"PrefixProjectToNodes": false,
"UpdateCreatedDate": true,
"UpdateCreatedBy": true,
"BuildFieldTable": false,
"AppendMigrationToolSignatureFooter": false,
"QueryBit": "AND [Microsoft.VSTS.Common.ClosedDate] = '' AND [System.WorkItemType] NOT IN ('Test Suite', 'Test Plan')",
"OrderBit": "[System.ChangedDate] desc",
"Enabled": false,
"LinkMigration": true,
"AttachmentMigration": true,
"AttachmentWorkingPath": "c:\\temp\\WorkItemAttachmentWorkingFolder\\",
"FixHtmlAttachmentLinks": false,
"SkipToFinalRevisedWorkItemType": false,
"WorkItemCreateRetryLimit": 5,
"FilterWorkItemsThatAlreadyExistInTarget": true,
"PauseAfterEachWorkItem": false,
"AttachmentMaxSize": 480000000,
"CollapseRevisions": false,
"LinkMigrationSaveEachAsAdded": false
},
{
"ObjectType": "TestVariablesMigrationConfig",
"Enabled": false
},
{
"ObjectType": "TestConfigurationsMigrationConfig",
"Enabled": false
},
{
"ObjectType": "TestPlansAndSuitesMigrationConfig",
"PrefixProjectToNodes": false,
"Enabled": false,
"OnlyElementsWithTag": null,
"TestPlanQueryBit": null,
"RemoveInvalidTestSuiteLinks": false
},
{
"ObjectType": "ImportProfilePictureConfig",
"Enabled": false
},
{
"ObjectType": "ExportProfilePictureFromADConfig",
"Domain": null,
"Username": null,
"Password": null,
"PictureEmpIDFormat": null,
"Enabled": false
},
{
"ObjectType": "FixGitCommitLinksConfig",
"TargetRepository": "migrationTarget1",
"Enabled": false,
"QueryBit": null,
"OrderBit": null
},
{
"ObjectType": "WorkItemUpdateConfig",
"WhatIf": false,
"QueryBit": "AND [TfsMigrationTool.ReflectedWorkItemId] = '' AND [Microsoft.VSTS.Common.ClosedDate] = '' AND [System.WorkItemType] IN ('Shared Steps', 'Shared Parameter', 'Test Case', 'Requirement', 'Task', 'User Story', 'Bug')",
"Enabled": false
},
{
"ObjectType": "WorkItemPostProcessingConfig",
"QueryBit": "AND [TfsMigrationTool.ReflectedWorkItemId] = '' ",
"WorkItemIDs": [ 1, 2, 3 ],
"Enabled": false
},
{
"ObjectType": "WorkItemDeleteConfig",
"Enabled": false
},
{
"ObjectType": "WorkItemQueryMigrationConfig",
"PrefixProjectToNodes": false,
"SharedFolderName": "Shared Queries",
"SourceToTargetFieldMappings": { "SourceFieldRef": "TargetFieldRef" },
"Enabled": false
},
{
"ObjectType": "TeamMigrationConfig",
"Enabled": false,
"PrefixProjectToNodes": false,
"EnableTeamSettingsMigration": true
}
]
}
The main workhorse is the WorkItemMigrationConfig that contains the QueryBit.
{
"ObjectType": "WorkItemMigrationConfig",
"ReplayRevisions": true,
"PrefixProjectToNodes": false,
"UpdateCreatedDate": true,
"UpdateCreatedBy": true,
"BuildFieldTable": false,
"AppendMigrationToolSignatureFooter": false,
"QueryBit": "AND [Microsoft.VSTS.Common.ClosedDate] = '' AND [System.WorkItemType] NOT IN ('Test Suite', 'Test Plan')",
"OrderBit": "[System.ChangedDate] desc",
"Enabled": false,
"LinkMigration": true,
"AttachmentMigration": true,
"AttachmentWorkingPath": "c:\\temp\\WorkItemAttachmentWorkingFolder\\",
"FixHtmlAttachmentLinks": false,
"SkipToFinalRevisedWorkItemType": false,
"WorkItemCreateRetryLimit": 5,
"FilterWorkItemsThatAlreadyExistInTarget": true,
"PauseAfterEachWorkItem": false,
"AttachmentMaxSize": 480000000,
"CollapseRevisions": false,
"LinkMigrationSaveEachAsAdded": false
},
This particular query bit is my goto default and excludes closed items nad test Suits, and Plans.
"QueryBit": "AND [Microsoft.VSTS.Common.ClosedDate] = '' AND [System.WorkItemType] NOT IN ('Test Suite', 'Test Plan')"
To scope just to a Team you may use:
"QueryBit": "AND [System.Area] = '\MyTeamName' AND [System.WorkItemType] NOT IN ('Test Suite', 'Test Plan')"

out of 17 Task work items 15 are coming and 2 Task are not migrate

I have used the version of 10.2 and facing one of the issue following
Issue is that out of 17 Task work items 15 are coming and 2 Task are not migrated but in that place two Product backlog item created with no title and state is coming with new state
Here is my config file:
{ "Version": "10.2",
"TelemetryEnableTrace": false,
"workaroundForQuerySOAPBugEnabled": false,
"ChangeSetMappingFile": null,
"Source": {
"Collection": "",
"Project": "Road To NPD 3.0",
"ReflectedWorkItemIDFieldName": "PATTInitiativesRefID",
"AllowCrossProjectLinking": false,
"PersonalAccessToken": "",
"LanguageMaps": {
"AreaPath": "Road To NPD 3.0",
"IterationPath": "Road To NPD 3.0"
} }, "Target": {
"Collection": "",
"Project": "AS-Scrum-RoadToNPD3.0",
"ReflectedWorkItemIDFieldName": "AutoSolScrumRefID",
"AllowCrossProjectLinking": false,
"PersonalAccessToken": "",
"LanguageMaps": {
"AreaPath": "AS-Scrum-RoadToNPD3.0",
"IterationPath": "AS-Scrum-RoadToNPD3.0" } }, "FieldMaps": [
{
"ObjectType": "MultiValueConditionalMapConfig",
"WorkItemTypeName": "*",
"sourceFieldsAndValues": {
"Field1": "Value1",
"Field2": "Value2"
},
"targetFieldsAndValues": {
"Field1": "Value1",
"Field2": "Value2"
}
},
{
"ObjectType": "FieldBlankMapConfig",
"WorkItemTypeName": "*",
"targetField": "TfsMigrationTool.ReflectedWorkItemId"
},
{
"ObjectType": "FieldValueMapConfig",
"WorkItemTypeName": "*",
"sourceField": "System.State",
"targetField": "System.State",
"defaultValue": "New",
//"valueMapping": {
// "Approved": "New",
//"New": "New",
//"Committed": "Active",
//"In Progress": "Active",
//"To Do": "New",
//"Done": "Closed",
//"Removed": "Removed"
//}
},
{
"ObjectType": "FieldtoFieldMapConfig",
"WorkItemTypeName": "*",
"sourceField": "Microsoft.VSTS.Common.BacklogPriority",
"targetField": "Microsoft.VSTS.Common.StackRank",
"defaultValue": null
},
{
"ObjectType": "FieldtoFieldMultiMapConfig",
"WorkItemTypeName": "*",
"SourceToTargetMappings": {
"SourceField1": "TargetField1",
"SourceField2": "TargetField2"
}
},
{
"ObjectType": "FieldtoTagMapConfig",
"WorkItemTypeName": "*",
"sourceField": "System.State",
"formatExpression": "ScrumState:{0}"
},
{
"ObjectType": "FieldMergeMapConfig",
"WorkItemTypeName": "*",
"sourceField1": "System.Description",
"sourceField2": "Microsoft.VSTS.Common.AcceptanceCriteria",
"targetField": "System.Description",
"formatExpression": "{0} <br/><br/><h3>Acceptance Criteria</h3>{1}",
"doneMatch": "##DONE##"
},
{
"ObjectType": "RegexFieldMapConfig",
"WorkItemTypeName": "*",
"sourceField": "COMPANY.PRODUCT.Release",
"targetField": "COMPANY.DEVISION.MinorReleaseVersion",
"pattern": "PRODUCT \\d{4}.(\\d{1})",
"replacement": "$1"
},
{
"ObjectType": "FieldValuetoTagMapConfig",
"WorkItemTypeName": "*",
"sourceField": "Microsoft.VSTS.CMMI.Blocked",
"pattern": "Yes",
"formatExpression": "{0}"
},
{
"ObjectType": "TreeToTagMapConfig",
"WorkItemTypeName": "*",
"toSkip": 3,
"timeTravel": 1
} ], "WorkItemTypeDefinition": {
"Product Backlog Item": "Product Backlog Item", "Epic": "Epic", "Task": "Task" }, "GitRepoMapping": null, "Processors": [
{
"ObjectType": "NodeStructuresMigrationConfig",
"PrefixProjectToNodes": false,
"Enabled": false,
"BasePaths": [
"Product\\Area\\Path1",
"Product\\Area\\Path2"
]
},
{
"ObjectType": "WorkItemMigrationConfig",
"ReplayRevisions": true,
"PrefixProjectToNodes": false,
"UpdateCreatedDate": true,
"UpdateCreatedBy": true,
"BuildFieldTable": false,
"AppendMigrationToolSignatureFooter": false,
"QueryBit": "AND [Microsoft.VSTS.Common.ClosedDate] != '' AND [System.WorkItemType] IN ('Task')",
"OrderBit": "[System.ChangedDate] desc",
"Enabled": true,
"LinkMigration": true,
"AttachmentMigration": true,
"AttachmentWorkingPath": "c:\\temp\\WorkItemAttachmentWorkingFolder\\",
"FixHtmlAttachmentLinks": false,
"SkipToFinalRevisedWorkItemType": false,
"WorkItemCreateRetryLimit": 5,
"FilterWorkItemsThatAlreadyExistInTarget": true,
"PauseAfterEachWorkItem": false,
"AttachmentMazSize": 480000000,
"CollapseRevisions": false,
"LinkMigrationSaveEachAsAdded": false
} ] }
This issue is due to some code malfunctioning that is responsible for changing the work item type which is not possible in the old Object Model. Some folks have had issues with it, and so there is SkipToFinalRevisedWorkItemType that can be added to look at the type of the last revision and use that rather than trying to mess around in between.
{
"ObjectType": "WorkItemMigrationConfig",
"ReplayRevisions": true,
"PrefixProjectToNodes": false,
"UpdateCreatedDate": true,
"UpdateCreatedBy": true,
"BuildFieldTable": false,
"AppendMigrationToolSignatureFooter": false,
"QueryBit": "AND [Microsoft.VSTS.Common.ClosedDate] != '' AND [System.WorkItemType] IN ('Task')",
"OrderBit": "[System.ChangedDate] desc",
"Enabled": true,
"LinkMigration": true,
"AttachmentMigration": true,
"AttachmentWorkingPath": "c:\\temp\\WorkItemAttachmentWorkingFolder\\",
"FixHtmlAttachmentLinks": false,
"SkipToFinalRevisedWorkItemType": true,
"WorkItemCreateRetryLimit": 5,
"FilterWorkItemsThatAlreadyExistInTarget": true,
"PauseAfterEachWorkItem": false,
"AttachmentMazSize": 480000000,
"CollapseRevisions": false,
"LinkMigrationSaveEachAsAdded": false
} ] }
Here I updated "SkipToFinalRevisedWorkItemType" to be true instead of false.