Is there a way to recover an orphaned confluence pgsql database?

11/1/2018

We are experimenting with Kubernetes and Confluence in the cloud and have deployed Confluence connected to a pgsql database. When applying an update, something happened that caused the pgsql pod to tank and lose the persistent volume connections.

Thankfully the volume was set to retain, so we have the volume and I have since been able to point a new pgsql instance to this volume, but I can't find a way to get Confluence to see this existing database. Confluence just proceeds to the initial fresh install screens. I've tried installing it on a temporary database and then modifying the confluence.cfg.xml file to point to the old data once completed but Confluence will not restart when I try this.

Any help is appreciated.

-- user3088242
confluence
kubernetes
postgresql

2 Answers

11/1/2018

Using the web installer you should have a step to select "My own database". From there you can configure the database credentials and host. Go ahead and let the installer run, it will overwrite the default settings but will retain your existing data.

Also, you may want to get on the psql shell via console and check to make sure that your data actually exists and you haven't ended up with an empty database.

If you're still stuck, reach out here and we can check out the next steps.

-- yomateo
Source: StackOverflow

11/2/2018

In my case the original solution posted here is accurate:

However I had to do this in a non containerized environment. I installed Confluence on a VM using a blank database, then modified the confluence.cfg.xml file to point to the pgsql database in the kubernetes cluster and restarted confluence. I was able to see my data, so I then used confluence's XML export feature to grab the dataset. I then blew away the kubernetes environment and re-created it from scratch and imported the backed up XML into the new instance. Not a super clean way of doing it, but got where I needed to.

-- user3088242
Source: StackOverflow