What tells confluence to run setup?
Asked by Scott Beeson:

I had a failure and now I'm trying to restore Confluence to another server. I did a fresh install of the version I was running (5.7) and restored the database from a date before the crash. I modified the confluence.cfg.xml file to point to the database. When I access localhost:8090 it tries to do the setup, asking for the license and stuff.

So, I then copied a backup of the entire /confluence and /application data/confluence folders to the new install location. The same thing still happens.

How can I tell it not to do the setup? What is the simplest way to just restore an installation? I am so confused.


Answers:
author: Mallmann
body: Hi Scott,

The file confluence.cfg.xml contains a few details that tells Confluence whether this is or not a new installation.

There are a few ways to roll the instance back, but follow two paths you can take:
> 1. If you have a backup copy from your Database, Confluence Installation Folder and Confluence Home Directory:  
>    1. Shut your Confluence down
>    2. Restore the database backup on your Confluence's database, replacing the current one
>    3. Restore the [Confluence Home Directory](https://confluence.atlassian.com/display/DOC/Confluence+Home+and+other+important+directories#ConfluenceHomeandotherimportantdirectories-homedirectoryConfluencehomedirectory), replacing the current one
>    4. Restore the [Confluence Install Folder](https://confluence.atlassian.com/display/DOC/Confluence+Home+and+other+important+directories#ConfluenceHomeandotherimportantdirectories-Confluenceinstallationdirectory), also replacing the current one
>    5. Start your Confluence again from the Confluence Install Folder you've restored
> 2. In case you have only the database backup copy, [this guide](https://confluence.atlassian.com/display/CONFKB/How+to+Rollback+to+a+Previous+Version+of+Confluence) describes the steps to follow.

You need to make sure that the *confluence-init.properties* file is correctly pointing to this new home directory, thus Confluence will find the confluence.cfg.xml file and you should be able to start the restored instance.

This file is located under **\<confluence-install\>/confluence/WEB-INF/classes/confluence-init.properties**.

I hope it helps,

Eduardo

comments: author: Scott Beeson
body: Well I tried doing option 1, twice, and I just get a 404 at <http://localhost:8090>. I have verified the port in the cfg file and I can see that tomcat is running. No idea what is going on. I'm trying option 2 now.


author: Scott Beeson
body: Okay I did option 2 and now I get this: HTTP Status 500 - java.lang.IllegalStateException: Spring Application context has not been set


author: Scott Beeson
body: I've tried dozens of variations of the confluence.cfg.xml file and they all result in the error above. I can revert it to the default state and get to the setup wizard again but any time I try to put other properties in there I get the 500 error. I'm very frustrated.


author: Scott Beeson
body: So here is what finally worked:1. Install Confluence, exact build.2. Go through setup as normal.3. Create "empty" space.4. Restore database.It seems really obvious but it's not really what the docs say...


author: Scott Beeson
body: Marked yours as answer because you technically answered the question which was "What tells confluence to run setup". Thanks for getting me headed in the right direction.


author: Guilherme V.
body: Hey Scott,

The exact parameter that tells Confluence to run the setup is the **setupStep** parameter inside the **confluence.cfg** file.

If you finish all the steps, the parameter will be listed as:

```
&lt;setupStep&gt;complete&lt;/setupStep&gt;
```


author: Scott Beeson
body: So here is what finally worked:

1. Install Confluence, exact build as before.
2. Go through setup as normal
3. Create "empty" space.
4. Restore database.
5. Restore attachments folder

It seems really obvious but it's not what the docs say... I also don't understand why restoring the folders and database exactly as they were gave me so many fits. Either way, it's working and the steps above are simple and seem to work if you follow them exactly.


Tags: confluence-administration

restore