-
Notifications
You must be signed in to change notification settings - Fork 2
/
promote-db.sh
executable file
·29 lines (23 loc) · 1.11 KB
/
promote-db.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/bin/bash
# -------------------------------------------------------------------------------------
# The Disaster Recovery script to promote a standby Bitbucket Data Center database server.
#
# Ensure you are using this script in accordance with the following document:
# https://confluence.atlassian.com/display/BitbucketServer/Disaster+recovery+guide+for+Bitbucket+Data+Center
#
# It requires the following configuration file:
# bitbucket.diy-backup.vars.sh
# which can be copied from bitbucket.diy-backup.vars.sh.example and customized.
# -------------------------------------------------------------------------------------
# Ensure the script terminates whenever a required operation encounters an error
set -e
SCRIPT_DIR=$(dirname "$0")
source "${SCRIPT_DIR}/utils.sh"
source "${SCRIPT_DIR}/common.sh"
if [ "${INSTANCE_TYPE}" = "bitbucket-mesh" ]; then
# Mesh nodes don't run with an external database, so a standby database isn't required while disaster recovery
STANDBY_DATABASE_TYPE="none"
fi
source_disaster_recovery_database_strategy
##########################################################
promote_db