{"id":13895015,"url":"https://github.com/itchyny/github-migrator","last_synced_at":"2025-03-21T03:30:38.316Z","repository":{"id":45020978,"uuid":"218822740","full_name":"itchyny/github-migrator","owner":"itchyny","description":"GitHub repository migrator","archived":false,"fork":false,"pushed_at":"2022-04-14T09:13:23.000Z","size":383,"stargazers_count":46,"open_issues_count":0,"forks_count":6,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-03-17T20:12:27.850Z","etag":null,"topics":["github","golang","migration-tool"],"latest_commit_sha":null,"homepage":"","language":"Go","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/itchyny.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}},"created_at":"2019-10-31T17:32:04.000Z","updated_at":"2024-03-09T06:10:27.000Z","dependencies_parsed_at":"2022-09-01T06:31:30.472Z","dependency_job_id":null,"html_url":"https://github.com/itchyny/github-migrator","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itchyny%2Fgithub-migrator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itchyny%2Fgithub-migrator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itchyny%2Fgithub-migrator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itchyny%2Fgithub-migrator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/itchyny","download_url":"https://codeload.github.com/itchyny/github-migrator/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244733436,"owners_count":20501011,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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","golang","migration-tool"],"created_at":"2024-08-06T18:01:56.075Z","updated_at":"2025-03-21T03:30:38.024Z","avatar_url":"https://github.com/itchyny.png","language":"Go","readme":"# github-migrator\nThis tool migrates a GitHub repository to another.\nThis is especially useful to move a repository from GitHub Enterprise to github.com.\n\n![](https://user-images.githubusercontent.com/375258/71414326-cda1b480-2699-11ea-9de9-411e954bdb70.jpg)\n\n## Usage\n```bash\nexport GITHUB_MIGRATOR_SOURCE_API_TOKEN=xxx\nexport GITHUB_MIGRATOR_SOURCE_API_ENDPOINT=http://localhost/api/v3 # This might be the endpoint of GitHub Enterprise\nexport GITHUB_MIGRATOR_TARGET_API_TOKEN=yyy\n# export GITHUB_MIGRATOR_TARGET_API_ENDPOINT=https://api.github.com # No need to specify the endpoint of github.com\n# export GITHUB_MIGRATOR_TARGET_PROXY_URL=http://proxyIp:proxyPort # If you need proxy URL\ngo run . [old-owner]/[source] [new-owner]/[target]\n```\nBe sure to use this tool before pushing the git tree to the new origin (otherwise the links in the merged commits are lost).\n\n### Other options\nSometimes same user has different user id on GitHub and Enterprise.\n```bash\nexport GITHUB_MIGRATOR_USER_MAPPING=user-before1:user-after1,user-before2:user-after2,user-before3:user-after3\n```\n\n## Requirements\n- Go 1.17+\n- API tokens to access the source and target repositories.\n\n## Features\n- Issues\n  - Issue description with the link to the original repository\n  - Issue comments with the user name and icon (within the comment)\n  - Created dates, Labels\n  - Issue numbers are same as the original repository\n  - Various events (including title changes, issue locking, assignments, review requests and branch deletion in a pull request)\n- Pull requests\n  - A pull request is converted to an issue\n  - Comments and review comments are migrated as issue comments\n  - Created dates, Labels\n  - Pull request numbers (issue numbers) are same as the original repository\n  - Number of changed files, insertions and deletions\n  - Entire diff (excluding large file diffs)\n  - Commits list and link to the corresponding /compare/ page\n- Repository information\n  - Description, Homepage (only when the target repository has blank description, homepage)\n- Labels\n  - Label name, description and colors\n  - Label changes in issue and pull request\n- Projects\n  - Projects, columns and cards\n  - Note that column automations are not migrated (cannot be set via API)\n- Milestones\n  - Milestone titles, description and due date\n  - Connect issues to milestones\n- Webhooks\n  - Webhook URL, content type and events the hooks is trigger for.\n- All the other things will be lost\n  - Images posted to issue and pull request comments.\n  - Emoji reactions to issue and pull request comments\n  - Diffs (split) view of pull requests\n  - Wiki\n  - Default branch, Protection rules\n  - Notifications, Integrations\n\n## Bug Tracker\nReport bug at [Issues・itchyny/github-migrator - GitHub](https://github.com/itchyny/github-migrator/issues).\n\n## Author\nitchyny (https://github.com/itchyny)\n\n## License\nThis software is released under the MIT License, see LICENSE.\n\n## Previous works and references\n- [fastlane/monorepo: Scripts to migrate to a monorepo](https://github.com/fastlane/monorepo)\n  - This tool greatly influenced me, especially for investigating the usage of the import api.\n- [aereal/migrate-gh-repo: migrate GitHub (incl. Enterprise) repositories with idempotent-like manner](https://github.com/aereal/migrate-gh-repo)\n  - For the idea of keeping the issue and pull request numbers.\n- [Complete issue import API walkthrough with curl](https://gist.github.com/jonmagic/5282384165e0f86ef105)\n  - Comprehensive tutorial for using the import api (which is not listed in the official api document yet).\n","funding_links":[],"categories":["Go"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fitchyny%2Fgithub-migrator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fitchyny%2Fgithub-migrator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fitchyny%2Fgithub-migrator/lists"}