0
votes

I'm currently working on my organizations migration from on prem nuget (v2) to Azure DevOps Artifacts. (Cloud) We've got a few dozen packages with a variety of versions that I'd like to shove into AzDo Artifacts. It looks like I could do this with powershell and use \MyFileSharePath***.nupkg as the path and it ought grab them all and push each individual version of each package.

Is this a viable approach? Is there a better method I should look into?

This question appears similar but involves all on prem sources. Not sure if that matters.:

Can I upload existing NuGet packages to an Azure DevOps artifacts feed?

2

2 Answers

1
votes

This is valid approach and it is recommended in the documentation

For each share, push all packages in the share to the new feed: nuget push {your package path}*.nupkg -Source {your NuGet package source URL} -ApiKey Azure DevOps Services

You have there also good tip about making your current feed read only

For larger teams, you should consider marking each share as read-only before doing the nuget push operation to ensure no one adds or updates packages during your migration.

Thus I think there is not better way of doing this.

0
votes

The command I wound up using was:

.\nuget.exe push [LocalPackageStorage]\**\*.nupkg -source [Our Azure DevOps Artifacts Feed] -apikey [Any Non null string] -timeout 1200

Note that this recursively goes through your whole structure and grabs each version of each package there. It ran smoothly but the first time I ran it I had it fail prematurely because the default timeout on push is 300 seconds. When this happened I wound up nuking the feed because I'm working in a green field scenario and it was fastest to just wipe it out and start over rather than figure out which ones had, or had not, been uploaded. If you're not working in a similar greenfield scenario be very careful of this as it could lead to lots of very annoying work sorting out what was, and was not, done.