It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Best way to migrate from Stash to Bitbucket

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

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.

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

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
Community showcase
Published in Bitbucket Pipelines

Building a Bitbucket Pipe as a casual coder

...ipe.sh :  #!/bin/bash source "$(dirname "$0")/common.sh" enable_debug extra_args="" if [[ "${DEBUG}" == "true" ]]; then extra_args="--verbose" fi # mandatory variables R...

4,023 views 4 22
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you