Confluence migrate from Oracle DB to Postgres
Asked by Jeanne Howe:

Is there any way to migrate Confluence from an Oracle DB to a Postgres DB without having to do a complete Confluence Install?

When migrating JIRA from Oracle to Postgres, I was able to drop the dbconfig.xml, restart JIRA and the Config Wizard started;allowing me to point to the new DB and restore all my data from the XML backup.

Dropping the confluence.config.xml file in Confluence and restarting did not bring up the Config Wizard.

The documentation states you need to reinstall Confluence, changing your install and home directory paths. You then need to reinstall all the plugins and copy over all your attachments. I was hoping to avoid all of this.


Answers:
author: Jeanne Howe
body: In the case of migrating Confluence from Oracle to PostGres, a full install of Confluence is required.


author: rrudnicki
body: Hi Jeanne,

Since deleting confluence.cfg.xml is not working, can you try to setup a new confluence.cfg.xml? Try to create one with the following content:

```
&lt;?xml version="1.0" encoding="UTF-8"?&gt;&lt;confluence-configuration&gt;  &lt;setupStep&gt;setupstart&lt;/setupStep&gt;  &lt;setupType&gt;initial&lt;/setupType&gt;  &lt;buildNumber&gt;0&lt;/buildNumber&gt;  &lt;properties/&gt;&lt;/confluence-configuration&gt;
```

(remember to stop Confluence first and then make a backup of your old confluence.cfg.xml. Then, start Confluence again :smile:

Regards,   
Renato Rudnicki

comments: author: Jeanne Howe
body: Renato,I have tried starting Confluence using this file, still the setup wizard does not start. I have also tried creating the full confluence.cfg.xml for postgres, but got the following error on startup2015-12-30 11:09:53,983 INFO \[localhost-startStop-1\] \[com.atlassian.confluence.lifecycle\] contextInitialized Starting Confluence 5.7.5 \[build 5791 based on commit hash 812a9b95d028838dafa0cb0b1f30f9320f96e54f\]2015-12-30 11:09:56,045 ERROR \[localhost-startStop-1\] \[atlassian.config.bootstrap.DefaultAtlassianBootstrapManager\] init Home is not configured properly: com.atlassian.config.ConfigurationException: Failed to create config element: com.atlassian.config.xml.Dom4jXmlMapConfigElement at com.atlassian.config.AbstractConfigurationPersister.getConfigElement(AbstractConfigurationPersister.java:82) at com.atlassian.config.AbstractConfigurationPersister.getConfigElement(AbstractConfigurationPersister.java:26) at com.atlassian.config.ApplicationConfig.load(ApplicationConfig.java:266) at com.atlassian.config.bootstrap.DefaultAtlassianBootstrapManager.init(DefaultAtlassianBootstrapManager.java:68) at com.atlassian.config.util.BootstrapUtils.init(BootstrapUtils.java:36) at com.atlassian.confluence.setup.ConfluenceConfigurationListener.initialiseBootstrapContext(ConfluenceConfigurationListener.java:129) at com.atlassian.confluence.setup.ConfluenceConfigurationListener.contextInitialized(ConfluenceConfigurationListener.java:64) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:5016) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5528) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1575) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1565) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745)Caused by: java.lang.NullPointerException at com.atlassian.config.xml.Dom4jXmlMapConfigElement.loadConfig(Dom4jXmlMapConfigElement.java:43) at com.atlassian.config.AbstractConfigElement.load(AbstractConfigElement.java:23) at com.atlassian.config.AbstractConfigurationPersister.getConfigElement(AbstractConfigurationPersister.java:78)


author: rrudnicki
body: Hi Jeanne, Looks like your confluence_home flag wasn't properly setup as you can see:2015-12-30 11:09:56,045 ERROR \[localhost-startStop-1\] \[atlassian.config.bootstrap.DefaultAtlassianBootstrapManager\] init Home is not configured properly: Can you verify this on \<confluence_installation_folder\>/confluence/WEB-INF/classes/confluence-init.propertiesCheers, Renato


author: Jared Dohrman [Design Industries]
body: Hi Jeanne,In addition to Renato's suggestion, also ensure that the user that is starting Confluence has full read/write permission to the Confluence Home and other important directories, including permission to create and delete subfolders.Even if the permissions look correct, sometimes there can be a few errant files that have the wrong permissions, so it's a good idea to reset the permissions and force them to be reapplied to the Home directory and all subfolders and files.Thanks,Jared.


author: Jared Dohrman [Design Industries]
body: Hi Jeanne,

You can use a tool like ora2pg: <http://ora2pg.darold.net/> to migrate a database from Oracle to Postgres. Once you have successfully migrated the database, you should be able to change your confluence.config.xml file with the new Database connection.

e.g.

```
...driverClassName="org.postgresql.Driver"url="jdbc:postgresql://DatabaseServer:5432/DatabaseName"...
```

Obviously, take full backup's first,

Jared.

comments: author: Daniel Alonso
body: [@Jared Dohrman \[](/t5/user/viewprofilepage/user-id/510030)

Have you tried this strategy?

I have read about it and looks like you cannot just migrate everything in one shoot, so my questions are:

1. What was the sequence of your migration? I'm thinking on create first the structure of the database, without data, then copy the data with the COPY method. But I don't know that TYPE of export is required? TABLE? SEQUENCE? TRIGGER?
2. Do you need to modify the driver specifications or database type on the records once the data has been migrated to PostgreSQL? Where?

Thanks in advance.


Tags: confluence-administration

database