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

Best way to migrate from Stash to Bitbucket

Henning Klokkeråsen March 19, 2015

My team is moving from Stash to Bitbucket.

What is the best way for us to move? I have tried Import repository but since the Old repository is on a server behind a firewall Bitbucket can't access it.

From this https://answers.atlassian.com/questions/258495/migrating-from-stash-to-bitbucket I assume it is not possible to migrate directly from Stash to Bitbucket and have our pull requests, comments, etc migrated (please add this feature asap)

Should I checkout repos to my local computer and then import that in Bitbucket? And the next step would then be to have all developers change their git/SourceTree settings so that the remote/origin will instead be the Bitbucket-hosted git repos instead of the current Stash-hosted repos?

We have about 6-8 repositories to move. All of these are within 1 project in Stash. In Bitbucket I cant see any concept that easily maps to the Project level in Stash. The closest I could find is the Team concept.

We also want JIRA integration from an on-premise JIRA. If we add a JIRA link will that be per Team or per Repository?

2 answers

1 accepted

0 votes
Answer accepted
Seth
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 19, 2015

This is the best solution I can find: http://www.smashingmagazine.com/2014/05/19/moving-git-repository-new-server/

It looks like you need to checkout all the branches from stash locally, but you don't have to individually update the remotes, you can push all.

Don't worry about freezing commits, just pushes. Once you've got the new repo set up, your devs can switch remotes, then push anything that didn't get migrated by you.

Christian Bongiorno January 6, 2019

I actually implemented a tool that does API integration between stash and BB cloud

 

Basically, it asks for all projects/repos, gets their download URL (in my case I used ssh otherwise I ran into networking issues related to our HTTP proxy) and then bare clone the repo locally - I then immediately create a new repo at the destination, assign the correct group privilages and project and `git push --all` 

 

I managed to migrate over 2000 repos this way. If anyone is interested in the code or how I did it it's OpenSource. It's written in groovy

Service IT January 19, 2021

Hello there ! I'm interested in the code to migrate undreds of repos...

0 votes
Henning Klokkeråsen March 19, 2015

And also, what about branches? If I want to move all existing feature branches, I have to clone each feature branch and change the remote. Meaning I have to get all developers to push their feature branches to Stash, then we have to freeze all commiting, then I move the repos, and then all developers have to change remote. Is there not a simpler way?

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events