Migrate from Bitbucket to Gitlab

diy

Bitbucket has been my go-to solution for the side projects. Thanks to its generous free plan with unlimited private repository, I can happily hack in the dark without worrying about the scrutiny. The offering also includes basic bug tracking and wiki atop. And did I mention that it also supports mercurial?

Why leave then

Bitbucket’s code hosting is solid, but the web experience is quite lacking. The code search is not supported, nor the File Finder. The UI is also aesthetically dull compared its competitors; though you may feel at home if you are familiar with Atalassian’s flagship products, Jira and Confluence.

The last straw is the netlify integration issue: the pull request fails to trigger a preview build. To be fair, the bug most likely sits in the netlify side; but it breaks my work flow so badly, that I’d like to explore elsewhere to fix it.

Why GitLab

There are a few free private repository hosting with basic project management features, but my options are limited due to the netlify integration constraint. Otherwise, the Visual Studio online is another viable option.

Migrate to GitLab

If you are using git, the migration is really not necessary: you can create a new repository in GitLab, and update the remote repository origin in you local repository:

git remote rm origin
git remove add origin git@gitlab.com:user_name/repo_name
git push

The benefits of the migration is to keep the meta data, such as issues. And it is just easier:

After you sign up, in the Project dashboard, click the New project button, and you have an option to import projects from Bitbucket:

New Project in GitLab
New Project in GitLab

The next step is the OAuth challenge from Bitbucket:

Bitbucket OAuth Challenge
Bitbucket OAuth Challenge

After the access is authorized, you may import some or all projects. It is worthy noting that the mercurial projects can not be imported. And the official mercurial to git migration guide covers only the code repository conversion, the issues and wiki will NOT be migrated.

Import Bitbucket Project
Import Bitbucket Project

In couple seconds, the project showed in the dashboard with high fidelity:

  • the source code is imported with all branches and tags.
  • the issues are imported with all tags
  • the wiki pages are also imported.

And the netlify integration just works as charm.