How to Upgrade/Migrate Bamboo

Still need help?

The Atlassian Community is here for you.

Ask the community

This article only applies to the Atlassian server platform. Learn more about the differences between cloud and server.

Purpose

This article explains the steps needed to perform a Bamboo upgrade or Bamboo migration.

Solution

Current Bamboo instance

Bamboo current state has the following configuration:

  • The "O" in green icon represents to your current Bamboo installation.


Installing Bamboo

Before we start upgrading and/or migrating Bamboo we need to make sure the final server will run a fresh Bamboo install.

Refer to the following documentation for further information:

Regardless operating system Bamboo runs on verify that the dependencies comply to the Supported platforms.

At this stage you should have the following configuration:

  • The "O" in green icon represents to your current Bamboo installation, which now we will refer as OLD installation.
  • The "N" in green icon represents the new Bamboo installation.
  • The "D" in green icon represents a dummy database used by fresh Bamboo installation.


After making sure Bamboo is up and running on the new server it is time to connect Bamboo to existing data (users, builds, artifacts etc).

Working with the database

Since you have ran a fresh Bamboo install in the step above it is time to connect Bamboo with some database data.

Stop Bamboo as the "O" will no longer be used.


Go to the Bamboo server where you have all your data and generate a database dump.

Go to "<bamboo-home>/bamboo.cfg.xml" and review database details just to make sure you are in the correct location:

<property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
<property name="hibernate.connection.password">PASSWORD</property>
<property name="hibernate.connection.url">jdbc:mysql://localhost/BAMBOO-DB?autoReconnect=true</property>
<property name="hibernate.connection.username">USERNAME</property>
<property name="hibernate.dialect">com.atlassian.hibernate.dialect.MySQL5Dialect</property>
<property name="hibernate.setup">true</property>

Generate a database dump.

Now that we have a database dump from our OLD Bamboo installation it is time to restore it under a different database.

As a result you should have the following:

  • The "O" in green icon represents to your current Bamboo installation, which now we will refer as OLD installation.
  • The "N" in green icon represents the new Bamboo installation.
  • The "D" in green icon represents a dummy database used by fresh Bamboo installation.
  • The "R" in green icon represents the restored database.
  • In the "N" Bamboo installation, under the "<bamboo-home>/bamboo.cfg.xml" used by the NEW installation, remove the "D" database details and update it with the "R" database. As a result you should have the following:



Since you have connected Bamboo with our restored database now it is time to connect our "O" "<bamboo-home>" with the "N" Bamboo installation.

Working with the <bamboo-home> directory

In order to do it so:

  • copy your "O" "<bamboo-home>" onto the "N" Bamboo installation.

    • go to "N" under "<bamboo-install>/atlassian-bamboo/WEB-INF/classes/"
    • open and edit "bamboo-init.properties" to point to the just copied "<bamboo-home>" directory location.
    • Note that the environment variable BAMBOO_HOME takes precedence over the value defined in this file.
    • open the "<bamboo-home>/bamboo.cfg.xml" file and and change the following properties so they reflect the restored database R details:

      <property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
      <property name="hibernate.connection.password">PASSWORD</property>
      <property name="hibernate.connection.url">jdbc:mysql://localhost/BAMBOO-DB-RESTORED?autoReconnect=true</property>
      <property name="hibernate.connection.username">USERNAME</property>
      <property name="hibernate.dialect">com.atlassian.hibernate.dialect.MySQL5Dialect</property>
      <property name="hibernate.setup">true</property>
      

      Do not overwrite this file with the one in the new installation. You are limited to update only the above. Your old "bamboo.cg.xml" file may have customized details on it that we want to keep. It also holds the old build number which will trigger the needed upgrade tasks next time Bamboo is restarted.

  • As a result you should have the following:


    Start "N" Bamboo

    If you are upgrading Bamboo, at this stage the database restored "R" will start to upgrade to be compatible with the new Bamboo installation.

Symptoms

If you cannot login after the migration/upgrade and you have JIRA/Crowd or LDAP as User Management in Bamboo.

Resolution

  1. stop Bamboo
  2. open up <bamboo-home>/xml-data/configuration/atlassian-user.xml and replace its content with:

    <atlassian-user>
        <repositories>
            <hibernate name="Hibernate Repository" key="hibernateRepository" description="Hibernate Repository" cache="true"/>
        </repositories>
    </atlassian-user>
    

    This will allow the local users to log in. In case you don't remember the local admin credentials, refer to this page for resetting the admin password.

  3. start Bamboo

You should be able to start Bamboo and log in using the credentials setup during the Bamboo installation process.


Symptoms

If you are migrating from Windows to Linux or vice-versa, you should expect the following in atlassian-bamboo.log:

Caused by: org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [com.atlassian.crowd.integration.atlassianuser.UserConfigurationPersisterImpl]: Constructor threw exception; nested exception is java.io.FileNotFoundException: File '/bamboo/bamboo-home\xml-data\configuration/atlassian-user.xml' does not exist
	at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:100)
	at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:87)
	at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:186)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:795)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:713)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:386)
	... 197 more
Caused by: java.io.FileNotFoundException: File '/bamboo/bamboo-home\xml-data\configuration/atlassian-user.xml' does not exist
	at org.apache.commons.io.FileUtils.openInputStream(FileUtils.java:299)
	at org.apache.commons.io.FileUtils.readFileToString(FileUtils.java:1711)
	at org.apache.commons.io.FileUtils.readFileToString(FileUtils.java:1748)
	at com.atlassian.crowd.integration.atlassianuser.UserConfigurationPersisterImpl.detectPersistedConfigurationType(UserConfigurationPersisterImpl.java:84)
	at com.atlassian.crowd.integration.atlassianuser.UserConfigurationPersisterImpl.<init>(UserConfigurationPersisterImpl.java:27)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
	at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
	at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:85)
	... 202 more

Cause

Notice the way to navigate between directories on Windows is given by backslash "\" while on Linux it is used forwardslash "/". And this is the issue you are experiencing.

Caused by: java.io.FileNotFoundException: File '/bamboo/bamboo-home\xml-data\configuration/atlassian-user.xml' does not exist

Resolution

  • stop Bamboo
  • update "slashes" under "<bamboo-home>/bamboo.cfg.xml" from Windows format

    ...
        <property name="bamboo.artifacts.directory">${bambooHome}\artifacts</property>
        <property name="bamboo.config.directory">${bambooHome}\xml-data\configuration</property>
    ...
        <property name="bamboo.project.directory">${bambooHome}\xml-data\builds</property>
        <property name="buildWorkingDir">${bambooHome}\xml-data\build-dir</property>
        <property name="daily.backup.dir">${bambooHome}\backups</property>
    ...
        <property name="lucene.index.dir">${bambooHome}\index</property>
        <property name="webwork.multipart.saveDir">${bambooHome}\temp</property>
    

    onto Linux format:

    ...
        <property name="bamboo.artifacts.directory">${bambooHome}/artifacts</property>
        <property name="bamboo.config.directory">${bambooHome}/xml-data/configuration</property>
    ...
        <property name="bamboo.project.directory">${bambooHome}/xml-data/builds</property>
        <property name="buildWorkingDir">${bambooHome}/xml-data/build-dir</property>
        <property name="daily.backup.dir">${bambooHome}/backups</property>
    ...
        <property name="lucene.index.dir">${bambooHome}/index</property>
        <property name="webwork.multipart.saveDir">${bambooHome}/temp</property>
  • start Bamboo

Description

This explains the steps needed to perform a Bamboo upgrade and Migration.

ProductBamboo



Last modified on Nov 18, 2019

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.