Confluence uninstalled unintentionally
Asked by Jake King:

I uninstalled Confluence unintentionally. I tried to reinstall it, but my backup is only of the database. How I can tell Confluence to use the database (which I re-imported) without starting all over?


Answers:
author: AnnWorley
body: Hi Jake,

There is also data in the Confluence Home directory, notably atachments. If that's gone we can still recover the rest of the instance.

To get the rest of your data running in Confluence please:

1. Install Confluence (same version) pointing to a new, empty database. The setup wizard overwrites the database if you have data in there, hence the "dummy" db.
2. Shut down Confluence.
3. Edit the file **confluence.cfg.xml** in the root of the \<[Confluence_Home](https://confluence.atlassian.com/doc/confluence-home-and-other-important-directories-590259707.html)\>directory.
4. Change the hibernate connection URL to point to your new database - the database name is the only entry you should have to change. This example is for PostgreSQL - your syntax will vary according to database type:

   ```
   <property name="hibernate.connection.url">jdbc:postgresql://localhost:5432/databasename</property>
   ```

5. Start Confluence - your data should be there sans attachments unless you had a backup of the [home directory.](https://confluence.atlassian.com/doc/confluence-home-and-other-important-directories-590259707.html)

I look forward to hearing how this works for you.

Cheers,

Ann

comments: author: Jake King
body: I tried installing it fresh, letting it overwrite the database, and restoring the database from backup in place, but that doesn't seem to have made a difference (this is before everyone answered)


author: AnnWorley
body: What happens now when you log in - it sees your restored database or it looks like a new installation?

Do you have any file system backups or [automatic XML backups](https://confluence.atlassian.com/doc/configuring-backups-138348.html)in [Confluence_Home](https://confluence.atlassian.com/doc/confluence-home-and-other-important-directories-590259707.html?_ga=2.49147238.1906927852.1532356845-1923827497.1529955626)/backups? The latter can be imported into a new instance and restore everything but third party add-ons.


author: Jake King
body: it thinks it's a new installation still. I must have screwed something up, because if I try to access the website, it comes up with the 'Load content: Example Site, Empty Site, Restore From Backup'. Clicking on any one of these gives me 'Set up step error'.


author: AnnWorley
body: You can reset the setup wizard by deleting [Confluence_Home](https://confluence.atlassian.com/doc/confluence-home-and-other-important-directories-590259707.html?_ga=2.49147238.1906927852.1532356845-1923827497.1529955626)/confluence.cfg.xml. After you complete it you will have a confluence.cfg.xml with all the hibernate properties for your DBMS - it varies between database types so installing against an empty db of the same type is best. Restoring the db as you are doing after the fact is also an option.

If you decide to install then restore the db, make sure Confluence is down when you restore the db, then restart Confluence with the new database in place, in the location designated in confluence.cfg.xml

Best wishes for these steps to work for you.


author: Vickey Palzor Lepcha
body: * Try a fresh reinstall first using the internal H2 database - do not connect it to the current database.
* Then edit your confluence.cfg.xml file and point it to the database.

Not sure if it will work but give it a try.

comments: author: Jake King
body: Where is the confluence.cfg.xml file located?

I can't find it, even with a search.


author: Vickey Palzor Lepcha
body: Just to confirm - your current setup has an external database and is not using the default database right ?


author: Jake King
body: that is correct, Mariadb, installed on localhost


author: Vickey Palzor Lepcha
body: Your file should be in ..../application-data/confluence/


author: Jake King
body: managed to get it all figured out. I had to:

-Make current snapshot of server

-Return the Server to a snapshot made 2 weeks prior.

-make new Backup export for Confluence on older instance of server

-Return Server back to 'current' snapshot

-uninstall Confluence

-reinstall confluence, and restore back from the backup made from 2 weeks prior.

-make sure everything was currently working, and create another new snapshot

-import the database dump I had made previously at the start of all of this.

managed to recover everything after that, and it resolved my previous issue with Collaborative editing not working (which was what started this whole mess anyways).


author: AnnWorley
body: Hi Jake,

Thanks for circling back to this thread to let the Community know what worked for you. Happy to hear Confluence is running and collaborative editing is working.

Cheers,

Ann


Tags: confluence-server

server