Confluence Docs 3.0 : Migrate to Another Database This page last changed on Sep 25, 2009 by jlargman. 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 method when moving from the embedded DB to an external DB, or from one type of external DB to another (e.g. Oracle to Postgres). If you are simply moving your DB 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). There are two ways you can perform the migration: Method one is the standard procedure. For large installations of Confluence using version 2.2 or later: If the total size of attachments on your installation exceeds 500MB, use method two. On this page: Method One - Standard Procedure Step One: Backing up your data Step Two: Configuring the Confluence Home Directory Step Three: Setting up the new database Step Four: Setting up Confluence with the new database Method Two - For large installations Step One: Backing up your data Step Two: Configuring the Confluence Home Directory Step Three: Moving your attachments Step Four: Setting up new database Step Five: Setting up Confluence with the new database A Note about Case Sensitivity in your Database Troubleshooting # Limitations of Database Migration
| The XML backup built into Confluence is not well suited for database migration for large data sets (see Alternative Backup Strategy for reference). If the procedures below do not work, use a commercial database migration tool. Vote for CONF-12599 to add a more robust strategy for large implementation migrations.
## Method One - Standard Procedure #### Step One: Backing up your data 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. Shut down and backup the Confluence Home Directory. If you are already using an external database, please make a backup of it using the utilities that were installed with it.
| Note which plugins are currently installed/enabled, so that you can reinstate them later.
#### Step Two: Configuring the Confluence Home Directory Create a new Confluence Home Directory. You can place this directory anywhere you like and give it a name of your choice. 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. 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. 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. If you are running the standalone version of Confluence, copy your JDBC database driver (a .jar file), into the `<confluence-install>/lib` folder. Start up Confluence. You will see the Confluence Setup Wizard. Select 'Custom Install'. Select your database from the drop down list. Select 'Direct JDBC' and then enter the details of the new database you want to migrate to. Read the documentation on the Setup Wizard for more detailed explanation. 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 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) These instructions will not work if either of the above is not true. From Confluence, go to `Administration -> Backup & Restore` and create a manual backup that excludes attachments. Shut down and back up the Confluence Home Directory. 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 Create a new Confluence Home Directory. You can place this directory anywhere you like and give it a name of your choice. 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. 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. 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. If you are running the standalone version of Confluence, copy your JDBC database driver (a .jar file), into the `<confluence-install>/lib` folder. Start up Confluence. You will see the Confluence Setup Wizard. Select 'Custom Install'. Select your database from the drop down list. Select 'Direct JDBC' and then enter the details of the new database you want to migrate to. Read the documentation on the Confluence Setup Wizard for more detailed explanation. When prompted, restore the contents of the backup you made in Step One into the new Confluence site. ## A Note about Case Sensitivity in your Database 'Collation' refers to a set of rules that determine how data is sorted and compared. Case sensitivity is one aspect of collation. Other aspects include sensitivity to kana (Japanese script) and to width (single- versus double-byte characters). Case-sensitive or case-insensitive collation — how should you create your Confluence database? What about when you are migrating your existing Confluence instance from one database to another? ###### Setting up a New Confluence Instance For new Confluence instances, we recommend using case-sensitive collation for your Confluence database, which is the default collation type used by many database systems. The Confluence application itself reduces all usernames into lower-case characters before they are stored in the Confluence database. Therefore, 'joebloggs', 'joeBloggs', 'JoeBloggs', etc. will be treated as the same username on a Confluence installation with case-sensitive database collation. ###### Migrating an Existing Confluence Instance to a Different Database The default Confluence Standalone configuration uses case-sensitive database collation. This is often the case with databases on several other systems which were created under default conditions. Therefore, if you are migrating from this type of configuration to a new database, we recommend that the new database uses case-sensitive collation. If you use case-insensitive collation, you may encounter data integrity problems after migration (for example, via an XML import) if data stored within your original Confluence site required case-sensitive distinctions. ## Troubleshooting If you're unable to restore your XML backup, consult our Troubleshooting Guide. ##### RELATED TOPICS
Migrate to Another Database
Configuration Guide

Document generated by Confluence on Nov 05, 2009 23:34