This document outlines how to migrate your data from your existing database to another database. It is designed for migrating from an evaluation to a production database. Large data sets will require third party database migration tools. You should use this page when moving from the embedded database to an external database. Provided your dataset is not large, you may use this method to move from one type of external database to another – for example, from Oracle to PostgreSQL.

Note: If you are simply moving your database from one server to another you can just change the JDBC URL in <confluence.home>/confluence.cfg.xml (if you are using a direct JDBC connection) or in the definition of your datasource (if you are connecting via a datasource).

データベース移行の制限事項

注意: Confluence に組み込まれている XML エキスポートは、大きなデータセットのバックアップや移行には適していません。そのようなデータ移行に役立つサードパーティ製ツールが数多くあります。もし適切なツールを選択するために支援が必要な場合、あるいは移行作業そのものに対して支援が必要な場合、アトラシアンエキスパートの 1 社をご紹介することができます。

データベースの移行

There are two ways you can perform the migration:

  1. Method one is the standard procedure.
  2. For large installations of Confluence: If the total size of attachments on your installation exceeds 500MB, use method two.

On this page:

方法 1 - 標準的な手順

Step One: Backing up your data

  1. Note which plugins are currently installed/enabled, so that you can reinstate them later.
  2. Create a backup of your existing data. This is done from the Administration Console. Instructions on how to create a backup can be found here.
  3. Shut down and backup the Confluence Home Directory.
  4. If you are already using an external database, please make a backup of it using the utilities that were installed with it.

Step Two: Configuring the Confluence Home Directory

  1. Create a new Confluence Home Directory. You can place this directory anywhere you like and give it a name of your choice.
  2. Open WEB-INF/classes/confluence-init.properties file in your Confluence installation and change the confluence.home property to point to this new Confluence Home Directory.

Step Three: Setting up the new database

Perform the database setup instructions for your database.

Step Four: Setting up Confluence with the new database

If your databases are not already configured for Confluence, refer to Database Configuration to setup your database access.

  1. Make sure that the JDBC drivers for your database are available to the application server. If you don't already have the JDBC driver, please download one from here.
  2. Make sure that your database is using a case-sensitive collation. Please refer to the section on case sensitivity below and see this issue for more details: CONF-7917.
  3. If you are running the Confluence distribution, copy your JDBC database driver (a .jar file), into the <confluence-install>/lib folder.
  4. Start up Confluence. You will see the Confluence Setup Wizard.
  5. Select 'Custom Install'.
  6. Select your database from the drop down list.
  7. Select 'Direct JDBC' and then enter the details of the new database you want to migrate to.
    (info) Read the documentation on the Setup Wizard for more detailed explanation.
  8. When prompted, restore the contents of the backup you made in Step One into the new Confluence site

Your old Confluence data will now be imported to your new database.

Method two – for large installations

Step One: Backing up your data

  1. Before proceeding with these instructions please check that:
    • you are upgrading from at least Confluence version 2.2 and
    • your attachments are stored in the file system, and not in your database. (To migrate between attachment storage systems, please see Attachment Storage Configuration)
      (warning) These instructions will not work if either of the above is not true.
  2. From Confluence, go to Administration -> Backup & Restore and create a manual backup that excludes attachments.
  3. Shut down and back up the Confluence Home Directory.
  4. If you are already using an external database, please make a backup of it using the utilities that were installed with it.

Step Two: Configuring the Confluence Home Directory

  1. Create a new Confluence Home Directory. You can place this directory anywhere you like and give it a name of your choice.
  2. Open WEB-INF/classes/confluence-init.properties file in your Confluence installation and change the confluence.home property to point to this new Confluence Home Directory.

Step Three: Moving your attachments

Move the contents of your attachments directory from your old Confluence Home to your new Confluence Home.

Step Four: Setting up new database

Perform the database setup instructions for your database.

Step Five: Setting up Confluence with the new database

If your databases are not already configured for Confluence, refer to Database Configuration to setup your database access.

  1. Make sure that the JDBC drivers for your database are available to the application server. If you don't already have the JDBC driver, please download one from here.
  2. Make sure that your database is using a case-sensitive collation. Please refer to the section on case sensitivity below and see this issue for more details: CONF-7917.
  3. If you are running the Confluence distribution, copy your JDBC database driver (a .jar file), into the <confluence-install>/lib folder.
  4. Start up Confluence. You will see the Confluence Setup Wizard.
  5. Select 'Custom Install'.
  6. Select your database from the drop down list.
  7. Select 'Direct JDBC' and then enter the details of the new database you want to migrate to.
    (info) Read the documentation on the Confluence Setup Wizard for more detailed explanation.
  8. When prompted, restore the contents of the backup you made in Step One into the new Confluence site.

データベース内の大文字と小文字の区別に関する注意

「照合」はデータの並べ替えと比較の方法を決定する一連のルールを指します。大文字と小文字の区別は照合の観点の 1 つです。他の観点としては、仮名(日本語スクリプト)の区別や文字幅(1 バイト文字と 2 バイト文字)の区別があります。

照合時の大文字と小文字の区別の有無 - どのような設定で Confluence データベースを作成する必要があるでしょうか?既存の Confluence インスタンスを別のデータベースに移行するときはどうでしょうか?

新しい Confluence インスタンスの設定

新しい Confluence インスタンスの場合、Confluence データベースで大文字と小文字を区別する照合を使用することをお勧めします。これは多くのデータベースシステムで使用される既定の照合タイプです。

注意:データベースが大文字と小文字を区別して照合するように設定されている場合でも、Confluence はすべてのユーザー名を小文字に変換してからデータベースに保存します。たとえば、「joebloggs」と「joeBloggs」と「JoeBloggs」は同じユーザー名として扱われることになります。

別のデータベースへの既存の Confluence インスタンスの移行

既定の Confluence 設定では、データベースで大文字と小文字を区別する照合を使用します。これは、既定の条件で作成されたデータベースでは典型的な設定です。このタイプの設定から新しいデータベースに移行する場合、新しいデータベースで大文字と小文字を区別する照合を使用することをお勧めします。データを保存していた元の Confluence サイトでは大文字と小文字の区別が必要であり、移行先で大文字と小文字を区別しない照合を使用する場合、(たとえば、XML インポート経由で)移行した後のデータに整合性の問題が発生する可能性があります。

トラブルシューティング

If you are unable to restore your XML backup, consult our Troubleshooting Guide.