How to migrate from bitbucket to stash

We are currently using BitBucket and want to move our repositories to Stash.

3 answers

1 accepted

5 votes
Accepted answer

It documented on Atlassian Docs:

It is significat to make Bare clone, not simple Copy clone. Because if you make not a Bare mirror, you get no remote branches. And push --all will not work fine.

I used follow commands to completelly migrate from one Git to another, this will copy anything:

git clone --bare
cd myrepo.git
git push --mirror
cd ..
rm -rf myrepo.git

In this solution you no need to add remote.

Thanks Alexey. You're quite right - that's actually a better way to do it.

Wouldn't it be better to mirror the clone at the first step?

git clone --mirror

Also, is the process repeatable if commits are made to the Bitbucket repo?

Hi David,

I guess this depends on how many repositories you have to migrate? If we're talking 5-10, then frankly I would just do it manually for now.

If you have more thant that it might be worth thinking about writing a script (which we could definitely help with). You could use both the REST endpoints to query the Bitbucket repositories and re-create them in Stash.



Not specifically. It's really just the normal Stash documentation you might want to take a look at:

For each repository in Bitbucket you will want to clone the repository to a machine, create a matching repository in Stash and then push all the branches/tags. Something like:

git clone
cd repo-name
git remote add stash ssh://git@server:7999/PROJECT/repo-name.git git push --all stash && git push --tags stash

You may then also want/need to setup user permissions on your projects as appropriate to your organization.

I hope this helps?


Hi Charles,

Is there some documentation somewhere on how to do this manually?



Thanks for everyone's help - I'll get started with the migration today.

Dave Kunkel

Suggest an answer

Log in or Sign up to answer
Community showcase
Published 14 hours ago in Agile

How Scrum works? It starts with training and education

To answer “How scrum works,” most of the teams I've worked with first addressed the question: “where to start?”  That question applies to both implementation and improvements on the Scrum framew...

94 views 3 3
Read article

Atlassian User Groups

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

Find a group

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

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you