Bitbucket Server をアーカイブ ファイルからアップグレードする

このページの内容

お困りですか?

アトラシアン コミュニティをご利用ください。

コミュニティに質問

This article describes how to upgrade Bitbucket Server, the product formerly known as Stash. Read more about the name change.

This page describes how to manually upgrade Bitbucket Server from an archive file. However, we strongly recommend that you use the Bitbucket Server installer instead, for a quick and trouble-free upgrade experience.

You may be interested in this alternative provisioning approach:

1. サポート対象プラットフォームを確認する

Check the Supported platforms page for details of the application servers, databases, operating systems, web browsers and Java and Git versions that we have tested Bitbucket Server with and recommend.

Atlassian only officially supports Bitbucket Server running on x86 hardware and 64-bit derivatives of x86 hardware.

Cygwin Git is not supported. No internal testing is done on that platform, and many aspects of Bitbucket Server's functionality (pull requests and forks among them) have known issues. When running Bitbucket Server on Windows, always use msysGit.

2. Check your version of Java

In a terminal or command prompt, run this:

java -version

The version of Java should be 1.8.x. You'll need a 64-bit version of Java if you have a 64-bit operating system.

On Linux, if you don't see a supported version, then get Java...

Java をインストール

Download Java Server JRE from Oracle's website, and install it.

Now try running 'java -version' again to check the installation. The version of Java should be 1.8.x.

Check that the system can find Java

In a terminal, run this:

echo $JAVA_HOME

You should see a path like /usr/jdk/jdk1.8.0.

If you don't see a path, then set JAVA_HOME

次のいずれかの操作を行います:

  • If JAVA_HOME is not set, log in with 'root' level permissions and run:

    echo JAVA_HOME="path/to/JAVA_HOME" >> /etc/environment

    where  path/to/JAVA_HOME may be like: /usr/jdk/jdk1.8.0

  • If JAVA_HOME needs to be changed, open the  /etc/environment file in a text editor and modify the value for JAVA_HOME to:
    JAVA_HOME="path/to/JAVA_HOME"

    It should look like: /usr/jdk/jdk1.8.0

On macOS, if you don't see a supported version, then get Java...

Java をインストール

Download Java Server JRE from Oracle's website, and install it.

Now try running 'java -version' again to check the installation. The version of Java should be 1.8.x.

Check that the system can find Java

In a terminal, run this:

echo $JAVA_HOME
You should see a path like /System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK/Home/.

If you don't see a path, then set JAVA_HOME

Open your ~/.profile file in a text editor and insert:

JAVA_HOME="path/to/JAVA_HOME"
export JAVA_HOME

where path/to/JAVA_HOME may be like: /System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK/Home/

Refresh your ~/.profile in the terminal and confirm that JAVA_HOME is set:

source ~/.profile
$JAVA_HOME/bin/java -version

You should see a version of Java that is 1.8.x, like this:

java version "1.8.0_1"

On Windows, if you don't see a supported version, then get Java...

Java をインストール

Download Java Server JRE from Oracle's website, and install it.

Now try running 'java -version' again to check the installation. The version of Java should be 1.8.x.

Check that the system can find Java

Bitbucket Server uses the JAVA_HOME environment variable to find Java. To check that, in a command prompt, run:

echo %JAVA_HOME%

You should see a path to the root directory of the Java installation. When running Bitbucket Server on Windows, unlike Linux or Unix, JAVA_HOME paths with spaces are just fine.

If you don't see a path, then set JAVA_HOME

Windows 7 ...

Stage 1. Locate the JRE installation directory

JRE のインストール パスがすでに分かっている場合、下記の手順 2へ進んでください。それ以外の場合、次の手順に従ってインストール パスを見つけてください:

  1. If you didn't change the installation path for the Java Runtime Environment during installation, it will be in a directory under C:\Program Files\Java. Using Explorer, open the directory C:\Program Files\Java.
  2. Inside that path will be one or more subdirectories such as C:\Program Files\Java\jre8

Stage 2. Set the JAVA_HOME variable

  1. Go to Start, search for "sys env" and choose Edit the system environment variables.
  2. Click Environment Variables, and then New under 'System variables'.
  3. Enter "JAVA_HOME" as the Variable name, and the absolute path to where you installed Java as the Variable value. Don't use a trailing backslash, and don't wrap the value in quotes.

Now, in a new command prompt,  try running '%JAVA_HOME%\bin\java -version'. You should see the same version of Java as you saw in 2. above.

Windows Server 2003 R2 ...

Stage 1. Locate the JRE installation directory

JRE のインストール パスがすでに分かっている場合、下記の手順 2へ進んでください。それ以外の場合、次の手順に従ってインストール パスを見つけてください:

  1. If you didn't change the installation path for the Java Runtime Environment during installation, it will be in a directory under C:\Program Files\Java. Using Explorer, open the directory C:\Program Files\Java.
  2. Inside that path will be one or more subdirectories such as C:\Program Files\Java\jre8

