2

Can someone please let me know the detailed process in migrating Git repositories and their associated Azure Devops pipelines from one Azure project to another Azure project, which should include the history of all branches - master, development and existing feature branches.

Also how to test if the Azure DevOps pipelines are functional after the migration is completed.

Sasidhar
  • 61
  • 1
  • 6
  • Any update for this issue? Have you resolved this issue? If not, would you please let me know the latest information about this issue? – Leo Liu Apr 17 '20 at 07:41
  • 1
    Yes, I'm able to migrate the pipelines onto new organization and project folders. But, can someone please let me know how to trigger release for pipeline only in particular environment, like ONLY in DevTest, NOT in production. – Sasidhar Apr 17 '20 at 19:24
  • It seems you have resolved this issue, if yes, would you mind share your solution as answer? So it could help other community members who get the same issues. For the question in the comment, I could simple answer there is no such way to do this, or you could open a new thread with more detailed info, so that we could check if there is any solution/workaround for this issue. – Leo Liu Apr 20 '20 at 07:48
  • 1
    I didn't work on moving the repositories I think the repos are probably cloned to local & then imported under new project namespace. I worked on migrating the build & release pipelines associated with those repos by exporting the pipelines into JSON, and then importing the JSON, configuring the service connections, variable etc.. before test running build & release pipelines. – Sasidhar Apr 21 '20 at 17:02
  • Got it. If you are not work on moving the repositories, you could update your question to make it more clear. And would you please convert your comment to the answer? This can be beneficial to other community members reading the answer, avoid spending a lot of time on a post that already has an answer. Thanks. – Leo Liu Apr 22 '20 at 09:25

3 Answers3

0

Here you have command to migrate repo:

git clone --mirror <url_of_old_repo>
cd <name_of_old_repo>
git remote add new-origin <url_of_new_repo>
git push new-origin --mirror

But later you have to recreate your pipelines based on existing yaml. This is simple as on template page you can select existing yaml file.

You can also try approach with REST. This can be handy for classic release pipelines.

You should also check this question.

Krzysztof Madej
  • 32,704
  • 10
  • 78
  • 107
0

Migrate Git repositories & associated pipelines between Azure Team projects

I am afraid there is no such out of box way to achieve this at this moment.

There is a Under Review user voice about it:

Explore how to move git repositories between Team Projects with full-fidelity history

With above document, we could migrate git repositories to anther team projects with full-fidelity history.

However, we could not do much more for those associated pipelines. There is no such way to get all the associated pipelines directly. To resolve this, we need use powershell scripts and REST API Definitions - List to traverse all the build definitions and find out that the repo name is the build definitions of the specified repo.

Then, use the REST API Definitions - Create to create a new pipelines in another team project.

You could check this thread for some more details.

Hope this helps.

Leo Liu
  • 71,098
  • 10
  • 114
  • 135
0

This is really two questions that should be approached separately (git / pipelines), though granted they can are interlinked.

I can only comment on git migration.

Git Migration from Azure DevOps to Azure DevOps Note: this will probably work for other git sources.

  1. In the old Azure DevOps repo, perform a clone git repo. This will give you credentials that you will need for the later step.
  2. In the new Azure DevOps repo, perform the import using the following repos -> files then on the project name, select the drop down which will show import repository. Using your URL from the old system and the credentials, you can then import.
  3. You will then receive an email to say that your account has migrated.
  4. Further details can be found at this page on MS Azure DevOps
Marcus D
  • 1,074
  • 1
  • 12
  • 27