Configuring Bitbucket Data Center to work with Amazon Aurora
These instructions will help you connect Bitbucket Data Center to an existing Amazon Aurora PostgreSQL database.
Amazon Aurora is only supported on a Data Center license
Bitbucket Data Center supports the use of a single-writer, PostgreSQL-compatible Amazon Aurora clustered database. A typical production-grade cluster includes one or more readers in a different availability zone. If the writer fails, Amazon Aurora will automatically promote one of the readers to take its place. For more information, see Amazon Aurora Features: PostgreSQL-Compatible Edition.
The overall process for using a PostgreSQL-compatible Amazon Aurora database with an existing Bitbucket deployment is:
- Deploy Amazon Aurora (preferably, through the Modular Architecture for Amazon Aurora PostgreSQL Quick Start).
- Configure PostgreSQL on the Amazon Aurora database.
- Connect your Bitbucket deployment to the Amazon Aurora database.
See Supported platforms for the versions and configurations of Amazon Aurora supported by Bitbucket Data Center.
Backups (for migrations)
If you are migrating Bitbucket Server data from the HSQL internal database, back up the Bitbucket Server home directory.
If you are migrating Bitbucket Server data from another external database, back up that database by following the instructions provided by the database vendor before proceeding with these instructions.
See Data recovery and backups.
1. Deploy Amazon Aurora
Use the Quick Start for new deployments
If you are deploying a new Bitbucket Data Center with Amazon Aurora from scratch, we recommend that you use the AWS Quick Start for Bitbucket. This Quick Start lets you configure a PostgreSQL-compatible Amazon Aurora cluster with one writer and two readers (preferably in separate availability zones). See Getting started with Bitbucket Data Center in AWS for more information.
Bitbucket Data Center specifically supports the use of an Amazon Aurora cluster with the following configuration:
It must have only one writer, replicating to one or more readers.
Your PostgreSQL engine must be version 9.6 or higher.
See Supported platforms for more details.
AWS documentation
Modular Architecture for Amazon Aurora PostgreSQL: a Quick Start that guides you through the deployment of a PostgreSQL-compatible Aurora Database cluster. This cluster has one writer and two readers, preferably in different availability zones.
Upgrading the PostgreSQL DB Engine for Amazon RDS: shows you how upgrade your database engine to a supported version before migrating it to Amazon Aurora.
Migrating Data to Amazon Aurora PostgreSQL: contains instructions for migrating from Amazon RDS to a PostgreSQL-compatibleAmazon Aurora cluster.
Best Practices with Amazon Aurora PostgreSQL: contains additional information about best practices and options for migrating data to a PostgreSQL-compatible Amazon Aurora cluster.
Amazon also offers an AWS Database Migration Service to facilitate a managed migration. This service offers minimal downtime, and supports migrations to Aurora from a wide variety of source databases.
When migrating from a non-clustered PostgreSQL database into an Amazon Aurora database, we recommend you use pg_dump
and pg_restore
. For more information, see Backup and Restore (from the PostgreSQL documentation).
2. Connect Bitbucket to the Amazon Aurora database
You can now connect Bitbucket to the PostgreSQL database, when you either:
- Run the Setup Wizard (at install time)
- Want to migrate Bitbucket to PostgreSQL (either from the embedded HSQL database or from another external database)
When running the Setup Wizard at install time
- Select External at the 'Database' step.
- Select PostgreSQL for Database Type.
- Complete the form. See the table below for details.
- Click Next, and follow the instructions in the Setup Wizard.
When migrating to Amazon Aurora
- In the Bitbucket administration area, click Database (under 'Settings').
- Click Migrate database.
- Select PostgreSQL for Database Type.
- Complete the form. See the table below for details.
- Click Start Migration.
Hostname
The hostname or IP address of your Amazon Aurora database.
Port
The TCP port with which Bitbucket can connect to the database server.
Database name
The name of your Amazon Aurora database.
Database username
The username that Bitbucket should use to access the database.
Database password
The password that Bitbucket should use to access the database.