Setting us staging env for confluence upgrade
Asked by Cloud Licensing:

Hello all,

I am following this guide to setup a confluence staging env (on confluence 6.15.2) as we're WAY overdue an upgrade, so I am preparing:

<https://confluence.atlassian.com/doc/create-a-staging-environment-for-upgrading-confluence-866094180.html>

I installed confluence on a fresh VM, have migrated the data from the prod server and prod DB to the staging server.

When starting confluence, I get  

|------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------|-------|----------------------------------------------------------------------------------------------------------------------------------------|
| Unable to start up Confluence. Fatal error during startup sequence: confluence.lifecycle.core:schedulerLifecycle (Start and stop the scheduling subsystem) | 2021-09-24 13:00:17 | fatal | could not extract ResultSet; SQL \[n/a\]; nested exception is org.hibernate.exception.SQLGrammarException: could not extract ResultSet |

I followed this, and deleted the cache folder and added .the wait time for Java:

<https://confluence.atlassian.com/confkb/unable-to-start-up-confluence-372081272.html>

It still shows the same error. I tried to start confluence without plugins, but it doesn't even show anything (just says "page not available").

Any ideas?


Answers:
author: Cloud Licensing
body: I ended up installing confluence and initialising the DB before restoring the DB, this did the trick.

This isn't a part of confluence documents, but that's what worked for me


author: Cloud Licensing
body: Is there anyone who can assist on this?


author: Alexis Robert
body: Hi [@Cloud Licensing](/t5/user/viewprofilepage/user-id/660494) ,

are you sure that you're using a compatible version of Java on your staging env ?

Otherwise, since you copied Confluence prod folders and database, you should not have any issues. So it might be because your Java binaries are not the same on both systems (especially if your staging system is more up to date than production).

Let me know if this helps,

--Alexis

comments: author: Cloud Licensing
body: Hi [@Alexis Robert](/t5/user/viewprofilepage/user-id/1213386)

I installed the confluence package and my assumption was JRE came bundled in, is that not the case?

If so, I am on confluence 6.15.2, so shall I install Java 1.8 JRE as per <https://confluence.atlassian.com/conf615/supported-platforms-967338803.html#SupportedPlatforms-Java>

?


author: Cloud Licensing
body: Should also say both VMs are server 2012r2. All I have done on staging is:

- install same version of confluence

- install mysql

- migrate data

- migrate copy of DB


author: Cloud Licensing
body: Hi [@Alexis Robert](/t5/user/viewprofilepage/user-id/1213386)

I just installed java 1.8 and still face issues.

I'm not sure what the problem is here. I installed confluence, mysql etc the exact same as production, and it just times out.

Any help would be appreciated. ![java.PNG](https://community.atlassian.com/t5/image/serverpage/image-id/162005i5133D575D163D647/image-size/large?v=v2&px=999 "java.PNG")


author: Alexis Robert
body: Hi [@Cloud Licensing](/t5/user/viewprofilepage/user-id/660494) ,

since you also have a reference to a SQL result in your error trace, it might be something with MySQL. Did you grant the same permissions to the Jira user on MySQL ? Did you also make sure that your Jira instance is pointing to the staging MySQL database ? (This can be checked in the dbconfig.xml file in the JIRA_HOME).


author: Cloud Licensing
body: Hello [@Alexis Robert](/t5/user/viewprofilepage/user-id/1213386)

I am using the root user currently, so permissions won't be the issue.

I don't have a dbconfig.xml file but a confluence.cfg.xml which points to the SQL DB

\<property name="hibernate.connection.url"\>jdbc:mysql://localhost/staging-confluence1\</property\>

It does seem to connect, it just throws out that error.


author: Cloud Licensing
body: Note, I searched for "dbconfig.xml" and the file was not found.


author: Cloud Licensing
body: hey [@Alexis Robert](/t5/user/viewprofilepage/user-id/1213386) .

any further help you can give?


author: Alexis Robert
body: Sorry, I was talking about the MySQL user : you're right the information is not in dbconfig.xml but in confluence.cfg.xml

Next to the line you found with the MySQL connection string, there will be a MySQL user information : you should check that you have granted this user enough permissions in MySQL.

You can find more information here : <https://confluence.atlassian.com/doc/database-setup-for-mysql-128747.html#DatabaseSetupForMySQL-3.Createdatabaseanddatabaseuser>


author: Cloud Licensing
body: Hello [@Alexis Robert](/t5/user/viewprofilepage/user-id/1213386)

I created a new user 'confluenceuser' with full access to the DB

\<property name="hibernate.connection.password"\>PASSSWORD\</property\>

\<property name="hibernate.connection.url"\>jdbc:mysql://localhost/staging-confluence1\</property\>

\<property name="hibernate.connection.username"\>confluenceuser\</property\>

The issue still persists, is there any logs I can give you to help further?


author: Cloud Licensing
body: I will add I am using mySQL 5.5.


Tags: confluence-server

server