Sync Bitbucket Server repo to another Bitbucket Server repo?

Ryan Weiss February 2, 2018

We have two instances of Bitbucket Server. I have few projects with hundreds of repos in one instance and need to move them all to the other instance of Bitbucket Server. Is there a plugin or a way to do this that isn't manual.

 

Thanks!

2 answers

1 accepted

3 votes
Answer accepted
Caterina Curti
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 17, 2018

Hi Ryan,

At the moment, it is not possible to migrate all details of an existing repository across instances. This is the existing feature request for that:

https://jira.atlassian.com/browse/BSERV-4586

 

In your case, you could still move the full history of the Git repositories by creating the projects and repositories on the target instance and then importing the repositories.

The creation of projects and repositories can be automated using the REST API endpoints (https://docs.atlassian.com/bitbucket-server/rest/5.8.0/bitbucket-rest.html).

The Git history can then be pushed to the newly created repository by following the instructions on the user interface for an empty repository. These can also be automated by using the details of the new repositories and having a full set of the repositories available locally. A backup could also be used for this purpose, the Restore a deleted repository for Bitbucket Server page also covers how to identify the repository details from a backup.

 

Cheers,

Caterina - Atlassian Support 

0 votes
Caterina Curti
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 17, 2018

Hi Ryan,

Does the second instance already contains any repositories?

If not, we could restore a backup to the second instance. However, this will remove all the existing all existing repositories so it is only an option if the target instance is empty.

 

Cheers,

Caterina - Atlassian Support  

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events