Upgrading To Bitbucket Server 6.0
This page describes how to migrate from Bitbucket Server 5.x to 6.0. Release 184.108.40.206-bbs6 is the first release that is compatible with Bitbucket Server 6.0 onwards.
Atlassian have removed a number of deprecated methods and provided alternatives, therefore you will have to modify your scripts. If you don’t have any custom scripts, and are only using the simple conditions that come as examples in the plugin, you may well have nothing to do.
If you have any issues please contact us via our Service Desk.
This page is split up into a suggested upgrade procedure, and the possible areas you will need to change.
At the time of writing, the official page explaining the upgrade procedure is here which we recommend you read before upgrading.
How to upgrade
First you should create a clone of your production system that you can do a practice upgrade on. There is an Atlassian knowledge base article about creating a staging system here.
Once you have the staging system created, upgrade it to Bitbucket Server 6. Then install the ScriptRunner plugin.
The static type checker available in ScriptRunner for Bitbucket Server should be able to indicate problems quite quickly.
You should open each admin page that lists each extension point, eg pre-receive hooks, event handlers etc. Look for code highlighted with red errors, fix them and check that the script shows the green dot of successful compilation.
If practical, test your most important scripts and conditions in your staging server.
Finally, make sure that your maintenance window includes enough time to do your production upgrade, and then the modifications to the scripts that you have already tested in your staging server.
Areas of change
This is not a definitive list, for that see the Atlassian guidelines. However, these are the changes we think you are most likely to have to make to your scripts.
Deprecated APIs removed
APIs that were marked as deprecated in Bitbucket Server 5 have now been removed. Full details of which classes, interfaces and methods have been removed can be found here.
Therefore you may need to update your custom scripts and conditions. You should be able to find the existing class, interface or method and use the alternative listed in those Javadocs:
Removal of Branch and Tag Naming Rule Enforcer event handler functionality
Due to the decision by Atlassian to deprecate and then subsequently remove the events BranchCreationRequestedEvent and TagCreationRequestedEvent, we have taken the decision to deprecate the Branch and Tag Naming Rule Enforcer event handler to the extent that, while the configuration will still exist within ScriptRunner for future reference, it will no longer have any effect from this point onwards.
When editing the Branch and Tag Naming Rule Enforcer event handler the user is displayed with the following message:
|This event handler is deprecated and has no effect. Use the pre-receive hook of the same name instead.|
As indicated by the message, from this point onwards, in order to maintain the same functionality, users should make sure to have configured the Branch and Tag Naming Rule Enforcer pre-receive hook instead.
Have questions? Visit the Atlassian Community to connect, share, and learn with other Atlassian users and experts, including Adaptavist staff.
Want to learn more? Check out courses on Adaptavist Learn, an online platform to onboard and train new users for Atlassian solutions.