Backup of Confluence through Tomcat not working
Asked by Benjamin W_:

Hello

I'm quite new to Confluence, so please excuse if this is an easy one :-)

<br />

We have JIRA and Confluence 6.9.1 running on the same server host (on Premise, Windows), proxied by Apache with own subdomains (jira.company.com, confluence.company.com).

I am trying to make a backup of Confluence.

When proceeding on this via Admin Web Interface, the backup takes very long time (actually even after 8 hours not finished) and causes high traffic on the server itself (100% CPU).  
I found this thread here describing the same issue:

[https://community.atlassian.com/t5/Confluence-questions/Confluence-Backup-Speed/qaq-p/174479](https://community.atlassian.com/t5/Confluence-questions/Confluence-Backup-Speed/qaq-p/174479??)

So seems to be the case when Confluence gets proxied with Apache. Recommendation / solution is to proceed the backup not through Apache but rather through backend Tomcat directly. Found the documentation over here: <https://confluence.atlassian.com/conf69/manually-backing-up-the-site-950285456.html>

I verified the server.xml, it shows that Tomcat is listening on Port 8090 for Confluence:

\<Connector **port="8090"** connectionTimeout="20000" redirectPort="8443"  
maxThreads="30" minSpareThreads="10"  
enableLookups="false" acceptCount="10" debug="0" URIEncoding="UTF-8"  
proxyName="confluence.company.com" proxyPort="443" scheme="https" secure="true"  
protocol="org.apache.coyote.http11.Http11NioProtocol"/\>

Also the server shows that it is listening on this port (verified with netstat -ano).

<br />

Based on the kb article mentioned above I assume the correct URL to proceed a backup of Confluence through the backend Tomcat should be:

http://localhost:8090/Confluence/admin/backup.action

When I proceed this URL on the server in neither IE or FF, I only get a 404 page not found.  
The developer tools of the browser are prompting a 403 authorization required.  
Based on this, I tried to create a Token in the same browser session. The login page seems to accept the credentials (both AD and local directory), but the behaviour remains unchanged.

Also when using https and / or different Port (8091) does not make any difference.

Based on this, my question is if the URL I am using above is correct? Am I missing something?

Thanks in advance for your support.

Regards, Benjamin


Answers:
author: Benjamin W_
body: In case anyone else has need of it, find here the solution for this issue.  
I have contacted Atlassian Support, they advised to check Server.xml and remove the following entry:  
?proxyName="confluence.company.com" proxyPort="443" scheme="https" secure="true"  
And this did the trick. After another restart, I was finally able to Access Confluence directly through Tomcat on port 8090.

The issue with high CPU usage on Backup remained the same. As our Environment was classified as a large one, this behaviour might be normal. As optimizations, the following configuration can be done in order to Speed up.  
\>\> increase maxThreads from currently 30 to 120  
\>\> increase hibernate.c3p0.max_size from currently 30 to 150

But it will not Change the issue in General. In our case, the only practicle was is doing a database dump.

In general, [@Alexis Robert](/t5/user/viewprofilepage/user-id/1213386), thank you very much for your contribution and support!


author: Alexis Robert
body: Hi [@Benjamin W_](/t5/user/viewprofilepage/user-id/2421210),

you almost got everything right ! The only problem with what you're doing is that when you call localhost:8090, you're actually trying to request a page from your own computer and not from the Confluence server.

You should call localhost only if you're connected to your Confluence Windows server with RDP for example, and opened a web browser directly on the server.

But don't worry, you can still perform the backup from your own computer - you just need to call the right IP address. You will basically [need to look](https://www.digitalcitizen.life/find-ip-address-windows) for the Windows server IP address, and access Confluence this way: <http://my.ip:8090>

Let me know if you have any questions,

--Alexis

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

thanks for your fast feedback.

Sorry, did not correctly describe it in my post:  
I have ensured that I was accessing the URL from the Confluence server, so localhost was referring to the correct host. In my opinion it also seems that the URL is somehow correct, as the 404 page not found is a site in context of Confluence.

![image.png](https://community.atlassian.com/t5/image/serverpage/image-id/39963i94CEC5DC5B976E75/image-size/large?v=v2&px=999 "image.png")

I have also tried to start the backup from remotely (not server itself). But mostly same result.

![image.png](https://community.atlassian.com/t5/image/serverpage/image-id/39968iEA55C331DBE0ED91/image-size/large?v=v2&px=999 "image.png")

Might it be an issue with authorization? (as the browser developer tools state a 403 authorization required)  
When I'm doing backup from the Admin site, logging in to Confluence requires credentials....

![image.png](https://community.atlassian.com/t5/image/serverpage/image-id/39965i690C463C25C5CD70/image-size/large?v=v2&px=999 "image.png")

....and when accessing the Settings-section, I am prompted for Admin-credentials.

![image.png](https://community.atlassian.com/t5/image/serverpage/image-id/39966i82ABB204F8FFE3ED/image-size/large?v=v2&px=999 "image.png")

Might it be the case that the authorization fails as a second log in "as Administrator" is required?

I have tried to log in as administrator (above) and then, in the same browser session (to share the token), execute the backup.action URL. But also this results in the page not found exception above.

Regards, Benjamin


author: Alexis Robert
body: Do you try to access directly the backup URL ? If yes, you should actually do the entire process using the IP address at the beginning:

1. Go to <http://192.168.41.12:8090> and log in (don't use https here)
2. Navigate to the Administration menu
3. Navigate to the Backup menu
4. Start the backup

I believe this should work, I have tried it myself on a Confluence instance and works fine.

Let me know how it goes,

--Alexis


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

ok, now got the point.

But unfortunately, this isn't working. I have the feeling this is related to (mis) configuration in our environment.  
From <http://192.168.41.12:8090/> I am prompted for the Confluence login page. When providing valid credentials, there is no redirect to a site within Confluence, just reloading the login-page.

When I enter Confluence via DNS <https://confluence.company.com>, after logging in I am redirected to <https://confluence.company.com/#all-updates>. So at this point, I am having a valid token. Now, when manually changing the URL to <http://192.168.41.12:8090/#all-updates>, it again prompts me for credentials.  
Also, there is a redirect from Port 80 to 443 (<http://confluence.company.com> will turn to https://)

I have also tried to access a deep-link by IP. Means accessing normal space via <https://confluence.company.com/display/ATL/Atlassian>, then change to https://**192.168.41.12:8090** /display/ATL/Atlassian which results in "https not possible", then change to **h** **ttp**://192.168.41.12:8090/display/ATL/Atlassian which results in prompt for credentials. (see behaviour above)

Is it the case that Tomcat is not correctly configured for redirects?

Thanks and regards, Benjamin


author: Benjamin W_
body: Hello

I have proceeded some other actions, but unfortunately still cannot get this working.

As the login page does not make a redirect after login, my feeling was that this might be related to the underlying user-directory. So I had a check for there.

Currently, our Confluence refers to JIRA, the built in Confluence directory is created, but disabled.

![Image 2019-01-08-001.jpg](https://community.atlassian.com/t5/image/serverpage/image-id/41836iE7902DB5365FC6AC/image-size/large?v=v2&px=999 "Image 2019-01-08-001.jpg")![Image 2019-01-08-002.jpg](https://community.atlassian.com/t5/image/serverpage/image-id/41837iAB39B69AF42153A3/image-size/large?v=v2&px=999 "Image 2019-01-08-002.jpg")

As a test, I have unchecked the "External user management" (in order to get the internal Confluence directory working), changed the order of the two directories (1. Confluence, 2. JIRA), and created a new user within the internal Confluence Directory.

Then, having this user, I tried to proceed the steps mentioned above (log in to <http://192.168.41.12:8090> - <http://confluence.company.com>). But the situation remains the same. After providing credentials, there is no additional action.

Logging in to Confluence normally with this user is possible without problems.

Regards, Benjamin


Tags: apache

backup

confluence-server

server

tomcat