Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

How to migrate to Bitbucket from GitLab, Gerrit, ...

Marko Tomljenovic June 7, 2018

Hello,

in my company there are multiple GIT solutions in place right now. We think about buying Bitbucket on a large scale and use it as the only solution but we have to consider how to migrate the projects from Gerrit, Gitlab, ... into Bitbucket.

Are there any migration/import tools available to migrate the GIT repositories AND the metadata (like pull requests, code review findings) seamlessly into Bitbucket?

I was searching in the Atlassian documentation and via google but the only thing I found was some guidelines or tool features on how to import the GIT repositories into Bitbucket from some other system like GitHub. I am missing the metadata import here.

Please share the necessary information with me.

Thank you

4 answers

6 votes
seesharp November 21, 2018

1) Create the repository in Bitbucket using the UI

2) Clone the Gitlab repository using the "--bare" option

git clone --bare GITLAB-URL

3) Add the Bitbucket remote

cd REPO-NAME
git remote add bitbucket BITBUCKET-URL

4) Push all commits, branches and tags to Bitbucket

git push --all bitbucket
git push --tags bitbucket

5) Remove the temp repository

cd ..
rm -rf REPO-NAME

Source: https://stackoverflow.com/a/44111370/1509986

2 votes
Ana Retamal
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
June 8, 2018

Hi Martin, you can import the source code and history to Bitbucket Server as explained at Importing code from an existing project. However, you'll need to manually recreate all metadata such as permissions, comments, pull requests etc. either from the Bitbucket Server GUI or programmatically using the Bitbucket API. We have a feature request to make this process easier, and you can vote for it at BSERV-3555. All other data such as repo history is stored in the .git directory.

Let us know if you have any questions!

Best regards,

Ana

Marko Tomljenovic June 11, 2018

Ok. That was the information I already found myself. Regarding the API to create pull requests and other related data:

I guess it is not possible to create pull requests and comments/tasks with a specific timestamp so that I can manually recreate the very same data like e.g. stored in GitLab.
I assume when I create a PR, comment or task the timestamp of that element is given by the system and cannot be changed, correct?

Colin January 16, 2020

Hi Marko

Did you migrate to bitbucket? We're about to migrate as well and I would really appreciate some help. Can I get in touch with you somehow?

Best regards,

Colin

Marko Tomljenovic January 16, 2020

Hi Colin,

I cannot help you because we finally decided to even go to a different GIT system than Bitbucket, Not because of functional reasons more because of organisational reasons.

Good luck for your migration.

Like Nrawut Phommahit likes this
0 votes
Nrawut Phommahit March 15, 2024

Currently,Mr.Nont has been suggested to use the Terraform for "Gitlab drive out to Bitbucket" Project. 

1. Assessment gitlab repo
2. Migrate repo to bitbucket

0 votes
Marc Galmés February 10, 2023

Hi, team!

How are you?

Has anyone migrated from GitLab to BitBucket? Any recommendation?

Thank you so much

bhanu teja March 5, 2024

Hi @Marc Galmés  

Have you migrated from Gitlab to bitbucket if yes what are the prerequisites to check.

 

Thanks

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events