Is there any simple way to migrate Azure Devops artifacts to GitHub packages? We have few artifacts which need to be migrated. Are there any tools available to do this?
migrate Azure Devops artifacts to GitHub packages
614 Views Asked by Yeshwanth At
2
There are 2 best solutions below
0

I expanded upon @TadepalliSairam's solution a little bit here: https://josh-ops.com/posts/github-packages-migrate-nuget-packages-to-github-packages/. This is a post detailing a script that migrates .nupkg
files to GitHub Packages.
Basically, you have to use gpr
since it rewrites the <repository url="..." />
element in the .nuspec file in the .nupkg before pushing.
dotnet nuget push
isn't capable of doing this and you will receive a 400
error right now:
dotnet nuget push \
-s github \
-k ghp_pat \
NUnit3.DotNetNew.Template_1.7.1.nupkg
Pushing NUnit3.DotNetNew.Template_1.7.1.nupkg to 'https://nuget.pkg.github.com/joshjohanning-org-packages-migrated'...
PUT https://nuget.pkg.github.com/joshjohanning-org-packages-migrated/
warn : Source owner 'joshjohanning-org-packages-migrated' does not match repo owner 'joshjohanning-org-packages' in repository element.
BadRequest https://nuget.pkg.github.com/joshjohanning-org-packages-migrated/ 180ms
error: Response status code does not indicate success: 400 (Bad Request).
Follow the below steps to perform the migration operation.
These two are the simple two lines of syntaxes to follow for migration.