Windows service launches old version after upgrade
Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.
Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.
*Except Fisheye and Crucible
Problem
After upgrading Bitbucket Server the Service launches the old Bitbucket Server release.
Cause
This Problem may be occurring due the causes below:
The service hasn't been installed or updated for the new instance. The Bitbucket Server installer offers an option for installing Bitbucket Server as a service and you probably chose not to install it as a service, which causes this situation.
The installation variable is referencing the old Bitbucket installation folder.
Resolution
Service Name
If you don't know the exact name of your old Bitbucket Server service, you can find out what they are by following the steps below:
Navigate to 'Control Panel' > 'Administrative Tools' > 'Services'.
The 'Services' window should appear.
Right-click on the service you wish to find out the name of, and select 'Properties' from the popup menu.
The 'Service name' should appear in the 'General' tab.
Use this parameter as a substitute for
<ServiceName here>
on the command below.
Steps to remove the existing service:
Open an administrator level command-prompt
Navigate to
<Bitbucket Server installation directory>/bin
.Remove the old service, the service is likely named "AtlassianBitbucket Server". You can check the actual name by viewing the Properties of the service:
service.bat remove <ServiceName here>
Sometimes, executing the command above might result on the following message:
1 2 3
The JAVA_HOME environment variable is not defined correctly. This environment variable is needed to run this program NB: JAVA_HOME should point to a JDK not a JRE
If that happens to you, make sure your
JAVA_HOME
is pointing to a JDK as opposed to a JRE. For example, we've had customers pointing toc:\programs\java\jdk1.8.0_05\jre
and changing it temporarily intoc:\programs\java\jdk1.8.0_05\jre
with aSET JAVA_HOME=c:\programs\java\jdk1.8.0_05
before executing the command above fixes it.If there are still any issues removing the service, open a command prompt and run the following command to remove it: sc delete <ServiceName here>
Install the new service using the instructions from this document
2. Run Bitbucket in a new command prompt
If previously was a Bitbucket instance running, the INST_DIR variable was referring the old Bitbucket installation directory. It can be checked it by running this command:
1
echo %INST_DIR%
If it's the case, close and open a new command prompt and run bitbucket.
Was this helpful?