Showing posts with label azuredevops. Show all posts
Showing posts with label azuredevops. Show all posts

Saturday, January 6, 2024

Migrating Git Repositories: A Step-by-Step Guide


Introduction:

Migrating Git repositories can be a crucial task, especially when transitioning from one hosting provider to another or restructuring your project. In this guide, we'll walk through a step-by-step process for migrating a repository from one Git link to another using practical examples.

Step 1: Clone the Source Repository

bash
git clone --bare <SOURCE_REPO_LINK>

The --bare flag ensures that you create a bare clone of the source repository, including all branches and commit history.

Step 2: Clone the Destination Repository

bash
    git clone https://<USERNAME>@<DESTINATION_REPO_LINK>
    cd <DESTINATION_REPO_NAME>

Navigate to the destination repository after cloning it.

Step 3: Checkout and Prepare the Destination Branch

bash
git checkout <DESTINATION_BRANCH_NAME>

Switch to the branch where you want to merge the source repository changes.

Step 4: Add Remote for Source Repository

bash
git remote add source-repo /path/to/source/repo.git

Add a remote reference to the source repository.

Step 5: Fetch Changes from Source Repository

bash
git fetch --all

Fetch all branches and changes from the source repository.

Step 6: Merge Source Repository Changes

bash
git merge source-repo/<SOURCE_BRANCH_NAME>

Merge the changes from the source repository into the destination branch.

Step 7: Push Changes to the Destination Repository

bash
git push origin <DESTINATION_BRANCH_NAME>

Push the merged changes to the destination repository.

Step 8: Repeat for Master Branch

bash
git checkout master
git fetch --all
git merge source-repo/master
git push origin master

Repeat the process for the master branch.

Conclusion:

Migrating Git repositories involves careful coordination between the source and destination repositories. By following these step-by-step instructions, you can ensure a smooth migration process while preserving commit history and branches. Always make sure to backup your repositories before initiating any migration to avoid data loss.

Thursday, October 27, 2022

Err work item is not ready save - nkd azure devops migration tool

 

I am trying to migrate the workitems from one azure devops org to other azure devops org project.

