Instance Cloning

Last modified by Eleni Cojocariu on 2026/08/12 10:11

Explanation

Warning

WIP. This topic will be moved soon under the Backup topic (which doesn't exist yet in new documentation).

Cloning an XWiki instance means making a full, independent copy of it: an instance that serves the same content while keeping its own identity. A common case is copying a live instance into a preproduction environment, to test changes before they go live.

The base procedure is a Backup/Restore of the database and the permanent directory, which together hold everything the instance contains. What that copy cannot do on its own is tell apart what belongs to the wiki from what identifies this instance in this environment. Clone an XWiki Instance covers both halves.

Every instance has an id of its own, stored as the single row of the xwikiid database table. Restoring that row would hand the source's identity to the target, so the table is left out of the restore. This id also matters for licensing: paid extensions, for example, have their licenses issued against an instance id, so the ones restored with the database do not apply to the target, it reloads its own from the store instead.

A domain name, a mail server, the address of a third-party service: these describe the environment rather than the wiki, and they live in two places that behave differently when cloning. xwiki.cfg and xwiki.properties are configuration files, so no database restore touches them. They have to be copied from the source and then reviewed, because any of their uncommented settings may name the source's environment.

Everything else is in the database and comes back holding the source's values: the "Alias" property of the XWiki.XWikiServerXwiki page, which is the domain name the wiki answers on, and the settings of every extension that connects to an external service, for example, the mail sending settings.

The external identities an identity provider recorded on the user profiles are copied with them, which is what you want when both instances authenticate against the same provider. When the target uses a different one, returning users are given a second, empty profile, and its own authentication settings are not enough to prevent that, hence Preserve User Profiles When Cloning to a Different Identity Provider.

FAQ

Should hibernate.cfg.xml be copied from the source as well?

No. It holds the database connection of the instance it belongs to, so copying it would point the target instance at the source's database.

What if the target instance's own id is lost during the restore?

XWiki generates a new one on the next start and stores it, so the instance keeps working — but it is no longer the instance its licenses were issued against.

Can a XAR export of every page replace the database dump?

No. Some data is not stored in wiki pages and is therefore absent from an export in XAR format: the instance id, the event stream, the statistics, the deleted documents and attachments, and the mail statuses.

More

To find more about the current topic, you can search or use the table below and filter the columns to narrow your choices.

Related

Get Connected