Clone an XWiki Instance
Last modified by Eleni Cojocariu on 2026/08/03 09:16
Steps
To copy an XWiki instance (the source) into a separate instance (the target):
- Back up the database and the permanent directory of the source instance.
- Exclude the xwikiid database table from the backup, so the target instance keeps its own id.
- Restore the database and the permanent directory on the target instance.
- (If applicable) If you have licensed (paid) extensions installed, administer your wiki, go to "Extensions" > "Licenses", and click "Check for License Updates" to reload their licenses for the target instance's id.
- Copy xwiki.cfg and xwiki.properties from the source instance to the target instance.
- Review every uncommented setting in xwiki.cfg and xwiki.properties and update anything specific to the source's environment, (e.g., domain name or any third-party service address). Authentication settings need separate handling depending on where they're stored:
- If they are stored in xwiki.properties, do not copy them from the source at all, leave the target instance's own values in place.
- If they are stored on the wiki instead (through the Administration, or on a configuration page as the OIDC authenticator supports), the database restore will bring back the source's values, so after the database restore you need to explicitly re-apply the target instance's own authentication settings.
- Open the XWiki.XWikiServerXwiki page and set the Alias property to the target instance's own domain name.
- In the administer wiki, review and update any setting restored from the source's database that is environment-specific, (e.g. mail sending) and any installed extension that connects to an external service.
- If the restored authentication settings block login, use the superadmin account to fix the configuration from inside the wiki.
FAQ
When would you need to clone an XWiki instance?
For example, to test changes safely before applying them to a live instance.
What if the target instance needs a different identity provider than the source?
Follow Preserve User Profiles When Cloning to a Different Identity Provider instead of copying authentication settings when you copy the configuration files and re-set the administration settings.
Do xwiki.cfg and xwiki.properties need to stay identical to the source?
No. Only the settings that aren't environment-specific. Anything with a domain name or an external service address should be reviewed and adapted.
What happens if I forget to exclude the xwikiid table?
The target instance ends up sharing the source's instance id, which breaks the assumption that each instance has its own id, and can affect the license reload afterwards.