This page last changed on Mar 05, 2007 by ivan@atlassian.com.

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 Postgres 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:

  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 access to read/write access to the Confluence schema, including the ability to create tables.
  4. If the database only permits users to login from approved hosts (eg localhost), grant database access permission for the Confluence server.
  5. If the database is hosted remotely to the Confluence server, setup any firewall permissions.
  6. 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:

  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.

Stage 3 - Database Connection Setup

Setup Confluence's database connection:

  1. Stop Confluence
  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 common library directory. In Confluence Standalone this directory is /confluence/common/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 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. You should be presented with the Confluence setup wizard. Enter your licence 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
  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

Done! Your old Confluence data should now be imported to your new database.

It would be helpful to mention on this page that the Configure Database page will tell you that the jTDS drivers are preferred over the MS SQL Server drivers. It will prevent some people from installing the MSSQL Driver, restarting Confluence only to be told not to use the MS driver, find jTDS, install, restart, yada yada.

Posted by justinpitts@biglots.com at Dec 02, 2005 11:47

I think you just have.

Posted by daniel@atlassian.com at Dec 05, 2005 22:57

Where are instructions on using DB2? I am new to this app so I do not know if you are using hibernate or not...

Posted by ed@edhorne.com at Dec 16, 2005 15:25

Don't know that that would make a difference either way.  You need to but the DB2 JDBC driver in the server classpath and set the pointer correctly in any event.

Posted by derek at Jan 11, 2006 08:08
Document generated by Confluence on Mar 22, 2007 20:58