Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Deleted user
0 / 0 points
Next:
badges earned

Your Points Tracker
Challenges
Leaderboard
  • Global
  • Feed

Badge for your thoughts?

You're enrolled in our new beta rewards program. Join our group to get the inside scoop and share your feedback.

Join group
Recognition
Give the gift of kudos
You have 0 kudos available to give
Who do you want to recognize?
Why do you want to recognize them?
Kudos
Great job appreciating your peers!
Check back soon to give more kudos.

Past Kudos Given
No kudos given
You haven't given any kudos yet. Share the love above and you'll see it here.

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Migrating BB to a new server

Hello, I need to migrate Bitbucket (5.15.1) to a different server.

I have tried the 2 options in this doc to no avail: https://confluence.atlassian.com/bitbucketserver0515/migrating-bitbucket-server-to-another-server-961275665.html

  • I have backed/zipped both the Install and Home directories from the existing production server and unzipped them to the new server. I get that message below. I update the variable for JRE_HOME as it indicates (because I have a later version of Java installed on the new server) and it still fails with the same error.
  • I have started from scratch and performed the download/install of the same version of BB on the new server. I still copied the zip files from above into the new server and unzipped them. Still the same error.

 

This is what happens when I launch bb

 

[root@atlassian2 bin]# service atlbitbucket status

Bitbucket is not running (pidfile exists)

[root@atlassian2 bin]# service atlbitbucket start

The JRE_HOME environment variable is not defined correctly

This environment variable is needed to run this program

Edit set-jre-home.sh and define JRE_HOME

 

Startup has been aborted

[root@atlassian2 bin]#

[root@atlassian2 bin]# nano set-jre-home.sh

 

Displaying Java information below shows the same path I put in the set-jre-home.sh script.

[root@atlassian2 bin]# echo $JAVA_HOME

/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.275.b01-1.el8_3.x86_64

[root@atlassian2 bin]# echo $JRE_HOME

Thank you in advance for any assistance.

 

1 answer

 What is the output of echo $PATH ?

Check if it has set the correct path to the java executable. 

If it doesn't, then set the path with following. 

export JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.275.b01-1.el8_3.x86_64
export PATH=$JAVA_HOME/bin:$PATH

Hi @Suhas Patil thanks for the response. It went into Spam so I apologize for the late reply.

I have reverted back to a snapshot prior to setting things up. I have done a

sudo ./atlassian-bitbucket-5.15.1-linux-x64.bin to get it to install successfully as a Service.

the results of your query is below, so it appears correct.

[root@atlassian2 bitbucket]# echo $JAVA_HOME
/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.275.b01-1.el8_3.x86_64
[root@atlassian2 bitbucket]# echo $JRE_HOME

[root@atlassian2 bitbucket]# echo $PATH
/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.275.b01-1.el8_3.x86_64/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin

Now I need to get my data incorporated into this instance. I was hoping copying the existing Production Home and Install directories and their subdirectories (and import the mysql database) would get me back to where I need to be. Do you have an opinion/suggestion on this approach?

Thank you again.

In reviewing the set-jre-home.sh file it contains a totally different path:


[root@atlassian2 bin]# cat set-jre-home.sh
if [ -z "$JRE_HOME" ]; then
if [ -z "$JAVA_HOME" ]; then
# If JRE_HOME and JAVA_HOME are not defined, edit this line to define JRE_HOME
JRE_HOME="/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.282.b08-1.el7_9.x86_64/jre"
elif [ -n "$JAVA_HOME" ] && [ -x "$JAVA_HOME/jre/bin/java" ]; then
# If JAVA_HOME points to a valid JDK, use its JRE
JRE_HOME="$JAVA_HOME/jre"
elif [ -n "$JAVA_HOME" ] && [ -x "$JAVA_HOME/bin/java" ]; then
# If JAVA_HOME appears to point to a JRE and not a JDK use this anyway
JRE_HOME="$JAVA_HOME"

 

How does that happen?

That explains it, you need to modify the set-jre-home.sh with the correct JRE path. It's referring to the non-existing JAVA version.

Regarding copying prod directories, you can do it as long as it's the same instance (not prod to non-prod). Make sure, your database is reachable from the app server. 

you would never be able to get it working in the first shot, you will have to deal with many issues for sure. So i would recommend migrating the non-prod to the non-prod server first, fix all the issues there, document them, and then plan the production.

It does indeed however I did not update Java so that's a mystery. I originally installed java-1.8.0-openjdk-1.8.0.275.b01-1.el8_3.x86_64

Anyways, I will make the change and see how it goes. Thank you for your direction.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
SERVER
VERSION
5.15.1
TAGS
Community showcase
Published in Bitbucket

Calling any interview participants for Bitbucket Data Center

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...

645 views 7 4
Read article

Community Events

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

Events near you