How to backup the Bitbucket on cloud?

sracherla September 21, 2016

How to backup the Bitbucket on cloud?
Does Atlassian have a backup? Is it restorable? 

8 answers

1 accepted

2 votes
Answer accepted
Robert Massaioli _Atlassian_
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
September 21, 2016

Bitbucket Cloud is backed up regularly by Atlassian. Atlassian has the ability to restore from its backups but otherwise you should not have to worry.

If you are still concerned, Git is a Distributed Version Control System, you could always just sync your repository to other locations to back it up.

You can read about this more here: https://confluence.atlassian.com/pages/viewpage.action?pageId=288658413

I hope that helps.

Update for 2020:

When I originally wrote this comment in 2016 I thought that people were mostly concerned about Bitbucket as a platform losing their data. However, that does not seem to be the concern in all of the recent comments so I feel like an update is required.

It seems that the most common concern these days is from mistakes that people might make on their own repositories and people desire the ability to fix these themselves by restoring from a Backup. I don't work directly on the Bitbucket Cloud team but I can direct you to the three issues in the public backlog that may track towards this.

Please vote on the issue that best reflects what you would want to see implemented and please comment on the issue with why you would want to see it implemented so that Bitbucket Cloud PM can triage the requests. Cheers!

Rori Stumpf February 24, 2019

Your answer in is conflict with the provided link:

"Our backups are for disaster recovery purposes only. We are not able to use our backups to restore repositories that have been deleted by an end-user."

To me this means that end users do not have access to backups.

Like # people like this
Deleted user June 11, 2019

Any update on this? We want to ensure, no repository is lost, when some dude accidentally deletes a repository.

Like # people like this
Haas June 11, 2019

I'd suggest taking action instead of waiting for Atlassian to come up with a reasonable plan. Because obviously they won't do that soon. Please check my answer to the question. I believe you can benefit from it.

Deleted user June 11, 2019

Thanks Cem, but it's not only about the source code, it's also about all the settings made within the repository.

Like Haas likes this
Peter Viscarola November 18, 2019

FWIW: I think it's positively scandalous that Atlassian doesn't provide a straight-forward way of grabbing backups of your team's repos.

It's a complete cop-out to say "you can always sync your repos" -- Yeah, I can.   Shall I go from office to office, then, and find the most recent person who's synch'ed every single one of our repos?  "Hey team... I've got the XYZ repo sync'ed form 10 November 2019... anybody got anything newer?  How about the ABC repro, and the DEF repro, and the..."

Silly.  They just should give us a way to dump all our stuff.

Like Andreas likes this
Robert Massaioli _Atlassian_
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
September 1, 2020

I originally made this comment in 2016 and, even though I thought that it met the need, I can see from the more recent comments that it is not quite what people want.

I've created some links to existing issues in the Bitbucket Cloud public backlog so that we can bring the comments from this thread into issues that the PM's will more directly triage.

If none of those issues match what you want, please report a new issue for the Bitbucket Cloud team to triage. Otherwise, please vote on an existing one and comment with why you want that feature. I hope this helps. Cheers!

2 votes
DEV OPS June 29, 2020

Absolutely ridiculous - we just became premium members and cannot believe the LACK of backup/restore for a premium cloud service... both non-existent and for some minimal functions, non intuitive.  Anyone from Atlassian here that can provide some insight on what they are doing in this area?   

1 vote
Haas June 11, 2019

Then I should clarify: we have been running it on an AWS Linux machine for a few months and recently switched to Ubuntu 18.04. It has been running successfully so far. Besides regular checks, I also tested the recovery process, which went well.

Rori Stumpf June 11, 2019

Great! Thanks for the feedback @Haas

I think I'll deploy to Kubernetes.

Like Haas likes this
1 vote
Haas April 17, 2019

I suggest taking a look at SCM Backup tool: https://github.com/christianspecht/scm-backup

We've been using this tool through a Jenkins job to take daily backups of our git repositories. It's very convenient and works cross-platform. 

Rori Stumpf June 11, 2019

