Migrate your packages from MyGet to Azure Artifacts
Azure DevOps Services
Using the AzureArtifactsPackageMigration PowerShell module, you can easily migrate your NuGet packages to Azure Artifacts. This article will walk you through an example of migrating NuGet packages from MyGet to Azure Artifacts.
In this article, you'll learn how to:
- Install the AzureArtifactsPackageMigration PowerShell module.
- Connect to Azure Artifacts feeds.
- Migrate to Azure Artifacts.
Prerequisites
An Azure DevOps organization and a project. Create an organization or a project if you haven't already.
An Azure Artifacts feed. Create a new feed if you don't have one already.
Install Azure Artifacts Credential Provider.
A personal access token to authenticate with Azure DevOps.
Install PowerShell module
Using the command line interface, run the provided commands to install and import the PowerShell module. You can also download the migration scripts directly from the azure-artifacts-migration GitHub repository.
Open a PowerShell prompt window.
Run the following commands to install the
AzureArtifactsPackageMigration
PowerShell module and import it into your current session.Install-Module -Name AzureArtifactsPackageMigration -Scope CurrentUser -Force Import-Module -Name AzureArtifactsPackageMigration
Migration setup
To migrate your packages, you'll need to get the source URLs for both the source feed (MyGet) and destination feed (Azure Artifacts).
Azure Artifacts
Sign in to your Azure DevOps organization, and then navigate to your project.
Select Artifacts, select your feed from the dropdown menu and then select Connect to feed.
Select NuGet.exe and then copy your feed's source URL.
Project-scoped feed:
https://pkgs.dev.azure.com/<ORGANIZATION_NAME>/<PROJECT_NAME>/_packaging/<FEED_NAME>/nuget/v3/index.json
Organization-scoped feed:
https://pkgs.dev.azure.com/<ORGANIZATION_NAME>/_packaging/<FEED_NAME>/nuget/v3/index.json
MyGet
Sign in to your MyGet Account.
Navigate to the feed you wish to migrate.
Select Feed Details.
Select Packages and then copy your NuGet V3 feed URL.
https://www.myget.org/F/<FEED_NAME>/api/v3/index.json
Migrate packages
If your MyGet feed is private, you'll need to create a password to authenticate. You can skip the first step if your MyGet feed is public.
Run the following command to convert your password to a secure string.
$password = ConvertTo-SecureString -String '<YOUR_PASSWORD>' -AsPlainText -Force
Run the following command to migrate your packages to Azure Artifacts.
Migrate from a private MyGet feed:
Move-MyGetNuGetPackages -SourceIndexUrl '<MYGET_SOURCE_URL>' -DestinationIndexUrl '<ARTIFACTS_FEED_SOURCE_URL>' -DestinationPAT '<AZURE_DEVOPS_PAT>' -DestinationFeedName '<ARTIFACTS_FEED_NAME>' -SourceUsername '<MYGET_USERNAME>' -SourcePassword $password -Verbose
Migrate from a public MyGet feed:
Move-MyGetNuGetPackages -SourceIndexUrl '<MYGET_SOURCE_URL>' -DestinationIndexUrl '<ARTIFACTS_FEED_SOURCE_URL>' -DestinationPAT '<AZURE_DEVOPS_PAT>' -DestinationFeedName '<ARTIFACTS_FEED_NAME>' -Verbose
Related articles
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for