Connect Bitbucket to an external database

Bitbucket Data Center と Server の管理



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


This page provides information about using Bitbucket Data Center and Server with an external database.

Bitbucket ships with an embedded database that it uses straight out-of-the-box, with no configuration required. This is great for evaluation purposes, but for production installations, we recommend that you use one of the supported external databases.

Please refer to Supported platforms for the versions of external databases supported by Bitbucket.


Instructions for connecting Bitbucket to the supported external databases:

MySQL は Bitbucket Data Center インスタンスではサポートされません。MySQL は Bitbucket Server (スタンドアロン) インスタンスではサポート対象ですが、推奨されません。詳細については、「Bitbucket Server を MySQL に接続する」をご参照ください。


Bitbucket ships with an embedded database that is great for evaluation purposes, but for production installations we recommend that you make use of one of the supported external databases, for the following reasons:

  • Improved protection against data loss: The Bitbucket Server built-in database, which runs HSQLDB, is susceptible to data loss during system crashes. External databases are generally more resistant to data loss during a system crash. HSQLDB is not supported in production environments and should only be used for evaluation purposes.
  • Performance and scalability: If you have a large number of users on your Bitbucket instance, running the database on the same server as Bitbucket may slow it down. We recommend that for large installations, Bitbucket and the DBMS are run on separate machines. When using the embedded database, the database will always be hosted and run on the same server as Bitbucket, which will limit performance.
  • Unified back-up: Use your existing DBMS tools to back up your Bitbucket database alongside your organization's other databases.
  • Bitbucket Data Center support: If you want to upgrade your instance to Bitbucket Data Center resources, either now or in the future, to take advantage of the performance-at-scale and high availability benefits of running Bitbucket Server in clustered mode, then you must use an external database. HSQLDB is not supported in Bitbucket Data Center. 


複数のクラスタ ノードが実行されている場合、Bitbucket Data Center インスタンスでデータベース移行ウィザードはサポートされません。Bitbucket Data Center インスタンスのデータベースを移行するには、複数のクラスタ ノードを起動する前に移行を実行する必要があります。

You can use the Database Migration Wizard to migrate the Bitbucket data:

  • 埋め込みデータベースからサポート対象の外部 DBMS への移行
  • 同じ DBMS の別のインスタンスへの移行
  • 1 つの DBMS からサポート対象の別の DBMS へ (例: MySQL から PostgreSQL) の移行。

You need to have created the DBMS (such as PostgreSQL) that you wish to migrate the Bitbucket data to before running the Migration Wizard.


  1. Log in to Bitbucket.
  2. 管理領域で、[設定] 配下の [データベース] をクリックします。
  3. [データベースの移行] をクリックして、移行を実行するための手順に従います。


  • Back up the database and Bitbucket home directory:
    Before starting the database migration process you should back up your Set the home directory. If you intend to migrate from one external database to another, you should also back up the existing database before proceeding. See Data recovery and backups for more information.
  • Bitbucket will be unavailable during the migration:
    Bitbucket will not be available to users during the database migration operation. In addition, running the migration when people are using Bitbucket can sometimes cause the migration to time out waiting for all activity in Bitbucket that uses the database to complete. For these reasons, we recommend that you run the database migration outside of normal usage periods.
  • Migration will usually take less than 30 minutes:
    The duration of the migration process depends on the amount of data in the Bitbucket database being migrated. For new installations, containing very little data, the migration process typically takes just a few seconds. If you have been using Bitbucket for some time, its database will contain more data, and the migration process will therefore take longer. If Bitbucket has been linked to a JIRA Software instance, and there are hundreds of thousands of commits in Bitbucket with issue keys in the commit messages, the migration may take tens of minutes.
  • We strongly recommend using a new clean database for the new Bitbucket database: 
    In case of a migration failure, Bitbucket may have partially populated the target database. If the target database is new (therefore empty) and set aside for Bitbucket's exclusive use, it's very easy to clean up after a failed migration; just drop the target database and use a clean target database instance for the next attempt.
  • Ensure your Set the home directory is secured against unauthorized access:
    • After the migration, the connection details (including the username and password) for the database are stored in the file.
    • The migration will create a dump file of the contents of your database in the Bitbucket Server home export directory. This is used during the migration and is kept for diagnostic purposes in the case of an error. You may remove this after migration but it may reduce Atlassian Support's ability to help you in the case of migration issues.
    • 移行後、必要に応じてデータベースのパスワードを編集できます。

最終更新日: 2021 年 12 月 6 日


Powered by Confluence and Scroll Viewport.