I'm incredibly frustrated. I've been trying to migrate our Bitbucket server from a local VM to AWS and I can't get it to work. I started with https://confluence.atlassian.com/bitbucketserver/administering-bitbucket-server-in-aws-776640308.html then used the server template from https://confluence.atlassian.com/bitbucketserver/quick-start-with-bitbucket-server-and-aws-776640254.html. We backed up our existing server using Bitbucket Server Backup Client so I went to https://confluence.atlassian.com/bitbucketserver/using-the-bitbucket-server-backup-client-776640064.html#UsingtheBitbucketServerBackupClient-runrestore.
But here's where I started to have trouble. The server seemed to have a demo project in /var/atlassian/application-data/bitbucket but the additional storage (200GB) appeared under /media/atl/bitbucket/:
$ df -hl
Filesystem Size Used Avail Use% Mounted on
devtmpfs 1.9G 80K 1.9G 1% /dev
tmpfs 1.9G 0 1.9G 0% /dev/shm
/dev/xvda1 50G 43G 6.9G 87% /
/dev/xvdb 15G 39M 15G 1% /media/ephemeral0
tank/atlassian-home 193G 66M 193G 1% /media/atl
tank 193G 0 193G 0% /tank
I stopped the server:
sudo -u atlbitbucket /opt/atlassian/bitbucket/bin/stop-bitbucket.sh
then tried using:
sudo -u atlbitbucket /opt/atlassian/bitbucket/bin/set-bitbucket-home.sh /media/atl/bitbucket
I couldn't figure out the parameters for the restore. After some guesswork I took the username and password from /var/atlassian/application-data/bitbucket/shared/bitbucket.properties, then guessed at the database host and port:
sudo java -Djdbc.override=true -Djdbc.driver=org.postgresql.Driver -Djdbc.url=jdbc:postgresql://localhost/bitbucket -Djdbc.user=atlbitbucket -Djdbc.password=#### -Dbitbucket.home=/media/atl/bitbucket/ -jar bitbucket-restore-client.jar bitbucket-20181024-233703-804.tar
But then I got "The target database contains tables whose names collide with Bitbucket's tables. Please migrate to a clean, empty database."
So I used:
sudo -u atlbitbucket psql -d bitbucket -U atlbitbucket
then this code to clear the database https://stackoverflow.com/a/36023359/264822
I finally got the restore to work and I reran the server but now when I open the URL it redirects to http://127.0.0.1:7990/setup. It's likely that one of my previous steps has screwed something up but I have no idea because of the complete lack of documentation around this.
Does anyone have any experience with this? Once I get the damned thing working I'm going to write up a blog post so nobody else has to go through this stupidity.
Hi @tomisaacson and Community!
We've just built the beta of a solution to help ease migrations from Server/Data-Center-on-prem to Data-Center-on-AWS-Quickstarts.
Would you be interested to join our beta program and try out this solution? If you're interested, or would like to find out more, please email me at firstname.lastname@example.org.
That looks like Bitbucket can't talk to the database, so it's starting up as if it was a fresh install.
Can you check your database connection settings in your bitbucket.properties?
Also check /var/atlassian/application-data/bitbucket/log/atlassian-bitbucket.log to see if there are any connection errors shown there.
# primary db url
Maybe try and add the port number as above..
Also, I see that you are using a non-standard install location, as in /media instead of /var. That complicates things slightly. Make sure the shell scipts in /opt/atlassian/bitbucket/5.15.0/bin/ are using the /media path rather than /var.
Hi everyone, We are looking to learn more about development teams’ workflows and pain points, especially around DevOps, integrations, administration, scale, security, and the related challeng...
Connect with like-minded Atlassian users at free events near you!Find an event
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.Host an event
You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events