1

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?

Jason Aller
  • 3,541
  • 28
  • 38
  • 38
Yeshwanth
  • 11
  • 1

2 Answers2

0

Follow the below steps to perform the migration operation.

dotnet tool install gpr -g
gpr push MyFakePackage.1.0.0.50.nupkg --repository https://github.com/MyRepo/my-repo-name

These two are the simple two lines of syntaxes to follow for migration.

Sairam Tadepalli
  • 1,563
  • 1
  • 3
  • 11
  • Pasting some code doesn’t explain what’s going on. It’d be great if you could share some documentation or why/what this does – KoalaZub Oct 04 '22 at 23:55
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).
Josh Johanning
  • 840
  • 9
  • 16