Uploaded image for project: 'Bitbucket Data Center'
  1. Bitbucket Data Center
  2. BSERV-8242

Upgrade to Bitbucket Server 4.x from Stash 3.x results in Reject Force Push HOOK being disabled. Config breaks with plugin-key rename from stash to bitbucket namespace

    XMLWordPrintable

Details

    Description

      Problem:

      When upgrading Stash 3.x to Bitbucket Server 4.x.x the State of the Reject Force Hook for the repositories is not retained. It will be off for all repositories regardless of its previous state before the upgrade.

      HTR

      1. Setup Stash 3.x and enable Reject Force Push in the repositories Hooks settings
      2. Upgrade to 4.x.x

      Expected results

      The Reject Force Push hook is still enabled.

      Actual results

      Note the state of the Reject Force Push is disabled

      Analysis

      The hook keys retain their old namespace reference to "com.atlassian.stash.stash-bundled-hooks" which doesn't match the new namespace "com.atlassian.bitbucket.server.bitbucket-bundled-hooks".

      Workaround

      Always back up your database before performing any modification to the database. If possible, try your modifications on a test server.

      Perform a database update:

      Postgres SQL to change state of Reject Force Push Hook to state that it was in before upgrade
      UPDATE public.sta_repo_hook
      SET hook_key = 'com.atlassian.bitbucket.server.bitbucket-bundled-hooks:force-push-hook' 
      WHERE hook_key = 'com.atlassian.stash.stash-bundled-hooks:force-push-hook'
      AND repository_id NOT IN (
          SELECT repository_id
          FROM public.sta_repo_hook
          WHERE hook_key = 'com.atlassian.bitbucket.server.bitbucket-bundled-hooks:force-push-hook'
      )
      

      Attachments

        Issue Links

          Activity

            People

              bturner Bryan Turner (Inactive)
              cdrummond Craig Drummond
              Votes:
              1 Vote for this issue
              Watchers:
              10 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: