If you are using Confluence in a production environment, data should be stored in an external database. The embedded database is bundled for evaluation purposes and does not offer full transactional integrity in the event of sudden power loss.

This document provides instructions for setting up Confluence for use with a production-ready database. It covers both migration from an evaluation installation of Confluence and installation of an empty database during initial setup. The following specific database guides have additional information:

準備

Install the following on the Confluence server:

  • Database administration tool, for example DBVisualizer
  • JDBC database drivers
  • The database server (unless accessed remotely)

The instructions refer to two particular directories:

  • The <Confluence Installation Directory> is the directory where you unpacked the Standalone Confluence download.
  • The <Confluence Home Directory> is the directory where Confluence stores its data, which you set by editing the confluence-init.properties file in Confluence Installation Directory/confluence/WEB-INF/classes.

Database Setup

Create the schema and setup permissions:

  1. Visit the Database Configuration page to review any known issues and database setup for your database.
  2. Create a new schema using the correct database encoding.
  3. Create a user with full read/write access to the Confluence schema, including the ability to create tables.
  4. If the database only permits users to log in from approved hosts (e.g. localhost), grant database access permission for the Confluence server.
  5. If the database is hosted remotely to the Confluence server, set up any firewall permissions.
  6. Test the connection by using the database administration tool installed on the Confluence server to log in to the database.
Migration From an Evaluation Instance of Confluence

Continue here if you are migrating from an evaluation instance with the built-in database. If you are installing Confluence for the first time, continue below.

Create Backups

To keep any existing Confluence content:

  1. If you are already using an external database, use your database administration tool to create a full database backup.
  2. Manually create an XML backup of Confluence under 'Administration' -> 'Backup & Restore'. If you have less than 100MB of attachments, check 'Backup attachments' when creating the backup. If you have over 100MB of attachments, you should not check the 'Backup attachments' and instead you should manually copy the /attachments directory in your Confluence home to a backup location. This attachments directory will later be copied into the new home directory.
  3. Download the backup file to a backup location.

Database Connection Setup

Set up Confluence's database connection:

  1. Stop Confluence if it is already running.
  2. The JDBC database drivers for your database must be available to the application server. You can skip this step if the drivers are already loaded.
    1. Copy the database driver JAR file into the lib directory. In Confluence Standalone this directory is /confluence/WEB-INF/lib. Other application servers will use a different path.
    2. If the application server does not support dynamic library loading, stop your application server.
  3. Create a new Confluence home directory.
  4. Open the 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.
  5. Start up Confluence. Refer to the platform-specific installation instructions to learn how. You should be presented with the Confluence setup wizard. Enter your license information.
  6. Select 'Custom install'.
  7. Select a database from the drop down list.
  8. Select Direct JDBC and then enter the username, password and database driver of the new database.
  9. If you created a Confluence backup earlier and wish to restore it, import it into Confluence now.
  10. Once the wizard is complete, if you did not check the 'Backup attachments', copy the backed up /attachments directory into the new Confluence home.
関連トピック

外部データベース接続のトラブルシューティング