How to update Bitbucket Server address / URL in Bamboo
Platform notice: Server and Data Center only. This article only applies to Atlassian products on the Server and Data Center platforms.
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
When changing the Bitbucket server URL, it's necessary to perform some steps to ensure the integration between Bitbucket and Bamboo continues to work. For the purpose of this knowledge-base article, it's important to understand there are two addresses that Bamboo uses to communicate with Bitbucket Server:
- Bitbucket's HTTP URL (aka the Application Link URL): This is used for a number of API calls between Bamboo and Bitbucket for nearly all integration features
- Bitbucket's SSH Base URL (Bitbucket Administration >> Server Settings > SSH Base URL): This is the address Bamboo uses to perform Git commands to detect changes and retrieve source code on both the Bamboo Server and its agents
Solution
This article assumes you are using the repository type Bitbucket Server / Stash. For plain "Git" repositories, the address simply needs to be updated on any repository entity: Linked / Repositories >> Edit >> Repository URL >> Save
Bitbucket Server HTTP URL
To update the Bitbucket server HTTP URL, you will need to delete the current application link and recreate it, using the new address:
- If you had only changed the Bitbucket server URL but didn't change the server at all, you may explore Relocating the Bitbucket Application Link. Relocating the Application link is the easiest configuration path and will not require you to recreate any Applinks on both endpoints.
- If you are migrating to a new Bitbucket server that has a different Server ID, each repository will need to be edited and re-saved to use the new Bitbucket Server / Application Link in Bamboo at Linked / Repositories >> Edit >> Server >> Save. If this is not a new server and simply a URL change, this action is not required and the application link just needs to be recreated as per above.
Bitbucket Server SSH Base URL
An updated SSH Base URL is not automatically persisted to Bamboo. If the SSH Base URL is changing, once it has been set in Bitbucket at Bitbucket Administration >> Server Settings >> SSH Base URL then each repository in Bamboo needs to be re-saved manually (Linked / Repositories >> Edit >> Save) to get the new SSH Base URL.
If you have too many repositories to manually update, you can use the workaround on the below feature request to update them in bulk via a SQL query on your Bamboo database:
- BAM-18273 - Getting issue details... STATUS