{"id":16805276,"url":"https://github.com/joshjohanning/github-packages-migrate-nuget-packages-between-github-instances","last_synced_at":"2026-02-17T22:31:56.028Z","repository":{"id":108233490,"uuid":"569851298","full_name":"joshjohanning/github-packages-migrate-nuget-packages-between-github-instances","owner":"joshjohanning","description":"Migrate NuGet packages from one GitHub instance to another","archived":false,"fork":false,"pushed_at":"2024-09-13T02:38:09.000Z","size":46,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-19T19:45:04.958Z","etag":null,"topics":["github","github-packages","migration","nuget"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/joshjohanning.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-11-23T18:59:49.000Z","updated_at":"2024-11-12T02:52:24.000Z","dependencies_parsed_at":"2024-09-13T13:45:16.722Z","dependency_job_id":"14bba73f-3ca4-4405-8035-f34569218ef1","html_url":"https://github.com/joshjohanning/github-packages-migrate-nuget-packages-between-github-instances","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/joshjohanning/github-packages-migrate-nuget-packages-between-github-instances","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joshjohanning%2Fgithub-packages-migrate-nuget-packages-between-github-instances","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joshjohanning%2Fgithub-packages-migrate-nuget-packages-between-github-instances/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joshjohanning%2Fgithub-packages-migrate-nuget-packages-between-github-instances/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joshjohanning%2Fgithub-packages-migrate-nuget-packages-between-github-instances/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/joshjohanning","download_url":"https://codeload.github.com/joshjohanning/github-packages-migrate-nuget-packages-between-github-instances/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joshjohanning%2Fgithub-packages-migrate-nuget-packages-between-github-instances/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29560777,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-17T21:50:49.831Z","status":"ssl_error","status_checked_at":"2026-02-17T21:46:15.313Z","response_time":100,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["github","github-packages","migration","nuget"],"created_at":"2024-10-13T09:47:41.726Z","updated_at":"2026-02-17T22:31:56.002Z","avatar_url":"https://github.com/joshjohanning.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Migrate NuGet Packages Between GitHub Instances\n\nMigrate NuGet packages from one GitHub instance to another\n\nThis should be able to migrate packages from GitHub Enterprise Server to GitHub.com using the `\u003csource-host\u003e` parameter. If GitHub.com to GitHub.com, set `\u003csource-host\u003e` to `github.com`.\n\n\u003e **Note**\n\u003e See accompanying [blog post](https://josh-ops.com/posts/github-packages-migrate-nuget-packages/)! 🚀 \n\n## Prerequisites\n\n1. [gh cli](https://cli.github.com) installed\n2. Set the source GitHub PAT env var: `export GH_SOURCE_PAT=ghp_abc` (must have at least `read:packages`, `read:org` scope)\n3. Set the target GitHub PAT env var: `export GH_TARGET_PAT=ghp_xyz` (must have at least `write:packages`, `read:org` scope)\n\nNotes:\n\n- This script installs [gpr](https://github.com/jcansdale/gpr) locally to the `./temp/tools` directory\n- This script assumes that the target org's repo name is the same as the source\n- If the repo doesn't exist, the package will still import but won't be mapped to a repo\n\n## Usage\n\n```bash\n./migrate-nuget-packages-between-orgs.sh \\\n  \u003csource-org\u003e \\\n  \u003csource-host\u003e \\\n  \u003ctarget-org\u003e\n```\n\n## Example\n\n```bash\nexport GH_SOURCE_PAT=ghp_abc\nexport GH_TARGET_PAT=ghp_xyz\n\n./migrate-nuget-packages-between-orgs.sh \\\n  joshjohanning-org-packages \\\n  github.com \\\n  joshjohanning-org-packages-migrated\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eExample output\u003c/summary\u003e\n\n    ...\n    packages-repo1 --\u003e NUnit3.DotNetNew.Template\n    1.7.0\n    https://nuget.pkg.github.com/joshjohanning-org-packages/download/NUnit3.DotNetNew.Template/1.7.0/NUnit3.DotNetNew.Template.1.7.0.nupkg\n    deleting: _rels/.rels\n    deleting: [Content_Types].xml\n    deleting: _rels/.rels\n    deleting: [Content_Types].xml\n    Found 1 package.\n    [NUnit3.DotNetNew.Template.1.7.0.nupkg]: Repository url: https://github.com/joshjohanning-org-packages-migrated/packages-repo1. Version: 1.7.0. Size: 20847 bytes. \n    [NUnit3.DotNetNew.Template.1.7.0.nupkg]: Uploading package.\n    [NUnit3.DotNetNew.Template.1.7.0.nupkg]: Successfully registered nuget package: NUnit3.DotNetNew.Template (1.7.0)\n\n    1.7.2\n    https://nuget.pkg.github.com/joshjohanning-org-packages/download/NUnit3.DotNetNew.Template/1.7.2/NUnit3.DotNetNew.Template.1.7.2.nupkg\n    deleting: _rels/.rels\n    deleting: [Content_Types].xml\n    deleting: _rels/.rels\n    deleting: [Content_Types].xml\n    Found 1 package.\n    [NUnit3.DotNetNew.Template.1.7.2.nupkg]: Repository url: https://github.com/joshjohanning-org-packages-migrated/packages-repo1. Version: 1.7.2. Size: 21247 bytes. \n    [NUnit3.DotNetNew.Template.1.7.2.nupkg]: Uploading package.\n    [NUnit3.DotNetNew.Template.1.7.2.nupkg]: Successfully registered nuget package: NUnit3.DotNetNew.Template (1.7.2)\n\n    1.7.1\n    https://nuget.pkg.github.com/joshjohanning-org-packages/download/NUnit3.DotNetNew.Template/1.7.1/NUnit3.DotNetNew.Template.1.7.1.nupkg\n    deleting: _rels/.rels\n    deleting: [Content_Types].xml\n    deleting: _rels/.rels\n    deleting: [Content_Types].xml\n    Found 1 package.\n    [NUnit3.DotNetNew.Template.1.7.1.nupkg]: Repository url: https://github.com/joshjohanning-org-packages-migrated/packages-repo1. Version: 1.7.1. Size: 20864 bytes. \n    [NUnit3.DotNetNew.Template.1.7.1.nupkg]: Uploading package.\n    [NUnit3.DotNetNew.Template.1.7.1.nupkg]: Successfully registered nuget package: NUnit3.DotNetNew.Template (1.7.1)\n\n    ...\n    packages-repo2 --\u003e Newtonsoft.Json\n    11.0.2\n    https://nuget.pkg.github.com/joshjohanning-org-packages/download/Newtonsoft.Json/11.0.2/Newtonsoft.Json.11.0.2.nupkg\n    deleting: _rels/.rels\n    deleting: [Content_Types].xml\n    deleting: _rels/.rels\n    deleting: [Content_Types].xml\n    Found 1 package.\n    [Newtonsoft.Json.11.0.2.nupkg]: Repository url: https://github.com/joshjohanning-org-packages-migrated/packages-repo2. Version: 11.0.2. Size: 2407521 bytes. \n    [Newtonsoft.Json.11.0.2.nupkg]: Uploading package.\n    [Newtonsoft.Json.11.0.2.nupkg]: Successfully registered nuget package: Newtonsoft.Json (11.0.2)\n\n    11.0.1\n    https://nuget.pkg.github.com/joshjohanning-org-packages/download/Newtonsoft.Json/11.0.1/Newtonsoft.Json.11.0.1.nupkg\n    deleting: _rels/.rels\n    deleting: [Content_Types].xml\n    deleting: _rels/.rels\n    deleting: [Content_Types].xml\n    Found 1 package.\n    [Newtonsoft.Json.11.0.1.nupkg]: Repository url: https://github.com/joshjohanning-org-packages-migrated/packages-repo2. Version: 11.0.1. Size: 2410114 bytes. \n    [Newtonsoft.Json.11.0.1.nupkg]: Uploading package.\n    [Newtonsoft.Json.11.0.1.nupkg]: Successfully registered nuget package: Newtonsoft.Json (11.0.1)\n\n    ...\n    Run this to clean up your working dir: rm ./*.nupkg ./*.zip\n\u003c/details\u003e\n\n## Notes\n\n- Uses [jcansdale/gpr](https://github.com/jcansdale/gpr) to do the nuget push\n- Had to delete `_rels/.rels` and `[Content_Types].xml` because there was somehow two copies of each file in the package and it causes `gpr` to fail when extracting/zipping the package to re-push\n- Run this to clean up your working directory: `rm -rf ./temp`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoshjohanning%2Fgithub-packages-migrate-nuget-packages-between-github-instances","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjoshjohanning%2Fgithub-packages-migrate-nuget-packages-between-github-instances","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoshjohanning%2Fgithub-packages-migrate-nuget-packages-between-github-instances/lists"}