Struggling with export to html function

Hi everyone,

For a pseudo disaster recovery plan, I would like to export all subwiki pages to a self contained html file.
I am able to export pages and sub pages like this:

https://wiki/xwiki/bin/export/Space/Page?format=html&pages=Page1.%25&name=Page1

On the same level, there are multiple other pages. Example Page2, Page3 etc.

image

I need to export all pages from a single URL and I am not good enough to understand how, could someone please give me a hand how to achieve that?

Regards,
jec

See https://www.xwiki.org/xwiki/bin/view/Documentation/UserGuide/Features/Exports#HAdvanced-1 for details.

Have you tried using https://wiki/xwiki/bin/export/Space/Page?format=html&pages=%25&name=AllPages ?

Thx

Hi Vincent, yes I did experiment with this example from the Exports

This specific example return a white page and no downloads is generated.

The following worked for me http://localhost:8080/xwiki/bin/export/Space/Page?format=html&pages=%25&name=AllPages (it takes a lot of time though and it’s not really made for that).

If you want to save your wiki content, you should use a XAR export instead.

1 Like

Hi Vincent,

Happy new year to you.

It doesn’t work for me, you’re lucky.

The wiki I try to export is a subwiki, does this change anything with the URL?

With this URL, nothing happens, I get a 200 https code and a white page.
…/xwiki/bin/export/Space/Page?format=html&pages=%25&name=AllPages

I can alter the URL and the same result occurs.
image

When I hit this URL …/xwiki/bin/export/Space/ it makes a XAR export and starts downloading.
I can invent a URL and the xar archive start downloading anyway. Example: …/xwiki/bin/export/Space/Happy-New-Year-2024

What’s great with HTML export is that it provides a self contained HTML that can be opened and browsed.

This is not the case for xar. One need a xwiki instance to import it.

Regards,
jec

Are you using a domain-based URL for subwikis? I’m asking as I don’t see the full URL you’re using and it doesn’t seem you’re using path-based UTLs (i.e. /wikis/<wiki name>/... instead of /bin/...).

I’ll need to find some time to try it out (with a subwiki). Maybe pages=<subwikiname>:%25.%25 would work.

See also Loading...

1 Like

Actually, and unfortunately, I did leak the URL in the previous post, I edited it now but it remains in editing history, argh :slight_smile:

Domain based - yes, main wiki is wiki.domain.tld and sub wiki is subwiki.domain.tld.

Thank you for the jira ticket hint, what you found worked like a charm.

Thank you so much. Vincent tu es super!

Actually, what worked was http://localhost:8080/xwiki/bin/export/Space/Page?format=html&pages=%25.%25&name=AllPages

I’ve documented it at https://www.xwiki.org/xwiki/bin/view/Documentation/UserGuide/Features/Exports#HAdvanced-1

While trying it I’ve also found some errors displayed in the console that I’ve fixed:

Thanks