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

Alan Juden September 24, 2015

We just purchased Bitbucket Server and we've been using Bitbucket.org for over a year now. Is there an easy way to take all of our repositories (88 of them) from Bitbucket.org 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
Answer accepted
Mark McCormack _Adaptavist_
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.
September 24, 2015

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.

 

2 votes
DNFCS_Sales June 9, 2016

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

alanjuden June 14, 2016

@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.

Alan

1 vote
gustavo_refosco
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.
September 24, 2015

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 https://confluence.atlassian.com/display/BitbucketServer/Importing+code+from+an+existing+project, 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 https://developer.atlassian.com/static/rest/bitbucket-server/4.0.1/bitbucket-rest.html#idp1862320 to create a repository.

Regards,

Gustavo Refosco

0 votes
Jorge Villanueva July 21, 2016

Hi there @Alan Juden!

Solano Services offers migration of customer repositories from hosted Atlassian Cloud (bitbucket.org) 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: https://www.solanolabs.com/products/services

 

0 votes
William Rojas (Black Diamond) September 24, 2015

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 sales@bds.com. 

William Rojas (Black Diamond) September 24, 2015

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.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events