{"id":13883412,"url":"https://github.com/jeffwidman/bitbucket-issue-migration","last_synced_at":"2025-04-05T13:06:19.333Z","repository":{"id":52465298,"uuid":"1483140","full_name":"jeffwidman/bitbucket-issue-migration","owner":"jeffwidman","description":"A small script for migrating repo issues from Bitbucket to GitHub","archived":false,"fork":false,"pushed_at":"2023-03-22T05:30:28.000Z","size":213,"stargazers_count":317,"open_issues_count":22,"forks_count":94,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-29T12:05:51.722Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jeffwidman.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","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":"2011-03-15T15:15:08.000Z","updated_at":"2025-01-31T00:34:33.000Z","dependencies_parsed_at":"2024-10-03T10:21:55.082Z","dependency_job_id":null,"html_url":"https://github.com/jeffwidman/bitbucket-issue-migration","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/jeffwidman%2Fbitbucket-issue-migration","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jeffwidman%2Fbitbucket-issue-migration/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jeffwidman%2Fbitbucket-issue-migration/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jeffwidman%2Fbitbucket-issue-migration/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jeffwidman","download_url":"https://codeload.github.com/jeffwidman/bitbucket-issue-migration/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247339155,"owners_count":20923014,"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":[],"created_at":"2024-08-06T09:01:29.818Z","updated_at":"2025-04-05T13:06:19.310Z","avatar_url":"https://github.com/jeffwidman.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"# Bitbucket Issues Migration\n\nThis is a small script that will migrate Bitbucket issues to a GitHub project.\n\nIt will import issues (and close them as needed) and their comments.\nRepositories can be public or private, owned by individuals or organizations.\nLabels and milestones are supported.\n\n## Before running:\n\nRequires Python 3 and the [`requests`](http://requests.readthedocs.org/) library.\n[`keyring`](https://pypi.python.org/pypi/keyring) is an optional\ndependency if you want to pull login credentials from the system keyring.\n\nIt's probably easiest to install the dependencies using Python 3's built-in\n`venv` tool:\n\n    $ python3 -m venv ./py3\n    $ source ./py3/bin/activate\n    $ pip3 install -r requirements.pip\n\nOn Windows, use `.\\py3\\Scripts\\activate.bat` instead of `source ./py3/bin/activate`\n\n## Parameters:\n\n    $ python3 migrate.py -h\n    usage: migrate.py [-h] [-bu BITBUCKET_USERNAME] [-n] [-f SKIP] [-m _MAP_USERS]\n                      bitbucket_repo github_repo github_username\n\n    A tool to migrate issues from Bitbucket to GitHub.\n\n    positional arguments:\n      bitbucket_repo        Bitbucket repository to pull issues from.\n                            Format: \u003cuser or organization name\u003e/\u003crepo name\u003e\n                            Example: jeffwidman/bitbucket-issue-migration\n\n      github_repo           GitHub repository to add issues to.\n                            Format: \u003cuser or organization name\u003e/\u003crepo name\u003e\n                            Example: jeffwidman/bitbucket-issue-migration\n\n      github_username       Your GitHub username. This is used only for\n                            authentication, not for the repository location.\n\n    optional arguments:\n      -h, --help            show this help message and exit\n\n      -bu BITBUCKET_USERNAME, --bb-user BITBUCKET_USERNAME\n                            Your Bitbucket username. This is only necessary when\n                            migrating private Bitbucket repositories.\n\n      -n, --dry-run         Simulate issue migration to confirm issues can be\n                            extracted from Bitbucket and converted by this script.\n                            Nothing will be copied to GitHub.\n\n      -f SKIP, --skip SKIP  The number of Bitbucket issues to skip. Note that if\n                            Bitbucket issues were deleted, they are already\n                            automatically skipped.\n\n      -m _MAP_USERS, --map-user _MAP_USERS\n                            Override user mapping for usernames, for example\n                            `--map-user users_mapping_file.txt`. Username mapping should be\n                            in the form of `bb_username=gh_username`, each separated by a new line.\n\n      --skip-attribution-for BB_SKIP\n                            BitBucket user who doesn't need comments re-\n                            attributed. Useful to skip your own comments, because\n                            you are running this script, and the GitHub comments\n                            will be already under your name.\n\n      --link-changesets     Link changeset references back to BitBucket.\n\n    $ python3 migrate.py \u003cbitbucket_repo\u003e \u003cgithub_repo\u003e \u003cgithub_username\u003e\n\n## Example:\n\nFor example, to export the SQLAlchemy issue tracker to the repo https://github.com/jeffwidman/testing:\n\n    $ python3 migrate.py zzzeek/sqlalchemy jeffwidman/testing jeffwidman\n\n## Additional notes:\n\n* GitHub labels are created that map to the Bitbucket issue's priority, kind\n(bug, task, etc), component (if any, custom to each project), and version (if\nany). If you don't want these, just delete the new GitHub labels post-migration.\n_(Note: GitHub limits label length to 50 characters. Labels longer than this will be truncated.)_\n\n* Milestones are transferred. If the milestone doesn't exist in GitHub, it will\nbe created. If you don't want this, either edit the code (search for \"milestone\")\nor delete the milestones in GitHub after the migration.\n\n* The migrated issues and issue comments are annotated with both Bitbucket and\nGitHub links to user who authored the comment/issue. This assumes the user\nreused their Bitbucket username on GitHub.\n\n* Issue assignees are transferred, but only for explicitly mapped users\n(see the -m switch above).\n\n* Within the body of issues and issue comments, hyperlinks to other issues\nin this Bitbucket repo will be rewritten as `#\u003cID\u003e`, which GitHub will\nautomatically hyperlink to the GitHub issue with that particular ID. This\nassumes that you are migrating to a GitHub repository that has no existing\nissues, otherwise the imported issues will have a different ID on GitHub than\non Bitbucket and the links will be incorrect. If you are migrating to a GitHub\nrepo with existing issues, just edit the code to offset the imported issue IDs\nby the correct amount.\n\n* This script is not idempotent--re-running it will leave the first set of\nimported issues intact, and then create a duplicate set of imported issues after\nthe first set. If you want to re-run the import, it's best to delete your GitHub\nrepo and start over so that the GitHub issue IDs start from 1.\n\n* The maximum allowable size per individual issue is 1MB. This limit is\nimposed by GitHub's\n[Import API](https://gist.github.com/jonmagic/5282384165e0f86ef105).\n\n* If your GitHub account uses 2-factor authentication, to access private GitHub repositories the tool instructs you to generate a token.\nYou will need permissions `repo` and `write:discussion`.\n\n\n\nCurrently maintained by [Jeff Widman](http://www.jeffwidman.com/).\nOriginally written and open-sourced by [Vitaly Babiy](https://github.com/vbabiy).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjeffwidman%2Fbitbucket-issue-migration","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjeffwidman%2Fbitbucket-issue-migration","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjeffwidman%2Fbitbucket-issue-migration/lists"}