How to bulk change the "Repository Location" of the Fisheye/Crucible repositories
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
This page covers the steps required to change a significant amount of repository location in your Fisheye/Crucible instance.
In particular, it provides a faster alternative to performing the update via the user interface and upload the keys one by one. The following approach required that the same key is used for all repositories.
Solution
The main use case is to bulk change the "Repository Location" of the Fisheye/Crucible repositories from http to ssh.
This solution is based on a repository hosted in Bitbucket Server. Please note that the recommended approach is to configure the repositories using the "Bitbucket Server repositories" instead of the "Native repository access" tab.
ℹ️ These changes will not trigger a reindex of the repositories
The first steps are required to create a template repository to be used as a blueprint for the bulk changes and to generate a valid key:
In Fisheye, configure a repository using
ssh as "Repository Location"
select "Generate key pair for ssh" as "Authentication style"
hit the "Generate" button and add the key
In Bitbucket Server add the generated key to the repository
From Fisheye verify that the connection is successful
Add the generated key to all repositories in Bitbucket Server
Apply the changes to other repositories
Stop Fisheye
Locate the
config.xml
file in theFISHEYE_INST
directory.Create a backup copy of the
config.xml
file.Edit
config.xml
by applying the following changeslocation is the url to be used
remove the
password-auth
tag and replace it with thessh-auth,
the
is the same key available in the template repository just createdkey-name
Repository configured via http
1 2 3
<git location="http://<username>@<ip>:7990/scm/<project_slug>/<repository_key>.git" renames="none"> <password-auth password="<password>"/> </git>
Repository configured via ssh
1 2 3
<git location="ssh://git@<ip>/<project_slug>/<repository_key>.git" renames="none"> <ssh-auth key-name="<key_name_from_the_blueprint_repository"/> </git>
Restart Fisheye
Remove the template repository
Other use cases
The same procedure can be used in similar use cases.
Use case #1 - update the ip / hostname of the Git server
The same steps as above can be followed. The <ip> part in the location
attribute will need to be updated accordingly.
Was this helpful?