Versions
- 9.3
- 9.2
- 9.1
- 9.0
- 8.19
- 8.18
- 8.17
- 8.16
- 8.15
- 8.14
- 8.13
- 8.12
- 8.11
- 8.10
- 8.9
- 8.8
- 8.7
- 8.6
- 8.5
- 8.4
- 8.3
- 8.2
- 8.1
- 8.0
- 7.21
- 7.20
- 7.18
- 7.19
- 7.17
- 7.16
- 7.15
- 7.14
- 7.13
- 7.12
- 7.11
- 7.10
- 7.9
- 7.8
- 7.7
- 7.6
- 7.5
- 7.4
- 7.3
- 7.2
- 7.1
- 7.0
- 6.10
- 6.9
- 6.8
- 6.7
- 6.6
- 6.5
- 6.4
- 6.3
- 6.2
- 6.1
- 6.0
- 5.16
- 5.15
- 5.14
- 5.13
- 5.12
- 5.11
- 5.10
- 5.9
- 5.8
- 5.7
- 5.6
- 5.5
- 5.4
- 5.3
- 5.2
- 5.1
- 5.0
- See all
Using Bitbucket Server DIY Backup in AWS
Getting started with Bitbucket Server and AWS
On this page
Related content
- No related content found
This page describes considerations for DIY Backup and Restore of Bitbucket instances deployed in an Amazon Web Services (AWS) environment.
About Bitbucket Server DIY Backup for AWS
The Bitbucket Server DIY Backup tools fully support backup and restore of Bitbucket instances deployed on Amazon Elastic Block Store (EBS) volumes and/or Amazon Relational Database Service (RDS) instances.
The tools work by taking EBS and/or RDS snapshots of Bitbucket's database and shared home directory volume. These snapshots can later be launched as new EBS volumes and/or RDS instances, and attached to your running instance, thus restoring Bitbucket to a specific point in time.
The benefits of using native Amazon EBS and RDS support in Bitbucket Server DIY Backup are:
- taking AWS native snapshots are faster than filesystem level copying
- backup-associated downtimes can be eliminated
- the snapshots are stored with the redundancy and durability of S3
- it makes it easy to relocate an instance to a different Region or Availability Zone in the future
The scripts use the AWS CLI toolset, which is included in all instances launched from the AMI, regardless of the method you used to launch it.
If you launched your Bitbucket instance via BitbucketServer.template or BitbucketDataCenter.template, your EC2 node(s) should already belong to an IAM role with a policy granting the permissions required to backup and restore the EBS volume and/or RDS instance. If you did not launch your Bitbucket instance in AWS via one of these CloudFormation templates, then see the Setting up the instance role section below for an example policy with similar permissions.
On this page
Configuring the Bitbucket Server DIY Backup in AWS
If you launched your Bitbucket instance via BitbucketServer.template or BitbucketDataCenter.template, there is already a copy of the Bitbucket Server DIY Backup tools pre-installed and pre-configured on your instance. Just SSH to your instance (the shared file server node in the case of Bitbucket Data Center), and run:
cd /opt/atlassian/bitbucket-diy-backup
git pull
./bitbucket.diy-backup.sh
If you launched your Bitbucket instance in AWS manually, you need to clone the Bitbucket Server DIY Backup repository and configure the variables manually.
git clone git@bitbucket.org:atlassianlabs/atlassian-bitbucket-diy-backup.git
cd atlassian-bitbucket-diy-backup
cp -i bitbucket.diy-backup.vars.sh.example-aws bitbucket.diy-backup.vars.sh
Then edit bitbucket.diy-backup.vars.sh
appropriately for your environment.
Once you have configured bitbucket.diy-backup.vars.sh correctly, you can then run your backups by typing:
./bitbucket.diy-backup.sh
See Using Bitbucket zero downtime backup for more information.
Setting up the instance role
The DIY backup and restore scripts use the AWS CLI toolset to do their job. These tools need to authenticate with AWS in order to gain access to your resources (EBS volumes, snapshots, etc). The recommended way of providing credentials to the instance is by launching it with an instance role that has a suitable policy attached. If you are using the Bitbucket Server CloudFormation template, it'll take care of creating a policy for you and attach it to the instance at launch time.
If you need to create your own policy, you can use this JSON object as an example of the minimum permissions required for an instance:
{
"Statement": [
{
"Resource": [
"*"
],
"Action": [
"ec2:AttachVolume",
"ec2:CreateSnapshot",
"ec2:CreateTags",
"ec2:CreateVolume",
"ec2:DescribeSnapshots",
"ec2:DescribeVolumes",
"ec2:DetachVolume"
],
"Effect": "Allow"
}
],
"Version": "2012-10-17"
}
For other ways of configuring the AWS CLI toolset, please refer to the documentation.
Related content
- No related content found