forked from loic-sharma/BaGet
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add NuGet.Server migration guide (loic-sharma#326)
- Loading branch information
1 parent
1b9da5b
commit 0156d23
Showing
3 changed files
with
42 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# Migrate from NuGet.Server | ||
|
||
[NuGet.Server](https://github.com/NuGet/NuGet.Server) is a lightweight standalone NuGet server. It is strongly recommended that you upgrade to BaGet if you use NuGet.Server. Feel free to open a [GitHub issue](https://github.com/loic-sharma/BaGet/issues) if you need help migrating. | ||
|
||
!!! info | ||
Please refer to the [BaGet vs NuGet.Server](../vs/nugetserver.md) page for reasons to upgrade to BaGet. | ||
|
||
# Steps | ||
|
||
Make sure that you've installed [nuget.exe](https://www.nuget.org/downloads). In PowerShell, run: | ||
|
||
```ps1 | ||
$source = "<NuGet.Server package source>" | ||
$destination = "<BaGet package source>" | ||
``` | ||
|
||
If you've [configured BaGet to require an API Key](https://loic-sharma.github.io/BaGet/configuration/#requiring-an-api-key), set it using [the `setapikey` command](https://docs.microsoft.com/en-us/nuget/reference/cli-reference/cli-ref-setapikey): | ||
|
||
```ps1 | ||
& nuget.exe setapikey "NUGET-SERVER-API-KEY" -Source $destination | ||
``` | ||
|
||
Now run the following PowerShell script: | ||
|
||
```ps1 | ||
if (!(Test-Path "Web.config")) { | ||
throw "Please run this script in the same directory as NuGet.Server's Web.config file" | ||
} | ||
(& nuget.exe list -AllVersions -Source $source).Split([Environment]::NewLine) | % { | ||
$id = $_.Split(" ")[0].Trim() | ||
$version = $_.Split(" ")[1].Trim() | ||
$path = [IO.Path]::Combine("Packages", $id, $version, "${id}.${version}.nupkg") | ||
Write-Host "nuget.exe push -Source $destination ""$path""" | ||
& nuget.exe push -Source $destination $path | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters