Creating a offline HTML backup

No, you can’t :slight_smile:

But here’s how to make it work:

{{groovy}}
import com.xpn.xwiki.export.html.*
import org.xwiki.model.reference.*

if (request.confirm == '1') {
    HtmlPackager packager = new HtmlPackager()
    packager.setName("TestVMA")
    packager.setDescription("Test VMA")
    packager.addPageReferences([new DocumentReference("xwiki", "Sandbox", "WebHome")])
    packager.export(xcontext.getContext())
}
{{/groovy}}
  • Step 2: Use curl or wget to call it, for example:

curl http://localhost:8080/xwiki/bin/get/Main/Export/?confirm=1 -o VMA.zip

1 Like