Dear all,
I've just finished installing and configuring 2 BitBucket Server instances on the very same host.
I have both working perfectly integrated with Jira and Confluence. Each Bitbucket instance has its own Jira and its own Confluence instances.
Behind all instances I have MySQL with 6 databases (2 Jira's, 2 Confluence's and 2 Bitbucket's).
I have configured local backups for both Jira's and both Confluence's without any major issue (mysqldump into an .sql file)
But when I faced Bitbucket I found there are 3 methods to get the backups done. Due to my constrains, I chose "DIY backup" and adapted it to MySQL following several tips (including this one ).
Since I'm having 2 instances, I split the script usually called "bitbucket.diy-backup.vars.sh" into two new scripts called "bitbucket.diy-backup.vars_INSTANCE1.sh" and ""bitbucket.diy-backup.vars_INSTANCE2.sh"
To allow using these files, I've modified the script called "bitbucket.diy-backup.sh" by commenting one line and adding the following code:
case "$1" in
INSTANCE1)
source "${SCRIPT_DIR}/common.sh" INSTANCE1
;;
INSTANCE2)
source "${SCRIPT_DIR}/common.sh" INSTANCE2
;;
*)
echo "Usage: $0 { INSTANCE1 | INSTANCE2 }
;;
esac
#source "${SCRIPT_DIR}/common.sh"
And consequently, I've modified the file common.sh to get this under consideration:
case "$1" in
INSTANCE1)
BACKUP_VARS_FILE=${BACKUP_VARS_FILE:-"${SCRIPT_DIR}"/bitbucket.diy-backup.vars_INSTANCE1.sh}
source "${SCRIPT_DIR}/common.sh" INSTANCE1
;;
INSTANCE2)
BACKUP_VARS_FILE=${BACKUP_VARS_FILE:-"${SCRIPT_DIR}"/bitbucket.diy-backup.vars_INSTANCE2.sh}
;;
*)
echo "Usage: $0 { INSTANCE1 | INSTANCE2 }
;;
esac
# BACKUP_VARS_FILE=${BACKUP_VARS_FILE:-"${SCRIPT_DIR}"/bitbucket.diy-backup.vars.sh}
All these "magic" is working perfectly ... but one detail: the size of the backups are increasing every time the backup is run ... and its mixing backups from INSTANCE1 into INSTANCE2 folder:
root@localhost: /backup/bitbucket_INSTANCE1/backup-archives # du -sh *
729M bitbucket-INSTANCE2_20190305-063002.tar.gz
2,2G bitbucket-INSTANCE2_20190305-125802.tar.gz
So I'm running out of disk, and I wish to know what might be wrong here.
Is there any bitbucket-instances-interaction playing here in the background?
Any help over there?
Thanks and warm regards
Hi @Altran ,
I'm not sure what the bitbucket.diy-backup.vars.sh does, but why don't you simply make a backup of all databases directly ? Something like
mysqldump -u root -p --all-databases > alldb.sql
Otherwise, I would simply do a mysqldump of every database.
--Alexis
Hi Alexis!
That was my very first approach ... but reading all the docs related to backup & restore I got scared about consistency ... so I decided to use the scripts provided.
My team is working on office hours, so I can perfectly schedule backups during nights and they should be consistent since nobody will be touching anything. Is this approach right? Or perhaps Bitbucket is always "doing something" that implies that the backup process must be strictly followed?
Thanks and warm regards,
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
In my experience, as long as no modification happens on the filesystem you should be good with only database backups.
For bitbucket of course you need to consider your code repositories backup as well, but it should be handled separately.
Hope this helps,
--Alexis
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Alexis and all,
Finally I got two issues that were in place:
First, the instances weren't mixing, I just changed one variable that puts the name to the file compressed (tar.gz).
And second, the problem lies in both scripts for the variables ( "bitbucket.diy-backup.vars_INSTANCE1.sh" and "bitbucket.diy-backup.vars_INSTANCE2.sh"). I used the same original path, like this:
BITBUCKET_BACKUP_ARCHIVE_ROOT=${BITBUCKET_BACKUP_ROOT}/backup-archives
/INSTANCE1/
And it should be a completely different path, to avoid exactly the problem I faced (recursive backups):
BITBUCKET_BACKUP_ARCHIVE_ROOT=/bitbucket-backup-archives
/INSTANCE1/
Finally, if someone wants to check how the solution is working two Jira's, two Confluence's and 2 BitBucket's running with MySQL in the same server, feel free to ping me.
Warm regards,
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.