Ok thx for the info. What if you replicate all the top level spaces of your instance? Won’t it provide a “backup” solution for your instance if the replica is in a different data center?
It only replicates wiki pages (and a bit likes, but not ratings in general), so I would really not advertise it as a backup solution.
I would not recommend replicating the XWiki space, since it contains pretty dangerous stuff to replicate and among other things that can’t be replicated or it would break the instance (each instance needs its own URL setup and more importantly Replication setup).
I indicated a more generic limitation, there is no point listing everything it does not replicate by default (there is not much chance for it to remain up to date).
But is it possible to export only one page ?
Example : This reference page [xwiki:Bases de données.ORACLE.Erreurs connues.Fix broken oracle job.WebHome]
What is the URL to export this page as html ?
I tried to create a little script in bash to export page in pdf for DisasterRecovery Mode.
I got the page name with this query in the Database : SELECT XWD_FULLNAME FROM XWIKIDOC;
After with a curl request i tried to get the page in pdf format : curl -v -k -u ${WIKI_USER}:${WIKI_PASSWORD} --request GET "${XWIKI_WEB_URL}xwiki:${WIKI_PAGE}" -o ${XWIKI_ROOT_DEGRADE}/export.pdf
I got a message becauase there are some characters with accent and special character in page name :
<!doctype html><html lang="en"><head><title>HTTP Status 400 – Bad Request</title><style type="text/css">body {font-family:Tahoma,Arial,sans-serif;} h1, h2, h3, b {color:white;background-color:#525D76;} h1 {font-size:22px;} h2 {font-size:16px;} h3 {font-size:14px;} p {font-size:12px;} a {color:black;} .line {height:1px;background-color:#525D76;border:none;}</style></head><body><h1>HTTP Status 400 – Bad Request</h1><hr class="line" /><p><b>Type</b> Exception Report</p><p><b>Message</b> Invalid character found in the request target [/bin/export/Space/Page?format=pdf&pages=xwiki:Bases%20de%20donn%C3%A9es.MYSQL.Erreurs%20connues.%20%5BERROR%5D%20%5BMY-012574%5D%20%5BInnoDB%5D%20Unable%20to%20lock%20\.ibdata1%20error\%3A%2011.WebHome%7D%0A ]. The valid characters are defined in RFC 7230 and RFC 3986</p><p><b>Description</b> The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing).</p><p><b>Exception</b></p><pre>java.lang.IllegalArgumentException: Invalid character found in the request target [/bin/export/Space/Page?format=pdf&pages=xwiki:Bases%20de%20donn%C3%A9es.MYSQL.Erreurs%20connues.%20%5BERROR%5D%20%5BMY-012574%5D%20%5BInnoDB%5D%20Unable%20to%20lock%20\.ibdata1%20error\%3A%2011.WebHome%7D%0A ]. The valid characters are defined in RFC 7230 and RFC 3986
org.apache.coyote.http11.Http11InputBuffer.parseRequestLine(Http11InputBuffer.java:482)
org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:269)
org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:63)
org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:937)
org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1791)
org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:52)
org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1190)
org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659)
org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:63)
java.base/java.lang.Thread.run(Unknown Source)
</pre><p><b>Note</b> The full stack trace of the root cause is available in the server logs.</p><hr class="line" /><h3>Apache Tomcat/9.0.98</h3></body></html>
Example withe page name got accent and specials characters Bases de données.MYSQL.Erreurs connues. [ERROR] [MY-012574] [InnoDB] Unable to lock \\.ibdata1 error\\: 11.WebHome
Do you know how to pass specials characters to curl request ?
If you having programming rights the following groovy code helps.
It introduces a redirect to start the pdf output which is received by curl as standard output.
curl must use the “-L” parameter to follow the redirect.
Store the code into a file. It is a bit self describing.
{{groovy}}
if(request.document != null) {
theDoc=xwiki.getDocument(request.document)
if(request.template != null) { template="&pdftemplate=${request.template}" } else { template="" }
response.sendRedirect(theDoc.getExternalURL("export","format=pdf&pdfcover=0&pdftoc=0&pdfheader=0&pdffooter=0&comments=0&attachments=0${template}"))
} else {
print " "+
"use by CURL \n\n" +
"## curl -L -k -u __WIKIUSER:WIKIPASSWORD__ ~--data-urlencode \"document=__~FULLNAME OF WIKI DOCUMENT__\"" +
" \"__${doc.getExternalURL('view').replaceAll(/^(htt.*?:\/)/,'{{{$1}}}')}__\" > __NAME-OF-OUTPUT-PDF-FILE__ ##\n\n" +
"The __underlined parts__ must be set appropriately"
}
{{/groovy}}