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 outlines migrating your Confluence data from the embedded database to a more robust database such as MySQL or SQL Server. The following databases have their own guides:
Migration Instructions
Install Confluence if you have not done so already. You also need to 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
Stage 1 - Database Setup
Create the schema and setup permissions:
- Visit the Database Configuration page to review any known issues and database setup for your database.
- Create a new schema using the correct database encoding.
- Create a user with full access to read/write access to the Confluence schema, including the ability to create tables.
- If the database only permits users to login from approved hosts (eg localhost), grant database access permission for the Confluence server.
- If the database is hosted remotely to the Confluence server, setup any firewall permissions.
- Test the connection by using the database administration tool installed on the Confluence server to login to the database.
Stage 2 - Create Backups
To keep any existing Confluence content:
- If you are already using an external database, use your database administration tool to create a full database backup.
- 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.
- Download the backup file to a backup location.
Stage 3 - Database Connection Setup
Setup Confluence's database connection:
- Confluence を停止します。
- 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
- 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
- If the application server does not support dynamic library loading, stop your application server
- Create a new Confluence home directory
- 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.
- Start up Confluence. You should be presented with the Confluence setup wizard. Enter your licence information
- Select custom install
- Select a database from the drop down list
- Select
Direct JDBC
and then enter the username, password and database driver of the new database
- If you created a Confluence backup earlier and wish to restore it, import it into Confluence
- Once the wizard is complete, if you did not check the 'Backup attachments', copy the backed up /attachments directory into the new Confluence home
Done! Your old Confluence data should now be imported to your new database.
外部データベース