How do I migrate team repositories from Bitbucket to Bitbucket Server?

We just purchased Bitbucket Server and we've been using for over a year now. Is there an easy way to take all of our repositories (88 of them) from and add them into Bitbucket Server in one shot? I realize the devs will have to add a new remote to their git repos.

5 answers

1 accepted

1 vote
Accepted answer

You could try our paid Add-on ScriptRunner for Bitbucket Server which offers mirroring functionality from Bitbucket Cloud to Server. It could help you with your migration.


Hi Alan,

I'm afraid there isn't an easy one shot way of doing this, but I'd like to link you to some instructions about the process, which you may be able to automatize somehow, if you can iterate over your list of repositories.

First document I'd like to refer you to is, specifically the section Import an existing Git project into Bitbucket Server. This explains the steps, with sample commands, to be run to import individually your repositories from Bitbucket Cloud to Bitbucket Server.

Steps 2 and 3 are the ones in which you have to go through the manual process of creating a repository in Bitbucket Server, but you may use the POST method of the REST API function /rest/api/1.0/projects/{projectKey}/repos to create a repository.


Gustavo Refosco

Hi @Alan Juden

This migration functionality is not native to Bitbucket Server. 

If you have a handful of repositories in Bitbucket Cloud, then you can follow the git commands in Importing code from an existing project - Import an existing Git Project into Stash to import your code one repository at a time.

If you have lots of repositories, or need to restructure as part of the migration then I would recommend using a plugin for the migration – the need to restructure is like since Bitbucket Cloud does not have the concept of a Project and in git one generally has lots of repos.  You will require additional planning and possibly several trys before you get the structure you want.

Migrating large enterprises to Bitbucket Server (previously Stash) is something that Black Diamond Software can assist you with.  We have both a plugin that automates this process and can guide you on the planning and transition.  If you'd like assistance please contact us 

Note, just noticed the new Bitbucket Server links from @Gustavo Refosco ... the content is the same in the old Stash (which is what I listed) but with new Bitbucket Server product you should those links instead... Or, as suggested, pursue an automation option.

@Alan Juden how much time did it take you to complete the migration, could you share your thoughts.

@DNFCS Sales - we changed the way that our repositories were setup. Instead of having 88 different repositories, we made a single repository that had all of the projects in there. So we pretty much just started over on it. We still have Bitbucket in case we need to look at revision history of a particular file...but that way seemed the easiest for our move. Sorry that I didn't respond until now, I just got back from vacation.


Hi there @Alan Juden!

Solano Services offers migration of customer repositories from hosted Atlassian Cloud ( to or from Atlassian Bitbucket Server running in customer’s choice of environment. This also includes: 

  • Migration of git repositories with branches and tags.
  • Migration of repository metadata to include: SSH public keys, pull requests (PRs), and PR metadata.

Some of the platforms we support include AWS, Google Cloud Platform, Azure, Rackspace, OpenStack, VMware and more. We are an AWS Advanced Technology Partner with the DevOps Competency designation, as well as members of the Google Cloud Platform Partner Program. Our expertise derives from successfully operating our flagship product, Solano CI, across major cloud providers. 

Check out this link for more information:


Suggest an answer

Log in or Sign up to answer
Community showcase
Published Nov 06, 2018 in Bitbucket

Upgrade Best Practices

Hello! My name is Mark Askew and I am a Premier Support Engineer for products Bitbucket Server/Data Center, Fisheye & Crucible. Today, I want to bring the discussion that Jennifer, Matt, and ...

1,923 views 7 10
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