Stage 2. Set the JAVA_HOME variable

JRE インストール パスを特定したあと:

  1. デスクトップの マイ コンピュータ アイコンを右クリックして プロパティ を選択します。
  2. 詳細設定 タブをクリックします。
  3. 環境変数 ボタンをクリックします。
  4. システム環境変数 領域で、新規 をクリックします。
  5. 変数名として「JAVA_HOME」と入力します。
  6. Enter the variable value as the installation path for the Java Development Kit. Don't use a trailing backslash, and don't wrap the value in quotes.
    • If your Java installation directory has a space in its path name, you should use the shortened path name (e.g. C:\Progra~1\Java\jre8) in the environment variable instead.

      64 ビットシステムの Windows ユーザー向け注記

      Progra~1 = 'Program Files'
      Progra~2 = 'Program Files(x86)'

  7. OK をクリックします。
  8. 変更の適用 をクリックします。
  9. これらの変更を加える前に開いていたすべてのコマンド ウィンドウを閉じ、新しいコマンド ウィンドウを開きます。実行中のコマンド プロンプトから環境変数をリロードすることはできません。コマンド プロンプトを一旦閉じ、再度開いても、変更が反映されない場合は、Windows を再起動してください。

Now, in a new command prompt,  try running '%JAVA_HOME%\bin\java -version'. You should see the same version of Java as you saw in 2. above.

3. Check your version of Git

In a terminal or command prompt, run:

git --version

The version of Git should be 1.8.x or higher. 

If you are running an earlier version of Git you will need to upgrade to a later version – see Installing and upgrading Git for assistance.

4. Get the latest version of Bitbucket Server  

Download Bitbucket Server from the Atlassian download site. Looking for the Bitbucket Server WAR file?

Extract the downloaded file to an install location (without spaces in the path). 

The path to the extracted directory is referred to as the <Bitbucket Server installation directory> in these instructions.

Never unzip the Bitbucket Server archive file over the top of an existing Bitbucket Server installation –  each version of Bitbucket Server includes versioned jar files, such as  bitbucket-model-4.0.0.jar . If you copy these, you end up with multiple versions of Bitbucket Server's jar files in the classpath, which leads to runtime corruption.

Note that you should use the same user account to both extract Bitbucket Server and to run Bitbucket Server (in Step 6.) to avoid possible permission issues at startup. For production installations, we recommend that you create a new dedicated user that will run Bitbucket Server on your system. See Running Bitbucket Server with a dedicated user.

5. Tell Bitbucket Server where your data is stored

The Bitbucket Server home directory is where your Bitbucket Server data is stored. You need to update the value of BITBUCKET_HOME in the <Bitbucket Server installation directory>/bin/setenv file so the new Bitbucket Server installation points to your existing Bitbucket Server home directory (if you use a BITBUCKET_HOME environment variable to specify the home directory location, no change is required).

6. Make changes to server.xml

If you are upgrading from Stash 3.7 or earlier and you have made  custom changes to the  server.xml  file in your installation, you have to make those changes in the server.xml file of your new installation as well, which is in a different location as of Stash 3.8.  You would have made these changes if you modified the portcontext path, or the access protocol, or if you are running Bitbucket Server behind a proxy and modified the Connector element.

Locating the server.xml file

The location of the server.xml file changed in Stash 3.8 to keep editable configuration files in the Bitbucket home directory and out of the (version specific) installation directories. 

リリース
ディレクトリ 
Stash 3.7 以前<Stash installation directory>/ conf/server.xml
Stash 3.8 以降<Stash home directory> /shared/server.xml
Bitbucket Server 4.0 以降<Bitbucket home directory> /shared/server.xml

Upgrading from Stash to Bitbucket Server

When upgrading from Stash to Bitbucket Server you must rename references from atlassian-stash to atlassian-bitbucket within the server.xml file. The reference will be in the following element.

Stash 3.x reference
<Context docBase="${catalina.home}/atlassian-stash"
    path=""
    reloadable="false"
    useHttpOnly="true"/>

 

Bitbucket Server 4.x reference

<Context docBase="${catalina.home}/atlassian-bitbucket"
    path=""
    reloadable="false"
    useHttpOnly="true"/>

 

7. Create the atlbitbucket dedicated user account

You should create a new dedicated user account to run Bitbucket Server named atlbitbucket following the instructions outlined in Running Bitbucket Server with a dedicated user

8. Start Bitbucket Server

There are a couple of ways in which you can start Bitbucket Server – see Starting and stopping Bitbucket Server.

 

Stopping Bitbucket Server

See Starting and stopping Bitbucket Server.

最終更新日: 2018 年 2 月 13 日

この内容はお役に立ちましたか?

はい
いいえ
この記事についてのフィードバックを送信する
Powered by Confluence and Scroll Viewport.