Sounds like a good idea except for these inspirational words: "So far, SCM Backup has been written and tested on Windows only. Technically, it should run on Linux and MacOS as well, but this has not been tested yet."

Peter Viscarola November 18, 2019

The scm-backup solution works well.

Thanks Hass!

Like Haas likes this
0 votes
Peter Viscarola September 2, 2020

If you JUST want some simple way to backup your stuff, see this issue.

Peter

0 votes
B_ Brala April 20, 2020

deleted

0 votes
Rori Stumpf June 11, 2019

For anyone looking for a quick solution, here's a Docker file which will back up your Bitbucket repos easily. 

 

#
# Dockerfile for SCM Backup
#
# With thanks to Christian Specht for creating SCM Backups.
#
# 1. Install Docker
#
# 2. Copy the contents of this file to a file called 'Dockerfile'
#
# 3. Create settings.yaml -- see https://docs.scm-backup.org/en/latest/config-bitbucket/#authentication
#
# 4. Build Docker Image:
#
# docker build -t scm-backup .
#
# 5. Run the backup with output to ./bitbucket-backups:
#
# docker run -t --mount src=`pwd`/bitbucket-backups,target=/scm-backup-out,type=bind scm-backup
#

FROM ubuntu:18.04

WORKDIR /scm-backup

# Install .NET core and SCM Backup
RUN apt-get update && apt-get -y install software-properties-common && \
add-apt-repository universe && apt-get update && \
apt-get -y install sudo wget unzip apt-transport-https git && \
wget -q https://packages.microsoft.com/config/ubuntu/18.04/packages-microsoft-prod.deb && \
dpkg -i packages-microsoft-prod.deb && rm packages-microsoft-prod.deb && \
apt-get update && \
apt-get -y install dotnet-sdk-2.2 && \
wget https://github.com/christianspecht/scm-backup/releases/download/1.2.1/scm-backup-1.2.1.552abf5.zip && \
unzip scm-backup-1.2.1.552abf5.zip

# Copy settings.yml from local filesystem to the container (rebuild every time settings.yml is updated)
COPY settings.yml .

# Run the backup
ENTRYPOINT dotnet ScmBackup.dll
Haas June 12, 2019

Thanks @Rori Stumpf. This looks great! I'm sure there will be a lot of people who can benefit from this. If Christian agrees, I'd like to take this to the github repo of the project, so it can reach to more people. Is that OK with you? 

Rori Stumpf June 12, 2019

@Haas Thanks for the offer but I am actually working on cleaning it up and will create a pull request for the Github repo. Should be done in a few days. 

B_ Brala July 22, 2019

@Rori Stumpf hows the progress on that? :)

Like # people like this
Ming Han Chung April 20, 2020

@Rori Stumpf @Haas Did this ever happen?

Like Bradley MacDonald likes this
B_ Brala April 20, 2020

Nope

0 votes
tlroche September 21, 2016

Like Massaioli, I'll assume you're running Git, but the same advice applies to folks running Mercurial:

Robert Massaioli [1]
> Git is a Distributed Version Control System, [so] you could always just sync your repository to other locations to back it up.

Better yet, remember that

1. Your Cloud repo is just a remote of your local repo, which is just part of your local work directory, which is (wait for it ...) on your local file system! which you should be backing up regularly! if you value your sanity.

2. Your local repo is only part of your local work dir. Your local work dir(s) should contain all code (wait for it ...) on which you are working. Your repos (local or remote) are not backups for your local work! They should only contain work that has been finished (e.g., tested). So you still need to backup your local work dir--i.e., your local filesystem--even if you have a remote repo.

Stefan Salzl March 25, 2021

that doesn´t cover how and what reasons atlassian is used for. There are whole bunch of functionalities to link between source code and product/project management (jira) and some need to guarantee that correct connection between change issues/features/bugs and corresponding changes in the source code for eg. regulatory reasons.

Therefore a FULL backup is needed which means quite a lot more than "only" the sources but furthermore a whole history, users, links, etc,.....

Like # people like this

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events