How to migrate an existing Bamboo Data Center Remote Agent to a new location

Still need help?

The Atlassian Community is here for you.

Ask the community



Platform Notice: Data Center - This article applies to Atlassian products on the Data Center platform.

Note that this knowledge base article was created for the Data Center version of the product. Data Center knowledge base articles 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

Summary

This article explains how to move a Bamboo Data Center remote agent from its current location to a new location. This guide will be helpful in the following cases:

  • When a new drive or partition has been added to the agent host and the agent home directory needs to be moved to the new drive or partition.
  • When more space is required for the remote agent.
  • When you want to move the agent to a different location without affecting the contents of the agent's working directory.

Environment

Any supported version of Bamboo (Validated in Bamboo 9.6.8).

Solution

This can be achieved in multiple ways, and below are the possible options. Based on the advantages and disadvantages of each, consider the option that best suits requirements.

Option 1: Moving the complete Bamboo agent home and build working directory

  1. New Disk Permissions: Please ensure that the new location is properly mounted, configured, and accessible, with the necessary permissions granted to the user running the Bamboo agent.

  2. Stop the Bamboo Agent: Stop the Bamboo remote agent at its current location to ensure no processes are running before proceeding to the next step.
  3. Move Bamboo Agent Home Folder: Move the complete Bamboo agent home folder contents to the new drive/ partition. Ensure that all files, including configurations and build directories, are transferred correctly.
  4. Update Bamboo Agent Configuration: Modify the Bamboo remote agent's configuration in the new location to point to the new drive/partition.
    1. Update bamboo.home property to a new location in the file <new-bamboo-agent-home>/conf/wrapper.conf configured for the property wrapper.java.additional.1 .
      wrapper.java.additional.1=-Dbamboo.home=<new-bamboo-home-location>
    2. Update buildWorkingDirectory property to a new location in the file <new-bamboo-agent-home>/bamboo-agent.cfg.xml.
      <buildWorkingDirectory>NEW-BAMBOO-AGENT-HOME/xml-data/build-dir</buildWorkingDirectory>
  5. Update the Startup Script: In case if the agent is managed as part of a service or a script, please update the startup script to start from the new location. 
  6. Start the Remote Agent: Once the changes are applied, start the remote agent from the new Bamboo agent home directory.

The advantage of this option is that the entire Bamboo agent home can be moved to a new location, providing flexibility in managing it from the new location. 

If the agent is moved to a new host:

  • The operating system of the new host should be same as old host
  • Bamboo agent will need to be authenticated again during startup, as outlined in the documentation.

Option 2: Moving the build working directory alone without moving Bamboo home

The buildWorkingDirectory is a location where the agent checks out files and executes builds, similar to the xml-data/build-dir/ directory on the Bamboo server. The files in this directory are generated by Bamboo build and deployments and are not part of Bamboo itself. The buildWorkingDirectory serves as the working directory for builds and deployments, with all build commands executed from here.

  1. New Disk Permissions: Please ensure that the new location is properly mounted, configured, and accessible, with the necessary permissions granted to the user running the Bamboo agent.
  2. Stop the Bamboo Agent: Stop the Bamboo remote agent at its current location to ensure no processes are running before proceeding to the next step.
  3. Move Bamboo Agent Working Directory: Move the build directory located in the path <bamboo-agent-home>/xml-data/ from its current location to new location. Ensure that all build directories are transferred correctly.
  4. Update Bamboo Agent Configuration: Modify the Bamboo remote agent's configuration to point to the new location for the buildWorkingDirectory alone by updating buildWorkingDirectory property to a new location in the file <bamboo-agent-home>/bamboo-agent.cfg.xml.
    <buildWorkingDirectory>AGENT-NEW-WORKING-DIRECTORY/xml-data/build-dir</buildWorkingDirectory>
  5. Start the Remote Agent: Once the changes are applied, start the remote agent from the new Bamboo agent home directory.

The advantage of this option is that there is no need to modify any startup scripts since the Bamboo home directory remains unchanged. 

The disadvantage is that the Bamboo agent home and build directory will be located in different places (which is not the default configuration), so it will be necessary to keep track of these locations, especially if the agents need to be migrated in the future. That said, there won’t be any issues with the way the Bamboo agent works.

Option 3: Create symlinks without making any config changes

  1. New Disk Permissions: Please ensure that the new location is properly mounted, configured, and accessible, with the necessary permissions granted to the user running the Bamboo agent.
  2. Stop the Bamboo Agent: Stop the Bamboo remote agent at its current location to ensure no processes are running before proceeding to the next step.
  3. Move Bamboo Agent Working Directory: Move the build directory <bamboo-agent-home>/xml-data/ from current location to new location. Ensure that all build directories are transferred correctly.
  4. Create symlink: Create a symlink for the xml-data directory in the current Bamboo agent home location to point to the new location. This way, you won’t need to modify any Bamboo configurations, and the directory will still refer to the new path.
    ln -s <agent-new-working-dir> <old-bamboo-agent-home>/xml-data
  5. Start the Remote Agent: Once the changes are applied, start the remote agent from the new Bamboo agent home directory.

The advantage of this is that no need to touch any of the Bamboo agent configurations or the startup scripts. 

Below are a few related documents to this topic that might be helpful:


Last modified on Feb 27, 2025

Was this helpful?

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