Wiki source code of Instance Cloning
Last modified by Eleni Cojocariu on 2026/08/12 10:11
Show last authors
| author | version | line-number | content |
|---|---|---|---|
| 1 | {{warning}} | ||
| 2 | WIP. This topic will be moved soon under the Backup topic (which doesn't exist yet in new documentation). | ||
| 3 | {{/warning}} | ||
| 4 | |||
| 5 | 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. | ||
| 6 | |||
| 7 | The base procedure is a [[Backup/Restore>>Documentation.AdminGuide.Backup]] of the database and the [[permanent directory>>documentation.xs.admin.configuration.directories.permanent-directory.WebHome]], 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>>documentation.xs.admin.instance-cloning.clone-instance.WebHome]] covers both halves. | ||
| 8 | |||
| 9 | Every instance has an [[id of its own>>documentation.xs.dev.instance.get-instance-id.WebHome]], 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>>https://store.xwiki.com/xwiki/bin/view/Main/]], 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. | ||
| 10 | |||
| 11 | 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>>documentation.xs.admin.configuration.WebHome]], 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. | ||
| 12 | |||
| 13 | 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>>extensions:Extension.Mail.MailApplication]] settings. | ||
| 14 | |||
| 15 | The [[external identities>>documentation.xs.admin.authentication.user-profiles-external-identities.WebHome]] an identity provider recorded on the [[user profiles>>documentation.xs.user.user.WebHome]] 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>>documentation.xs.admin.authentication.WebHome]] settings are not enough to prevent that, hence [[Preserve User Profiles When Cloning to a Different Identity Provider>>documentation.xs.admin.instance-cloning.preserve-user-profiles-different-identity-provider.WebHome]]. |