Move or rename a Repository Stored Specs-enabled Build plan or Deployment project/Environment and keep the build history in Bamboo

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

Summary

The users are concerned if the build or deployment history will be maintained if a Build Plan or Deployment project is moved or renamed in Bamboo. The object uses Repository Stored Specs (RSS).

Bamboo allows users to easily move a Plan from one Project to the other. This is particularly not trivial when the Plan uses Repository Stored Specs. Deployment projects don't have the concept of "keys", but they still have names that can be renamed. This article covers that move.

Environment

  • Any version of Bamboo

  • RSS-enabled Build Plan or Deployment project

Diagnosis

When attempting to move or rename a Build plan or Deployment project directly via changes to the Specs code structure, Bamboo refuses the move with a message such as:

1 Caused by: java.lang.UnsupportedOperationException: Changing keys of plans and jobs is not supported during import. Old key 'OLDPROJ-PLAN1', new key 'NEWPROJ-PLAN1'

Or, it may – particularly true on YAML Specs that have no oid concept – create a new Build plan or Deployment Project but assign it the build counter to 0 and not move the build history.

Cause

Bamboo Specs does not support changing the keys of Build plans and jobs during the import, instead, it will create a new Plan with empty history when possible. The Build plan move action is not controlled by Specs and should be a manual action.

As Bamboo considers the complete${buildKey}– in the form PROJECT-PLAN-JOB, e.g.BAM-MAIN-JOBX– as the identifier for a build, the moved to Build Plan with a different Project name will be created and its counter reset and new builds will start at zero, meaning the build history will not be preserved. It may also be the case of the Specs code being refused when the Java Specs code uses Object Ids (oids) that would link the change to a specific object in the database and try to move it.

Deployment projects don't share the same "key" concept as Build plans, they actually use a concept of unique numeric Ids. You can still modify the names of the Deployment project and their Environments.

Solution

To completely move/rename the Build plan to a different project:

  1. On the Linked repository settings, Bamboo Specs tab, take notes of the "Access" permissions as they will be required when re-enabling it

  2. Still, on the Bamboo Specs tab, disable Specs scans on the Linked Repository Settings to prevent any commits from triggering the Plan change

  3. In the Bamboo UI, move the plan to a different project

    1. During the move, set a new Plan key and Name if necessary - If you just wish to rename the Plan, you will need to move it to a different Project and back

  4. Export the new Plan as Java or YAML Specs

  5. Compare the changes of the exported specs with your current Build Plan and make the necessary adjustments on its name, keys, etc

  6. Under the Linked Repository settings, Bamboo Specs tab, Enable Specs, adjust the Access permissions

  7. Scan the repository by clicking on Scan, over the Specs status tab

To rename a Deployment and Environment names:

  1. On the Linked repository settings, Bamboo Specs tab, take notes of the "Access" permissions as they will be required when re-enabling it

  2. Still, on the Bamboo Specs tab, disable Specs scans on the Linked Repository Settings to prevent any commits from triggering the Deployment project change

  3. Run the SQL workaround steps from the following BAM-- Disconnect Bamboo deployment from RSS:

  4. Make changes to the Deployment and Environment names manually using the Web interface

  5. Export the Deployment Project to Java or YAML specs

  6. Compare the changes of the exported specs with your current Deployment project and make the necessary adjustments on its name, keys, etc

  7. Under the Linked Repository settings, Bamboo Specs tab, Enable Specs, adjust the Access permissions

  8. Scan the repository by clicking on Scan, over the Specs status tab

Updated on March 11, 2025

Still need help?

The Atlassian Community is here for you.