{"id":21842659,"url":"https://github.com/brookinsconsulting/gitlab-to-bitbucket","last_synced_at":"2026-05-06T23:39:53.006Z","repository":{"id":140126400,"uuid":"85890752","full_name":"brookinsconsulting/gitlab-to-bitbucket","owner":"brookinsconsulting","description":"Simple python script to run once mirror a gitlab.com account git repositories to a single bitbucket.org account","archived":false,"fork":false,"pushed_at":"2017-03-27T06:04:41.000Z","size":38,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-26T11:27:55.803Z","etag":null,"topics":["bitbucket","command-line","git","git-spindle","gitlab","import","migrate","mirror","python","repositories","script"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/brookinsconsulting.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":"2017-03-23T00:47:47.000Z","updated_at":"2022-01-16T18:20:56.000Z","dependencies_parsed_at":null,"dependency_job_id":"8ce9af80-6c1d-4a52-919e-0d3b5629a3ff","html_url":"https://github.com/brookinsconsulting/gitlab-to-bitbucket","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/brookinsconsulting%2Fgitlab-to-bitbucket","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brookinsconsulting%2Fgitlab-to-bitbucket/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brookinsconsulting%2Fgitlab-to-bitbucket/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brookinsconsulting%2Fgitlab-to-bitbucket/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/brookinsconsulting","download_url":"https://codeload.github.com/brookinsconsulting/gitlab-to-bitbucket/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244825654,"owners_count":20516592,"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":["bitbucket","command-line","git","git-spindle","gitlab","import","migrate","mirror","python","repositories","script"],"created_at":"2024-11-27T22:12:43.840Z","updated_at":"2026-05-06T23:39:52.978Z","avatar_url":"https://github.com/brookinsconsulting.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"gitlab-to-bitbucket\n====================\n\nA simple custom and basic solution to provide a command line tool which mirrors gitlab.com account repositories to bitbucket.org account repositories\n\nThis script depends heavily on existing tools and libraries to do most of the heavy lifting.\n\nThis script is also inefficient when run multiple times. This is a result of it's short life span thus far and as a result to rely on git-spindle instead a more complete native python bitbucket.org rest api implementation.\n\nNote: This solution is stable and tested as functional.\n\n\nVersion\n=======\n\n* The current version of GitLab to BitBucket is 0.1.3\n\n* Last Major update: March 24, 2017\n\n\nCopyright\n=========\n\n* GitLab to BitBucket is copyright 1999 - 2017 Brookins Consulting\n\n* See: [COPYRIGHT.md](COPYRIGHT.md) for more information on the terms of the copyright and license\n\n\nLicense\n=======\n\nGitLab to BitBucket is licensed under the GNU General Public License.\n\nThe complete license agreement is included in the [LICENSE](LICENSE.md) file.\n\nGitLab to BitBucket is free software: you can redistribute it and/or modify\nit under the terms of the GNU General Public License as published by\nthe Free Software Foundation, either version 2 of the License or at your\noption a later version.\n\nGitLab to BitBucket is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\nGNU General Public License for more details.\n\nThe GNU GPL gives you the right to use, modify and redistribute\nGitLab to BitBucket under certain conditions. The GNU GPL license\nis distributed with the software, see the file [LICENSE](LICENSE.md).\n\nIt is also available at [http://www.gnu.org/licenses/gpl.txt](http://www.gnu.org/licenses/gpl.txt)\n\nYou should have received a copy of the GNU General Public License\nalong with GitLab to BitBucket in in the [LICENSE](LICENSE.md) file.\n\nIf not, see [http://www.gnu.org/licenses/](http://www.gnu.org/licenses/).\n\nUsing GitLab to BitBucket under the terms of the GNU GPL is free (as in freedom).\n\nFor more information or questions please contact: license@brookinsconsulting.com\n\n\nRequirements\n============\n\nThe following requirements exists for using GitLab to BitBucket script:\n\n- Python 3\n- Python Library: sh\n- Python Library: python-gitlab\n- Python Library: git-spindle\n\n# Required software\n\n- GNU/Linux\n- bash, 4.1.2(1)-release\n- python, 3.x\n- pip, ?rev\n- git, 2.1.2\n- coreutils, ?rev\n\n\n## Install requirements\n\n   pip install sh\n\n   pip install python-gitlab\n\n   pip install git-spindle\n\n\n## Configure Requirements\n\n## GitSpindle\n\nGitSpindle provides for a configuration dot file ~/.gitspindle in INI file format.\n\nYou must create this file and populate it with the following. Customize it's contents to contain your actual BitBucket username and password.\n\nThis limited file format does not apear to support multiple accounts at the time of writting. We stored and manually uncommented our accounts + passwords as needed.\n\nPlease *remember* to switch this information or you may corrupt / cross polute your accounts when working with multiple accounts. This is a real bottle neck for users with multiple accounts at this time.\n\nNote: Do not share this file with anyone. Ever. Lest the daemons haunt you.\n\n\n### Example GitSpindle Configuration File Content\n\n     [bitbucket]\n            user = \u003cbitbucket-username\u003e\n            password = \u003cbitbucket-password\u003e\n\n## (Optional) SSH Host Aliases\n\nIf your like us we use this solution with multiple services, accounts, access tokens and ssh keys.\n\nIf your primary ssh key is not the right key you can fix this manually yourself *or* you can use the built in features of this script combined with ssh host aliases.\n\nHere is an example of runing the command with expectations of use of ssh host aliases which follow the following convention (host(with no 1st level domain, .com))-as-(username of gitlab and bitbucket). This script assumes the usernames are the same between the two services.\n\n    fucker\n\nHere is an example of our (redacted) ssh configuration of ssh host aliases.\n\n    Host github.com\n    #Host github-as-bc\n      HostName github.com\n      User git\n      IdentityFile /home/username/.ssh/id_rsa\n      IdentitiesOnly yes\n\n    Host github-as-ezpublishlegacy\n      HostName github.com\n      User git\n      IdentityFile /home/username/.ssh-ezpl/id_rsa\n      IdentitiesOnly yes\n\n    Host github-as-ezpublishlegacyprojects\n      HostName github.com\n      User git\n      IdentityFile /home/username/.ssh-ezplp/id_rsa\n      IdentitiesOnly yes\n\n    Host github-as-ezecosystem\n      HostName github.com\n      User git\n      IdentityFile /home/username/.ssh-eze/id_rsa\n      IdentitiesOnly yes\n\n\n## Gitlab Access Requires\n\n- GitLab Account, Personal Access Token\n- BitBucket, Username and Password\n\n## Note: Bitbucket repository urls are forced to be lower case only\n\nDue to long standing limitations of the bitbucket.org platform all repository urls, repository names (slugs) (somereponame.git) must be lower case only.\n\nThis specifically affects a repository's directory name and git remote repository name\n\nIssue: https://bitbucket.org/site/master/issues/3348/allow-uppercase-characters-in-repo-slugs\n\n\nUsage\n=====\n\nThe script gitlab_to_bitbucket.py accepts many parameters to make your life easier. Please study the '--help' program output.\n\n    ~/bin/gitlab-to-bitbucket/bin/gitlab_to_bitbucket.py --help;\n\n## Direct python execution, Required Parameters Only (Within interactive shell only)\n\n     ~/bin/gitlab-to-bitbucket/bin/gitlab_to_bitbucket.py --token=\u003cgithub-personal-access-token-string\u003e\n\n\n## Direct python execution, Parameters required for most common use cases (Within interactive shell only)\n\n     ~/bin/gitlab-to-bitbucket/bin/gitlab_to_bitbucket.py --token=\u003cgithub-personal-access-token-string\u003e --fetch-all --page-size=100\n\n## Direct python execution, Parameters required for most common use cases using very verbose mode (Within interactive shell only)\n\n     ~/bin/gitlab-to-bitbucket/bin/gitlab_to_bitbucket.py --token=\u003cgithub-personal-access-token-string\u003e --fetch-all --page-size=100 -vv\n\n## Direct python execution, Parameters required for ssh host alias usage, second most common use cases using very verbose mode (Within interactive shell only)\n\n     ~/bin/gitlab-to-bitbucket/bin/gitlab_to_bitbucket.py --token=\u003cgithub-personal-access-token-string\u003e --fetch-all --host-alias --page-size=100 -vv\n\n## Direct python execution, Example usage with (most) script output logged to a temporary file\n\n     ~/bin/gitlab-to-bitbucket/bin/gitlab_to_bitbucket.py --token=\u003cgithub-personal-access-token-string\u003e --fetch-all --host-alias --page-size=100 -vv 2\u003e /home/username/gitlab-to-bitbucket-mirroring-test-run-0001.txt\n\n*Note*: For longer runing usage (accounts with large numbers of project repositories and or large disk usage per repository) we *stronly* recommend only running our script within a GNU Screen Session (command: screen) which ensures the program (script) runs correctly in the event your ssh connection is interupted or terminated on accident.\n\n\n# Related Documentation\n\n- https://pypi.python.org/pypi/git-spindle\n\n- http://seveas.github.io/git-spindle\n\n- http://python-gitlab.readthedocs.io/en/stable/\n\n- https://docs.gitlab.com/ee/api/README.html\n\n\nTesting\n=====\n\nThe solution is configured to work once properly installed and configured.\n\n\nTroubleshooting\n===============\n\n### Read the FAQ\n\nSome problems are more common than others. The most common ones are listed in the the [FAQ.md](FAQ.md)\n\n\n### Support\n\nIf you have find any problems not handled by this document or the FAQ you can contact Brookins Consulting through the support system: [http://brookinsconsulting.com/contact](http://brookinsconsulting.com/contact)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrookinsconsulting%2Fgitlab-to-bitbucket","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbrookinsconsulting%2Fgitlab-to-bitbucket","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrookinsconsulting%2Fgitlab-to-bitbucket/lists"}