ERR] System.InvalidOperationException: This path is not anchored in the source project name: it   at MigrationTools.Enrichers.TfsNodeStructure.GetNewNodeName(String sourceNodePath, TfsNodeStructureType nodeStructureType) in D:\a\1\s\src\MigrationTools.Clients.AzureDevops.ObjectModel\ProcessorEnrichers\TfsNodeStructure.cs:line 99   at VstsSyncMigrator.Engine.WorkItemMigrationContext.PopulateWorkItem(WorkItemData oldWi, WorkItemData newwit, String destType) in D:\a\1\s\src\VstsSyncMigrator.Core\Execution\MigrationContext\WorkItemMigrationContext.cs:line 402   at VstsSyncMigrator.Engine.WorkItemMigrationContext.ReplayRevisions(List`1 revisionsToMigrate, WorkItemData sourceWorkItem, WorkItemData targetWorkItem) in D:\a\1\s\src\VstsSyncMigrator.Core\Execution\MigrationContext\WorkItemMigrationContext.cs:line 642[14:23:01 INF] ===============================================================[14:23:01 DBG] TfsExtensions::SaveToAzureDevOps

[14:23:01 DBG] TfsExtensions::SaveToAzureDevOps: ChangedBy: , AuthorisedBy: Nnkata[14:23:01 WRN] Work Item is not ready to save as it has some invalid fields. This may not result in an error. Enable LogLevel as 'Debug' in the config to see more.[14:23:01 DBG] --------------------------------------------------------------------------------------------------------------------

[14:23:01 DBG] --------------------------------------------------------------------------------------------------------------------

[14:23:01 DBG] TfsExtensions::ToJson

[14:23:01 DBG] Invalid Field Object:

{

  "WorkItemId": 0,

  "CurrentRevisionWorkItemRev": 0,

  "CurrentRevisionWorkItemTypeName": "Feature",

  "Name": "Area Path",

  "ReferenceName": "System.AreaPath",

  "Value": "i",

  "OriginalValue": "",

  "ValueWithServerDefault": "",

  "Status": 16,

  "IsRequired": true,

  "IsEditable": true,

  "IsDirty": true,

  "IsComputed": true,

  "IsChangedByUser": true,

  "IsChangedInRevision": true,

  "HasPatternMatch": false,

  "IsLimitedToAllowedValues": false,

  "HasAllowedValuesList": false,

  "AllowedValues": [],

  "IdentityFieldAllowedValues": [],

  "ProhibitedValues": []

}

[14:23:01 DBG] TfsExtensions::ToJson

[14:23:01 DBG] Invalid Field Object:

{

  "WorkItemId": 0,

  "CurrentRevisionWorkItemRev": 0,

  "CurrentRevisionWorkItemTypeName": "Feature",

  "Name": "Iteration Path",

  "ReferenceName": "System.IterationPath",

  "Value": "\\Admin Portal\\Sprint 14 Sep - 25 Sep",

  "OriginalValue": "",

  "ValueWithServerDefault": "\\Admin Portal\\Sprint 14 Sep - 25 Sep",

  "Status": 16,

  "IsRequired": true,

  "IsEditable": true,

  "IsDirty": true,

  "IsComputed": true,

  "IsChangedByUser": true,

  "IsChangedInRevision": true,

  "HasPatternMatch": false,

  "IsLimitedToAllowedValues": false,

  "HasAllowedValuesList": false,

  "AllowedValues": [],

  "IdentityFieldAllowedValues": [],

  "ProhibitedValues": []

}

[14:23:01 DBG] --------------------------------------------------------------------------------------------------------------------

[14:23:01 DBG] --------------------------------------------------------------------------------------------------------------------

[14:23:01 ERR] Microsoft.TeamFoundation.WorkItemTracking.Client.ValidationException: TF237124: Work Item is not ready to save

   at Microsoft.TeamFoundation.WorkItemTracking.Client.WorkItem.Save(SaveFlags saveFlags)

   at MigrationTools.TfsExtensions.SaveToAzureDevOps(WorkItemData context) in D:\a\1\s\src\MigrationTools.Clients.AzureDevops.ObjectModel\TfsExtensions.cs:line 77

   at VstsSyncMigrator.Engine.WorkItemMigrationContext.<ProcessWorkItemAsync>d__35.MoveNext() in D:\a\1\s\src\VstsSyncMigrator.Core\Execution\MigrationContext\WorkItemMigrationContext.cs:line 505

Microsoft.TeamFoundation.WorkItemTracking.Client.ValidationException: TF237124: Work Item is not ready to save

   at Microsoft.TeamFoundation.WorkItemTracking.Client.WorkItem.Save(SaveFlags saveFlags)

   at MigrationTools.TfsExtensions.SaveToAzureDevOps(WorkItemData context) in D:\a\1\s\src\MigrationTools.Clients.AzureDevops.ObjectModel\TfsExtensions.cs:line 77

   at VstsSyncMigrator.Engine.WorkItemMigrationContext.<ProcessWorkItemAsync>d__35.MoveNext() in D:\a\1\s\src\VstsSyncMigrator.Core\Execution\MigrationContext\WorkItemMigrationContext.cs:line 505

[14:23:01 ERR] Could not save migrated work item 696, an exception occurred.

System.AggregateException: One or more errors occurred. ---> Microsoft.TeamFoundation.WorkItemTracking.Client.ValidationException: TF237124: Work Item is not ready to save

   at VstsSyncMigrator.Engine.WorkItemMigrationContext.<ProcessWorkItemAsync>d__35.MoveNext() in D:\a\1\s\src\VstsSyncMigrator.Core\Execution\MigrationContext\WorkItemMigrationContext.cs:line 550

   --- End of inner exception stack trace ---

   at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)

   at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)

   at VstsSyncMigrator.Engine.WorkItemMigrationContext.InternalExecute() in D:\a\1\s\src\VstsSyncMigrator.Core\Execution\MigrationContext\WorkItemMigrationContext.cs:line 205

---> (Inner Exception #0) Microsoft.TeamFoundation.WorkItemTracking.Client.ValidationException: TF237124: Work Item is not ready to save

   at VstsSyncMigrator.Engine.WorkItemMigrationContext.<ProcessWorkItemAsync>d__35.MoveNext() in D:\a\1\s\src\VstsSyncMigrator.Core\Execution\MigrationContext\WorkItemMigrationContext.cs:line 550<---

[14:23:01 WRN] The following items could not be migrated: 696

[14:23:01 INF] DONE in 00:08:24.0134378

[14:23:01 FTL] Error while running WorkItemMigration

System.AggregateException: One or more errors occurred. ---> Microsoft.TeamFoundation.WorkItemTracking.Client.ValidationException: TF237124: Work Item is not ready to save

   at VstsSyncMigrator.Engine.WorkItemMigrationContext.<ProcessWorkItemAsync>d__35.MoveNext() in D:\a\1\s\src\VstsSyncMigrator.Core\Execution\MigrationContext\WorkItemMigrationContext.cs:line 550

   --- End of inner exception stack trace ---

   at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)

   at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)

   at VstsSyncMigrator.Engine.WorkItemMigrationContext.InternalExecute() in D:\a\1\s\src\VstsSyncMigrator.Core\Execution\MigrationContext\WorkItemMigrationContext.cs:line 225

   at MigrationTools._EngineV1

Migrate the Azure DevOps workitems from One Azure Devops org project to another Azure DevOps Org project

When migrating found that the Area path is different at the time of creation , after few days we changed to different Area Path name.

Can anyone help how we can skip or take force migration for Target project?



SOLUTION:


Is this because you have the ReplayRevisions set to true In Configuration.json file, and it is replaying all the revisions

Featured Post

Ansible Tool Introduction

                                                                                                                                    Next ...