title | description | ms.prod | ms.technology | ms.manager | ms.author | author | ms.reviewer | ms.date | monikerRange |
---|---|---|---|---|---|---|---|---|---|
Migrate your packages to Azure Artifacts |
Use a PowerShell Module to easily migrate your packages to an Azure Artifacts Feed |
devops |
devops-artifacts |
jillfra |
phwilson |
chasewilson |
elbatk |
07/18/2019 |
azure-devops |
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.
- 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.
-
In Windows, open a PowerShell Window, form Mac or Linux, open a terminal and run the
pwsh
command 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.
To migrate your packages, you will need the index URL to your source, and destination feeds.
You can easily copy the destination URL from the Connect to feed dialog box.
-
Log into your MyGet Account and navigate to the feed you want to migrate.
-
Select Feed Details
-
Copy the NuGet V3 feed URL
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
-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
- 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.
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.