I've recently upgraded from Stash to Bitbucket, carefully following all the Atlassian migration notes. I even followed the instructions on how to connect to an external MySQL database, expecting to use the migration wizard to move our old stash database to the shiny new MySQL Bitbucket database. But I've done too much manually and Bitbucket is already using the (empty) MySQL database and the embedded one is not available to be migrated.
Please could someone advise me as to which configuration file(s) I need to edit to undo the partial manual migration, so that I can use the migration wizard to do it properly?
Or is there some way I can tell the migration wizard to go back to using the embedded database (I didn't recognise it in any of the target DB options)?
Thanks for your help, your questions made me think about the problem properly and ultimately led me to a solution. I've added an answer in case it helps someone else in the future.
The actual answer is to remove the database configuration lines from the Bitbucket Server config properties file, specifically: jdbc.driver
, jdbc.url
, jdbc.user
, jdbc.password
(and jdbc.ignoreunsupported
).
Without these settings Bitbucket doesn't have an external database to connect to and automatically falls back to using the internal HSQL database.
However, in my scenario, this was not the case, there was no HSQL database to fall back on; I had been misled into thinking that it wasn't using the MySQL database by invalid back-up files (incorrect port number specified in the back-up script).
The solution for me was to start an instance of the old MySQL server temporarily, using the data that was still lying around on the drive from before the original Stash to Bitbucket migration. Another temporary modification of the bitbucket.properties
file to point it at the old version of MySQL, with the my.ini
file edited so that it had a different port from the new MySQL server. I then had to drop the Bitbucket database from the new server and re-create it, because it had picked up empty tables from the failed migration. I re-started Bitbucket and used the Migration Wizard to migrate the database from the old version of MySQL to the new one, stopped the old MySQL and, to my great relief, the new Bitbucket configuration works with the new MySQL database. Win!
I've also fixed and tested the back-up scripts, so no more self-inflicted nightmares, and fixed the application links between JIRA and Bitbucket. I can even see all my repositories and clone, pull, push from a remote. Now all I need is for one of the other team members to tell me everything else I've missed.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
My plan now is to try to restore the MySQL 5.5 Stash DB and see if I can get the migration wizard to move that to the new MySQL 5.6 Bitbucket DB. I suspect that I've done something very wrong with the MySQL migration at some point.
(The easy answer to my original question is to remove the database configuration lines from the bitbucket.properties file.)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Simon,
Before making any suggestions, please allow me to ask a few questions to clarify this further:
Regards,
Gustavo
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.