How to bulk change the "Repository Location" of the Fisheye/Crucible repositories
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.
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.xmlfile in the
Create a backup copy of the
config.xmlby applying the following changes
location is the url to be used
password-authtag and replace it with the
key-nameRepository configured via http
<git location="http://<username>@<ip>:7990/scm/<project_slug>/<repository_key>.git" renames="none"> <password-auth password="<password>"/> </git>Repository configured via ssh
<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.