Linux

Where Does XWiki Store Data and Attachments?

Where XWiki keeps its permanent directory, which config files point at it, and what belongs in backups.

Last updated

XWiki splits persistence between a relational database and a permanent directory on disk. The database holds page content and metadata, while the permanent directory holds attachments, search indexes, extension downloads, and job status. Debian installs default it to /var/lib/xwiki/data.

Three files in WEB-INF describe the setup: xwiki.properties names the permanent directory, hibernate.cfg.xml wires the database, and logback.xml controls logging. Never leave the permanent directory on a container temp filesystem, since the app falls back there silently and the data evaporates on restart.

Where XWiki stores this, by platform

Linux
/var/lib/xwiki/data

Debian package default for attachments, Solr index, extensions, and job state. Set it via environment.permanentDirectory in xwiki.properties or the xwiki.data.dir system property. Back it up together with a database dump; the database alone cannot rebuild file content.

Frequently asked questions

how do I back up XWiki

Copy the permanent directory plus a dump of the relational database, and keep copies of hibernate.cfg.xml, xwiki.cfg, and xwiki.properties from WEB-INF. Attachments on filesystem live under store/file inside the permanent dir. Either half alone restores nothing usable.

how do I move the XWiki permanent directory

Set environment.permanentDirectory in xwiki.properties or pass -Dxwiki.data.dir to the container. The Debian package defaults to /var/lib/xwiki/data. Restart the application server after changing it, and confirm the new location is writable by the runtime user.

can XWiki store attachments in S3

The S3 object store keeps the same relative layout as the filesystem store, so keys under the bucket mirror the old paths. The database still holds metadata either way. Migrate existing files into the bucket when switching a live wiki.

Notice an outdated path? Let us know.