Moving your STASH_HOME directory out of your Bitbucket Server installation directory
Prior to Bitbucket Server 3.5.0, it was possible to set the BITBUCKET_HOME
directory, which is used to store application data (e.g. repositories, logs, caches and plugins) as the same directory as or a subdirectory of the installation directory, where binaries, jars and scripts are stored for running Bitbucket Server. Doing so causes a number of problems including:
- Increased pain during upgrades as the Bitbucket Server installation directory will be changed or replaced but will point to the existing home directory
- Classpath corruption due to conflicts between the
BITBUCKET_HOME/lib
and theBITBUCKET_INST/lib
For more information, see BSERV-5259 - Getting issue details... STATUS
In order to prevent these sort of problems occurring, as of Bitbucket Server 3.5 the BITBUCKET_HOME
directory must be outside the installation directory.
Moving a BITBUCKET_HOME directory which is a subdirectory of the installation
This is a relatively straight forward process:
- Create a directory outside of the Bitbucket Server installation directory
- Copy the contents of your current home directory into your new home directory
- Update setenv.sh/setenv.bat or your environment configurations so that the
BITBUCKET_HOME
environment variable points to the new directory
Extracting the BITBUCKET_HOME directory which was set as the same directory as the installation
This process for this is a little more involved:
- Create a directory outside of the Bitbucket Server installation directory
- Copy over the
shared/
(if it exists),caches/
,plugins/
anddata/
(if it exists) directories from your old home directory to your new home directory - Copy your
bitbucket.properties
(if it exists) from your old home directory to your new home directory - Create a
lib/
directory in your new home directory and copy any JDBC drivers which you placed in your oldlib/
directory - Update setenv.sh/setenv.bat or your environment configurations so that the
BITBUCKET_HOME
environment variable points to the new directory
Bitbucket Server 5.0+ では setenv と環境変数に変更があります
Bitbucket Server 5.0 以降では setenv.sh
と setenv.bat
が取り除かれています。これらのファイルで設定されていたオプションは、環境変数で設定できるようになりました。環境変数の設定場所は、実行先のオペレーティング システムに応じます。
Linux
When using the atlbitbucket
service on Linux, the environment variables are ignored. You must set the parameters in _start-webapp.sh (or start-bitbucket.sh)
. These values will be read when the service starts.
たとえば、 JVM_SUPPORT_RECOMMENDED_ARGS
を設定するには、ファイルに次の行を追加します。
JVM_SUPPORT_RECOMMENDED_ARGS=-XX:+HeapDumpOnOutOfMemoryError
Windows
Bitbucket Server を実行しているユーザーで、パラメーターを環境変数として設定します。たとえば、JVM_SUPPORT_RECOMMENDED_ARGS
を設定したい場合、それを環境変数として作成して適切な値を割り当てます。Bitbucket Server がスタートアップ スクリプトやサービスを利用して起動する際に、この値が取得および適用されます。