We lost our server that was hosting Bitbucket on prem. The database is intact. I want to install Bitbucket on new server and connect to old database. What are the right procedures to not lose configuration? I tried to just point new install to the old database but it wants a clean database. For JIRA, I copied the old home directory on top of the new install. Updated the database connection info and boom it worked. Will the same thing work for Bitbucket? Not sure if I can get to old BItbucket home directory anymore so thought I would ask in here.
If you backed using one of the methods in Using Bitbucket zero downtime backup or Using Bitbucket Server DIY Backup you can restore by running the restore script as the home and database info will be saved in the backup:
Additionally, if you used the Bitbucket Server Backup Client that will capture the home directory as well and you can restore using the below directions:
Restoring Bitbucket Server to use the existing DB
This section applies if you are restoring Bitbucket Server to fix a corrupted installation, but are able to use the existing DB that Bitbucket Server was backed up from. This scenario assumes that Bitbucket Server is to be restored to the same server from which Bitbucket Server was originally backed up.
The Restore Client must be run on the machine that Bitbucket Server should be restored to. To ensure restores do not accidentally delete existing data, the Restore Client will only restore into an empty home directory and an empty database.
The Restore Client will use the JDBC connection configuration contained in the backup you are restoring from.
Follow this process:
- Stop your Bitbucket Server instance.
- Delete the content of the current home directory, so that it is empty.
- Drop the existing tables in your database so it is empty. The database still needs to exist with the same user/password, and it should have the configuration described in the 'Create the Bitbucket Server database' section of the relevant page here:
Run the Restore Client using the following command (replacing '
path/to/bitbucket/home' and '
/path/to/original/backup/file' with your own values):
java -Dbitbucket.home="path/to/bitbucket/home" -jar bitbucket-restore-client.jar /path/to/original/backup/file
If you are restoring Bitbucket Server to fix a corrupted installation, now follow Steps 4 to 6 of the Bitbucket Server upgrade guide. Note that you should use the same version of Bitbucket Server that was used to back up Bitbucket Server.
Thanks, since I did not follow the procedures for backing up (hangs head in shame) I did not have a restore to perform. But I did have copies of the old server directories. I copied the home directory and the directory in Application Data folder. I then modified the environment variable to point to the old home directory name that I had just copied over. The database and server were the same so nothing to update for that. I started it up and it worked.
I will be using Backup Server Client now on a regular basis. :)
Badges are a great way to show off community activity, whether you’re a newbie or a Champion.Learn more
After spinning my wheels trying to get organized enough to write a book for National Novel Writing Month (NaNoWriMo) I took my affinity for Atlassian products from my work life and decided to tr...
Connect with like-minded Atlassian users at free events near you!Find a group
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no AUG chapters near you at the moment.Start an AUG
You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs