January 27, 2016

Moving from GitHub to Bitbucket – Why and How

I was tasked with migrating all Top Draw GitHub repositories to Bitbucket. My first thought was, “What is Bitbucket?” I had heard the name but never explored it. For those unfamiliar with Bitbucket, here’s its description: “Bitbucket is the Git solution for professional teams.”

Key Takeaways about Migrating from GitHub to Bitbucket

  • Bitbucket functions as a web-based Git hosting service that offers comprehensive project management capabilities alongside core version control features for software development teams, making it an alternative solution for professional teams.
  • Top Draw transitioned from GitHub to Bitbucket primarily because Bitbucket offers unlimited private repositories regardless of plan tier, which became essential as their company grew and worked with more clients requiring private code storage.
  • Unlike GitHub’s repository-based pricing model that charges $25/month for just 10 private repositories up to $2050/month for 1500 repositories, Bitbucket uses a team-size pricing structure that significantly reduces costs for smaller development teams.
  • Development teams experience a seamless transition process when moving to Bitbucket because it uses identical Git commands to GitHub and requires no new technical knowledge, allowing Top Draw to transfer all repositories in just a few hours.
  • The migration process from GitHub to Bitbucket involves four main steps: backing up your GitHub repository, obtaining the HTTPS clone URL, importing the existing repository into Bitbucket, and completing the import process with proper authentication credentials.
  • GitHub issues and wikis require separate migration procedures since they don’t transfer automatically during repository import, but resources exist to make this additional migration task straightforward for users with command line knowledge.
  • Despite transitioning to Bitbucket for business use, the author still considers GitHub the superior platform for open-source sharing and community collaboration, suggesting that developers should consider using both platforms for different purposes.
  • Bitbucket particularly suits commercial and business applications where private repository quantity becomes a significant factor in version control system selection.

My second thought was, “Why are we doing this? I love GitHub!” If you’re a developer, you can relate when I say that GitHub is my source for everything from jQuery plugins to grid frameworks to PHP libraries, so why abandon it?

Understanding Bitbucket’s Role in Version Control Systems for Development Teams

Bitbucket is Atlassian’s web-based Git hosting service for software development projects. It offers free private repositories with free private wikis on accounts of up to 5 users. Bitbucket is used for commercial projects rather than open source contributions. As one of the largest Git hosting services, Bitbucket provides comprehensive project management capabilities alongside core version control functionality for professional development teams.

Key Motivations for Transitioning from GitHub to Bitbucket for Business Use

As a first-time user, I didn’t notice much difference from GitHub (other than the user interface). I could browse my code, see my commits, clone, push and pull my repositories just as I did on GitHub. So why move from GitHub to Bitbucket? While we could provide an extensive list of reasons we chose Bitbucket, here are our key motivations:

Unlimited Private Repositories for Growing Companies

As our company grows and we work with more clients, the number of private repositories in our GitHub account grows. GitHub’s free account doesn’t allow private repos and their lowest paid option (for organizations) allows up to 10 private repos.

We outgrew that number quickly. We found ourselves constantly upgrading our account to accommodate growth. Bitbucket offers unlimited private repositories regardless of plan tier. This was a huge factor as we would no longer worry about running out of private repository space!

Cost-Effective Pricing Model Based on Team Size

Upgrading our GitHub accounts due to growth was cumbersome and expensive. GitHub’s pricing model is based on the number of private repositories you require. Starting from 10 private repos for $25.00/month up to 1500 repos for $2050.00/month.

Bitbucket structures its pricing differently. Bitbucket offers all pricing plans with unlimited private repositories. Instead of basing pricing on repository quantity, they calculate it based on the number of users allowed on the account. Because we have a smaller development team, we cut our costs significantly while maintaining all the version control capabilities we need.

Seamless Transition Process for Development Teams

When we change from what we know, we get nervous. Questions arise: Is it difficult to use? Will we need to learn new Git commands? Will it take weeks or months to transfer everything? The answer to all questions is no.

Bitbucket is user-friendly, uses the exact same Git commands as GitHub, and took only a few hours to transfer all our repositories. The familiar Git workflow remains unchanged, making the transition painless for our development team.

Step-by-Step Guide to Migrating Repositories from GitHub to Bitbucket

Bitbucket makes it easy to transfer your repositories from GitHub. Here are the detailed steps:

Backing Up Your GitHub Repository for Safe Migration

The first thing we did was backup our repositories in case something unexpected happened during the transfer process. To create a backup, go to your GitHub repository and click the Download ZIP button in the repository interface. This downloads a complete snapshot of your codebase as it exists at that moment.

Obtaining the HTTPS Clone URL for Repository Transfer

We chose to transfer via the HTTP clone URL method. The clone URL can be found next to the Download ZIP button you just clicked (there is a convenient copy-to-clipboard button). This URL contains all the information needed for Bitbucket to locate and import your GitHub repository.

Importing Your Repository into Bitbucket’s Platform

Next, log into your Bitbucket account and create a repository. Then, instead of filling out the required information manually, you can import an existing repository by clicking the import link in the top right corner of the interface (or navigate directly to https://bitbucket.org/repo/import if you are already logged in).

Completing the Repository Import Process on Bitbucket

Fill out the required information requested by Bitbucket’s import form and click the “Import Repository” button. The form will ask for the source URL and authentication details for accessing your GitHub repository.

Note: If your authorization credentials are incorrect, you may receive an error message. Navigate back to the form, fill out the information correctly and attempt the import again.

Successful Completion of GitHub to Bitbucket Migration

We have now successfully imported our GitHub repository into our Bitbucket account. The entire codebase, including commit history, branches, and tags, is now available in your Bitbucket workspace.

Transferring Wikis and Issues from GitHub to Bitbucket

One challenge we encountered was that GitHub issues and wikis didn’t transfer as part of the initial repository import. However, we found resources that made this additional migration task straightforward, provided you have command line knowledge. Check these helpful resources:
http://codetheory.in/export-your-issues-and-wikis-from-github-repo-and-import-to-bitbucket-migration/
https://github.com/sorich87/github-to-bitbucket-issues-migration
https://confluence.atlassian.com/bitbucket/export-or-import-issue-data-330797432.html

Embracing Both GitHub and Bitbucket for Different Development Needs

While I love GitHub, and still crown it the King of open-source sharing and community collaboration, I tip my hat to Bitbucket for their cost-effective pricing and for making the process of transferring repositories as easy as possible. I was skeptical about the change at first, but after working with Bitbucket, I would strongly suggest anyone working with large numbers of private repositories consider Bitbucket as a viable alternative. This is especially true for commercial and business applications where private repository quantity is a significant factor in version control system selection.

Know What’s Next
from Top Draw