Migrate your packages to Azure Artifacts
Using the AzureArtifactsPackageMigration PowerShell module, you can easily migrate your NuGet packages from MyGet. Future development will support migration from other packaging solutions and package types.
This does not remove the packages from your current package feed. It copies them to your Azure Artifacts feed and will not interfere with use of the source feed.
- The NuGet CLI
- An Azure DevOps Services account
- An Azure Artifacts feed
- A PAT. A Personal Access Token to authenticate your feed.
- PowerShell. The AzureArtifactsPackageMigration module works with latest versions of PowerShell. With Windows, you need at least version 5.1. For Linux or Mac, you will need at least version 6.
Install and import the module
In Windows, open a PowerShell Window, form Mac or Linux, open a terminal and run the
pwshcommand to start PowerShell.
Run the following commands to install the module and import it into your current session.
Install-Module -Name AzureArtifactsPackageMigration -Scope CurrentUser -Force Import-Module -Name AzureArtifactsPackageMigration
Alternatively, you can download it from the GitHub page.
Collect URLs to transfer packages
To migrate your packages, you will need the index URL to your source, and destination feeds.
Get Azure Artifacts Index URL
You can easily copy the destination URL from the Connect to feed dialog box.
Get Index URL from MyGet
Log into your MyGet Account and navigate to the feed you want to migrate.
Select Feed Details
Copy the NuGet V3 feed URL
Run the migration
If your source feed is not public, you will need to create a
SecureString to use as your password to access it.
- You can skip this step if your source feed is public.
$password = ConvertTo-SecureString -String '<your password here>' -AsPlainText -Force
- Using the source and destination index URLs you collected earlier, run the following command based on your need. To have less output, simply remove the
-Verboseswitch from the command.
# Migrate packages from a private source feed. Move-MyGetNuGetPackages -SourceIndexUrl '<your source index url here>' -DestinationIndexUrl '<your destination index url here>' -DestinationPAT '<your destination PAT string here>' -DestinationFeedName '<your destination feed name>' -SourceUsername '<username for source feed>' -SourcePassword $password -Verbose
# Migrate packages from a public source feed. Move-MyGetNuGetPackages -SourceIndexUrl '<your source index url here>' -DestinationIndexUrl '<your destination index url here>' -DestinationPAT '<your destination PAT string here>' -DestinationFeedName '<your destination feed name>' -Verbose
- After a successful migration, you should see output with the number of packages copied.
This module uses NuGet and your local environment to migrate packages. Depending on the size and amount of packages you are moving, this could take up to an hour or more.
For more information about NuGet packages in Azure Artifacts, see the Get Started guide
This module is open source on GitHub. Feedback and contributions are welcome.