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.

Note

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.

Prerequisites

Install and import the module

  1. In Windows, open a PowerShell Window, form Mac or Linux, open a terminal and run the pwsh command to start PowerShell.

  2. 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.

Go to Artifacts Home, Select Connect to Feed Copy the index URL

Get Index URL from MyGet

  1. Log into your MyGet Account and navigate to the feed you want to migrate.

  2. Select Feed Details

  3. 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.

  1. You can skip this step if your source feed is public.
$password = ConvertTo-SecureString -String '<your password here>' -AsPlainText -Force
  1. 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 -Verbose switch 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
  1. After a successful migration, you should see output with the number of packages copied.

Note

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.

Next Steps

For more information about NuGet packages in Azure Artifacts, see the Get Started guide

Open source

This module is open source on GitHub. Feedback and contributions are welcome.