'Migrate Azure Devops Artifacts between organizations
I am trying to migrate (clone) an Azure Devops project to another project / organization. I successfully
- cloned the repos
- migrated the work items using Azure DevOps Migration Tools by NkdAgility
- I exported the build and release pipelines as json files and imported them again.
- I created a selfhosted agent on my VM and trying to run the build pipelines - the job "dotnet restore" on that.
- I created a new feed under Artifacts. Unfortunately the job with dotnet restore fails because it relies on the artifacts only available in the old project
How can I migrate the packages from the feeds of the old project to the new one(s)?
I assume I am supposed to clone the feeds of the old project somehow so that I can simply update the nuget.config with the name of the new organization. Thank you in advance.
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<!-- remove any machine-wide sources with <clear/> -->
<clear />
<!-- also get packages from the NuGet Gallery -->
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
<add key="DotNetArcade" value="https://dotnetfeed.blob.core.windows.net/dotnet-core/index.json" />
<add key="<OLD_FEED1" value="https://pkgs.dev.azure.com/<old org>/_packaging/<OLD_FEED1>/nuget/v3/index.json" />
<add key="<OLD_FEED2" value="https://pkgs.dev.azure.com/<old org>/_packaging/<OLD_FEED2>/nuget/v3/index.json" />
<add key="<OLD_FEED3" value="https://pkgs.dev.azure.com/<old org>/_packaging/<OLD_FEED3>/nuget/v3/index.json" />
</packageSources>
<activePackageSource>
<add key="All" value="(Aggregate source)" />
</activePackageSource>
</configuration>
Solution 1:[1]
I assume I am supposed to clone the feeds of the old project somehow so that I can simply update the nuget.config with the name of the new organization.
I am afraid there is no such out of box way to achieve this at this moment.
You could clear the local cache of the packages for the old project A, then restore those packages from the old feed.
In this way, those packages are restored on your local, the default path is:
C:\Users\<username>\.nuget\packages
Then we could use the nuget.exe to push those package to your new feed.
Of course?you could check the Daniel`s suggestion, to use the REST API to get the package Id list, then install them and push them to the new feed.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Leo Liu-MSFT |
