I have around 150 repos (yes, working hard to delete/clean up as many as I can).
Of the remaining ones, I'd would like to back those up on a local drive in case something bad happens to Atlassian or I lose access for some reason.
These repos represent about 30 or more years for hobby fun for me, so they are important (to me!)
Hi @John Arrizza
Welcome To Community…
I understand that you want to get informed about data backup in Bitbucket Cloud. To answer your questions, Bitbucket Cloud takes hourly snapshots of all existing repositories across the entire platform. This means that every hour, GM+0, we will have an exact copy of your repository.
However, when new snapshots are created, the old ones get deleted to open more space for the new ones, and this purging takes place after 7 days
This means that we'll have backup snapshots of each repository for 7 days if it gets deleted, and for 7 days, different versions can exist as well, since the changes that are made are stored on the new snapshots
In case of disasters or mistaken deletion, please check out this documentation for more information about the recovery and backup repos, https://support.atlassian.com/bitbucket-cloud/docs/does-bitbucket-backup-my-repositories/ .
However, in case you want to have backup repositories locally, we advise you to make a bare clone of your repository in a new directory to save its state with the following steps:
You can run the following command to get a list of repositories under your account
curl -s -u "$userName:$password" "https://api.bitbucket.org/2.0/repositories/$accountName?pagelen=100&page=1Filter the JSON format output to get the repo slug
Use the repo slug to proceed with the "git clone --mirror <REMOTE_URL>"
You may refer to this as an example:
https://bitbucket.org/rtest123/repo-backup-script/src/master/account_repo_backup.sh
Please do note that we don't normally assist with creating a script for users as it's not part of our support scope - Atlassian Support Offerings - Atlassian Documentation
Additionally, there is an ongoing feature request that addresses your request. Please let me share it with you through the following link: https://jira.atlassian.com/browse/BCLOUD-19817. Feel free to vote for it, as this will expedite the delivery process, and also add yourself as a watcher to receive any updates.
Best regards,
Shwetha Suvarna
Thanks.
I've already got an python script using the v2 API interface. I'll tweak it to dump out the full URL list and then I'll try out the git mirror for each of those.
from atlassian.bitbucket import Cloud
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.