Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

How I can backup all the repository bitbucket cloud of one of the team I have?

Jonatan Bouillon March 1, 2018

Bitbucket does backup but to add one more local backup I want to backup daily on an windows server locally,

I know I can do a clone by command line and a schedule tasks with powershell in windows that pull for all folder but I have 200 repository so i'm wondering if there is a way to clone all the repository at once.

I could also use a tool to do the dailybackup but I didn't find any so far.

Thanks for any suggestion

2 answers

1 vote
Steve Thornhill
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.
March 1, 2018

If you are going to replicate the repositories to a separate server then a script is certainly a decent way to do this.

You can use curl to process the rest api and get a list of all repositories, this allows you to create a simple loop in a script to run through all the repositories.

Jonatan Bouillon March 1, 2018

ok, thanks i will take a look at the rest api.

ecmwf November 15, 2018

Did you find the solution for this ?

Jonatan Bouillon November 15, 2018

Hi, I have follow the advice to do a script but with powershell and use bitbucket auth and app password to connect to the bitbucket api.

You can start by reading this documentation : 

https://developer.atlassian.com/cloud/bitbucket/oauth-2/

I have done a gist of my script but I'm just not sure how I did to get the first refresh token. I think I have done a connection to get my first token and I keep using the same token to refresh my token. 

The script does a clone if it's not already cloned, if it's already clone that it's pull the source code that new.

https://gist.github.com/jobou363/32e8d291336bf03ceb51f380e1b489ec

Ruby March 29, 2023

Hi Jonatan, it's interesting to see the way to back up the repos. However, the post was 5 years ago. Is there any new ways of backing up the cloud?

Luke Towers February 5, 2024

Hi @Jonatan Bouillon or @Steve Thornhill 

Any further info on how to automate a backup of all BitBucket repos? 

Thanks a lot 

Luke

Daria Kulikova_GitProtect_io_ February 6, 2024

Hello @Luke Towers and @Jonatan Bouillon ,

Since that time there have already appeared backup tools that can help automate Bitbucket backups. For example, GitProtect backup for Bitbucket (the backup solution also backs up Jira Cloud, JSW, JWM). 

Using GitProtect backup app, it's easy to automate Bitbucket backups at the most suatable time, follow the 3-2-1 backup rule and send backups to multiple locations - Cloud or local, replication between storages, full data coverage - backup includes repositories and metadata, retention to meet security standards, ransomware protection, restore and Disaster Recovery.

You can learn more about the solution on Atlassian Marketplace: https://marketplace.atlassian.com/apps/1225728/gitprotect-io-backup-for-bitbucket?hosting=cloud&tab=overview 

Hope my answer would be useful,

Cheers,

Daria

Jonatan Bouillon February 6, 2024

@Luke Towers i still use the same backup procedure for now on de devops server Teamcity inhouse that use a powershell script and the bitbucket api.

I do not plan to use something else in short and medium term.

 

 

 

 

0 votes
Luke Towers February 6, 2024

Thanks everyone. Will look into doing a PowerShell backup as well. Cheers

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events