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
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Jonatan Bouillon or @Steve Thornhill
Any further info on how to automate a backup of all BitBucket repos?
Thanks a lot
Luke
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello @Jonatan Bouillon , Could you share with us the script you are using
Thanks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi, the script is provided in a previous comment.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks everyone. Will look into doing a PowerShell backup as well. Cheers
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.