Wiki source code of Distribution Wizard

Last modified by Thomas Mortagne on 2023/10/10

Hide last authors
Sorin Burjan 1.1 1 {{box cssClass="floatinginfobox" title="**Contents**"}}
Marius Dumitru Florea 16.1 2 {{toc/}}
Sorin Burjan 1.1 3 {{/box}}
4
Vincent Massol 109.2 5 The Distribution Wizard (also known as DW) is a feature which has several purposes:
Ecaterina Moraru (Valica) 93.1 6
Thomas Mortagne 114.1 7 * It allows provisioning an empty wiki by allowing the administrator to select a [[Flavor>>Applications||anchor="#HFlavors"]] on the first run of XWiki
Vincent Massol 109.2 8 * It allows to create an administration user account in the wiki.
Vincent Massol 92.1 9 * It also allows upgrading an existing XWiki instance to a new version by upgrading all required Extensions
Sorin Burjan 1.1 10
Vincent Massol 92.1 11 It works using XWiki's Extension Manager to automatically detect your XWiki version to search, resolve, download and install the UI corresponding to your version. It requires an internet connection in order to work.
Sorin Burjan 1.1 12
Marius Dumitru Florea 15.1 13 = Clean Install =
Sorin Burjan 1.1 14
Thomas Mortagne 114.1 15 After putting your XWiki WAR inside your Servlet Container (Tomcat, Jetty, etc.) you start XWiki. When XWiki is first accessed, it will trigger the Distribution Wizard and you can access if either the wiki is empty (first install) or you are logged with a user having ADMIN right (upgrade). If the wizard fails to appear check the [[troubleshooting section>>||anchor="troubleshooting"]].
Sorin Burjan 1.1 16
Marius Dumitru Florea 15.1 17 == Welcome Step ==
Sorin Burjan 1.1 18
19 Upon first access, you will be greeted by the Distribution Wizard, offering you the 3 possible options:
Marius Dumitru Florea 15.1 20
Marius Dumitru Florea 36.1 21 * **Continue**: when choosing this option, you will move to the next step of the Distribution Wizard
Marius Dumitru Florea 84.1 22 * **Later**: DW will prompt you again after XWiki is restarted; note that the Later button has a sub-option "Replay recorded actions" that has the same effect on the Distribution Wizard, but instead of redirecting you to the page that was requested initially, it redirects you to the [[Extension History>>extensions:Extension.Extension Manager Application||anchor="HExtensionHistory"]] where you can upload and replay a history file (e.g. you can replay an install or upgrade performed on a different wiki). If the database is empty you'll have to login with the ##superadmin## user.
Marius Dumitru Florea 36.1 23 * **Never**: Discards the DW and you will have to manually import the XAR
Sorin Burjan 1.1 24
Valdis Vitolins 57.1 25 {{image reference="dw-welcomeStep.png"/}}
Sorin Burjan 1.1 26
Thomas Mortagne 91.1 27 == Admin user ==
28
29 Since 8.0 the first step allows you to register the owner of the wiki. You will then be automatically registered with it and it will be used to install anything that need to be installed.
30
31 {{image reference="dw-firstadminuserStep.png"/}}
32
Marius Dumitru Florea 15.1 33 == User Interface ==
34
Thomas Mortagne 96.1 35 Since 7.1 there is two modes for the Distribution Wizard: **Flavor** and **Default User Interface**.
Sorin Burjan 1.1 36
Thomas Mortagne 96.1 37 Since 9.5 the default mode is **Flavor**.
Sorin Burjan 1.1 38
Thomas Mortagne 97.1 39 To switch to **Default User Interface** mode you can do one of the following:
Guillaume Delhumeau 81.1 40
Thomas Mortagne 97.1 41 * [since 10.2] have the following properties set properly in the file ##WEB-INF/xwiki.properties## of the web app:
42 ** ##distribution.defaultUI##: the extension ID[/version] of the application to use on the main wiki
43 ** ##distribution.defaultWikiUI##: the extension ID[/version] of the application to use on other wikis
Thomas Mortagne 94.1 44 * [since 8.4] have the following properties set properly in the file ##META-INF/extension.xed## of the web app:
45 ** ##xwiki.extension.distribution.ui##: the extension ID of the application to use on the main wiki
Raphaël Jakse 113.1 46 ** ##xwiki.extension.distribution.ui.version##: the version of the application to use on the main wiki
Thomas Mortagne 94.1 47 ** ##xwiki.extension.distribution.wikiui##: the extension ID of the application to use on other wikis
Raphaël Jakse 113.1 48 ** ##xwiki.extension.distribution.wikiui.version##: the version of the application to use on other wikis
49 * [only when no extension.xed exist] have the following properties set properly in the file ##META-INF/maven/org.xwiki.enterprise/xwiki-enterprise-web/pom.xml## of the web app:
Thomas Mortagne 94.1 50 ** ##xwiki.extension.distribution.ui##: the extension ID of the application to use on the main wiki
Raphaël Jakse 113.1 51 ** ##xwiki.extension.distribution.ui.version##: the version of the application to use on the main wiki
Thomas Mortagne 94.1 52 ** ##xwiki.extension.distribution.wikiui##: the extension ID of the application to use on other wikis
Raphaël Jakse 113.1 53 ** ##xwiki.extension.distribution.wikiui.version##: the version of the application to use on other wikis
Thomas Mortagne 94.1 54
Thomas Mortagne 96.1 55 If you build a custom WAR using Maven, you will set those properties in your project pom and let the Extension plugin generate the right extension.xed file.
Guillaume Delhumeau 81.1 56
Thomas Mortagne 96.1 57 === Flavor step ===
Guillaume Delhumeau 81.1 58
Thomas Mortagne 96.1 59 If there is no default UI set as explained just above, you will have the Flavor Step. A flavor is a collection of applications according to different needs. You can have a flavor for a knowledge base or a public website, for example.
Guillaume Delhumeau 81.1 60
61 {{image reference="dw-flavor-step1.png"/}}
62
63 * Select a flavor in the list of flavors.
64 * Click on "install flavor".(((
65 {{image reference="dw-flavor-step2.png"/}}
66 )))
67 * You can also select to let the wiki be empty.(((
68 {{image reference="dw-noflavor.png"/}}
69 )))
70 * In the case you have selected a flavor, the following steps are similar to those described in the previous section (User Interface).
71
Thomas Mortagne 96.1 72 === Default User Interface ===
73
74 The first step will check your XWiki version and will propose a version of the UI which is suited for your version.
75
76 * Click on **Install** to install the proposed UI. This will resolve the extensions that are going to be installed.(((
77 {{image reference="dw-uiStep.png"/}}
78 )))
79 * Click on the **Continue** button. This will start the actual installation of the previously resolved extensions.(((
80 {{image reference="dw-uiStep-installPlan.png"/}}
81 )))
82 * You will be prompted to insert credentials for the Administrator, which are **Admin/admin**.(((
83 {{image reference="dw-uiStep-login.png"/}}
84 )))
85 * After the instalation is complete, you can click on the Continue button to proceed to the next step.
86 * Since this is a clean install, steps 2 and 3 are skipped.
87
Thomas Mortagne 26.1 88 == Report step ==
89
Valdis Vitolins 57.1 90 {{info}}
91 Since 5.4
92 {{/info}}
Thomas Mortagne 28.1 93
Thomas Mortagne 26.1 94 The last step display all changes brought to the wiki.
95
96 {{image reference="dw-report.png"/}}
97
Marius Dumitru Florea 20.1 98 = Upgrade =
Sorin Burjan 1.1 99
100 Distribution Wizard also allows you to perform an upgrade without having to manually import the XAR file.
101
Thomas Mortagne 98.1 102 {{include reference="" section="HUserInterface"/}}
Sorin Burjan 1.1 103
Thomas Mortagne 108.1 104 == Orphaned dependencies step ==
Thomas Mortagne 106.1 105
106 {{info}}
107 Since 11.10
108 {{/info}}
109
Thomas Mortagne 108.1 110 {{image reference="orphaned.png"/}}
111
Thomas Mortagne 106.1 112 This step is executed right after the Flavor step.
113
114 Its job is to make sure no orphaned dependency (extension installed as dependency but which don't have any backward dependency left) is left in the installed extensions. The step suggest to uninstalled the invalid ones by default and make the others top level extensions (i.e. taken into account by the upgrade job).
115
Thomas Mortagne 28.1 116 == Wikis ==
Marius Dumitru Florea 20.1 117
Valdis Vitolins 57.1 118 {{info}}
Thomas Mortagne 99.1 119 Since 5.3 and only if there is a default UI configured.
Valdis Vitolins 57.1 120 {{/info}}
Marius Dumitru Florea 20.1 121
Thomas Mortagne 28.1 122 Distribution Wizard list all the existing wikis with the recommended user interface version that needs to be installed in order to update the default set of wiki pages.
Marius Dumitru Florea 20.1 123
Valdis Vitolins 57.1 124 {{image reference="dw-wikisStep.png"/}}
Marius Dumitru Florea 23.1 125
Marius Dumitru Florea 20.1 126 == Extensions ==
Marius Dumitru Florea 23.1 127
Valdis Vitolins 57.1 128 {{image reference="dw-extensionsStep-checkForUpdates.png"/}}
Marius Dumitru Florea 24.1 129
Marius Dumitru Florea 53.1 130 In the last step you can upgrade the extensions that you may have installed on your wikis. If you are on a subwiki then you can only check for updates for the extensions installed on that subwiki. On the main wiki global administrators can choose between:
131
Marius Dumitru Florea 56.1 132 * computing the upgrade plan only for the main wiki + global namespace
Marius Dumitru Florea 53.1 133 * computing the upgrade plan for the entire farm (all wikis + global namespace)
134
Marius Dumitru Florea 56.1 135 The first option is suited when each wiki in the farm is managed by a different entity while the second option is suited when the farm is managed by a single entity. Obviously computing the upgrade plan for the entire farm takes longer (with the number of wikis) than computing the upgrade plan only for the main wiki.
Marius Dumitru Florea 53.1 136
Valdis Vitolins 57.1 137 {{image reference="dw-extensionsStep-computingUpgradePlan.png"/}}
Marius Dumitru Florea 53.1 138
139 After the upgrade plan is computed there are two categories of extensions listed, as you can see in the image below:
140
Marius Dumitru Florea 24.1 141 * invalid: they don't work with the current XWiki version so they must be upgraded
142 * outdated: they should work with the current XWiki version but there is a newer version available that probably has bug fixes, improvements or new features
143
Marius Dumitru Florea 56.1 144 Under each category, the extensions are sorted by their name, grouped by the namespace (wiki) where they are installed and paginated. In order to complete this step you have to upgrade the invalid extensions. Upgrading the outdated extensions is optional as you can do it later from the [[Extension Updater>>doc:extensions:Extension.Extension Manager Application||anchor="HExtensionUpdater"]] section in the administration.
Marius Dumitru Florea 24.1 145
Valdis Vitolins 57.1 146 {{image reference="dw-extensionsStep.png"/}}
Marius Dumitru Florea 49.1 147
148 = Upgrade with Repair =
149
150 In order to be able to do 3-way automatic merges, the Extension Manager, used by the Distribution Wizard, needs to know the user interface version (i.e. default set of wiki pages) that was previously installed. When this information is not available the Distribution Wizard asks the user. This can happen for instance when you upgrade from a very old XWiki version where the default set of wiki pages wasn't installed through the Extension Manager. First you need to tell the Distribution Wizard if you are performing an upgrade or not.
151
Valdis Vitolins 57.1 152 {{image reference="dw-uiStep-repair-upgradeQuestion.png"/}}
Marius Dumitru Florea 49.1 153
154 Then you need to select the previous version. You should find your version in the provided list. Otherwise you can click on the pencil icon to enter a different version.
155
Valdis Vitolins 57.1 156 {{image reference="dw-uiStep-repair-selectPreviousVersion.png"/}}
Marius Dumitru Florea 49.1 157
158 Once you select a version the Distribution Wizard shows you the extension id that corresponds to that version. Make sure it is the right id.
159
Valdis Vitolins 57.1 160 {{image reference="dw-uiStep-repair-suggestPreviousId.png"/}}
Marius Dumitru Florea 49.1 161
162 If it's not the right extension id then you should click on the pencil icon to change it.
163
Valdis Vitolins 57.1 164 {{image reference="dw-uiStep-repair-editPreviousId.png"/}}
Marius Dumitru Florea 49.1 165
166 Next you need to repair the previous UI extension. Just click on the Repair button.
167
Valdis Vitolins 57.1 168 {{image reference="dw-uiStep-repair.png"/}}
Marius Dumitru Florea 49.1 169
170 Finally you should be able to upgrade the default set of wiki pages like in a normal upgrade.
171
172 If you have multiple wikis, then the **Wikis** step will allow you to repair the user interface on each of the available wikis. The process is the same as for the main wiki, the one described above.
173
Valdis Vitolins 57.1 174 {{image reference="dw-wikisStep-repairPreviousUI.png"/}}
Vincent Massol 50.1 175
Vincent Massol 51.1 176 {{id name="troubleshooting"/}}
Valdis Vitolins 57.1 177
Marius Dumitru Florea 85.1 178 = Replay Install or Upgrade =
179
180 Starting with version 7.1 you can record an install or upgrade and replay it on a different wiki:
Dmitry Bakbardin 88.1 181
Thomas Mortagne 114.1 182 * You start by following the steps described in the [[Clean Install>>||anchor="HCleanInstall"]], [[Upgrade>>||anchor="HUpgrade"]] or [[Upgrade with Repair>>||anchor="HUpgradewithRepair"]] sections. The decisions you take (e.g. which extension to repair, which extensions to upgrade, merge conflict resolution, page cleanup) are automatically recorded (the XWiki WAR must have version 7.1+).
Marius Dumitru Florea 85.1 183 * After you finished with the install/upgrade of the default/recommended UI (XAR), you can install/upgrade additional extensions.
184 * Then you go to the [[Extension History>>extensions:Extension.Extension Manager Application||anchor="HExtensionHistory"]] section in the [[wiki administration>>extensions:Extension.Administration Application]] and export the actions that you wish to be replayed on a different wiki
185 * Access the wiki where you want to replay the recorded actions. When the Distribution Wizard appears, skip it by choosing the "Replay recorded actions" sub-option of the "Later" button from the Welcome step.(((
186 {{image reference="dw-welcomeStep-replayRecordedActions.png"/}}
187 )))
188 * This will take you to the Extension History (works even if the database is empty, but in this case you'll have to login with the ##superadmin## user)(((
189 {{image reference="extensionHistory.png"/}}
190 )))
191 * Import the history file you have previously exported, select the records to replay and replay them. Note that you can replay on multiple wikis at the same time, if you have Programming Rights. If there are questions (e.g. a merge conflict) that don't have an answer in the recorded history file then you will be prompted to answer them.
192 * The Distribution Wizard should not appear next time you restart XWiki, but if it does, just click continue.
193
Thomas Mortagne 101.1 194 = Automatic mode =
195
196 By default you get a wizard when there is things to finish (usually install the user interface) but it's also possible to disable the interactive mode and let the Distribution job runs and take decision automatically.
197
198 The is several ways to do it:
199
200 * since 10.2RC1 it's possible to disable interactive more in ##xwiki.properties## using the ##distribution.job.interactive## and ##distribution.job.interactive.wiki## properties
201 * since 9.1RC1 it's possible start the ##distribution## job trough [[the Job REST API>>Documentation.UserGuide.Features.XWikiRESTfulAPI||anchor="HJobresources"]]
202
Thomas Mortagne 102.1 203 {{info}}
Thomas Mortagne 103.1 204 If you enable automatic mode you might also want to indicate a default UI since the default mode (flavors) won't do much (because it does not know which flavor you want). See [[User Interface>>||anchor="HUserInterface"]] for more details.
Thomas Mortagne 102.1 205 {{/info}}
206
Vincent Massol 50.1 207 = Troubleshooting =
208
209 == The wizard fails to appear at startup ==
210
211 If you're doing a first time install and the Distribution Wizard doesn't appear it's probably because you've copied some directories from an existing install. Namely, the Distribution Wizard looks for status files located in your permanent directory (the ##environment.permanentDirectory## property in ##xwiki.properties##).
212
Thomas Mortagne 114.1 213 In this case only, you can remove the ##.../jobs/status/distribution/status.xml.zip## file located inside your permanent directory (##/var/lib/xwiki/data/...## for [[APT installation>>Documentation.AdminGuide.InstallationViaAPT]] or ##/var/lib/tomcatX/webapps/...## for [[WAR installation>>Documentation.AdminGuide.InstallationWAR]]).
Vincent Massol 50.1 214
Thomas Mortagne 111.1 215 {{version before="13.7RC1"}}
216 The status file was not zipped and named: ##.../jobs/status/distribution/status.xml##.
217 {{/version}}
Vincent Massol 110.2 218
Vincent Massol 50.1 219 Now, if you have done an upgrade of the XWiki WAR, you'll need to be logged with a user having Admin rights to see the Distribution Wizard appear.
Valdis Vitolins 59.1 220
Dmitry Bakbardin 88.1 221 {{warning}}
222 In order for the Distribution Wizard to be triggered, you have to log in as administrator (or superadmin if database is empty).
223 {{/warning}}
224
Valdis Vitolins 59.1 225 == Setting up new XWiki instance without reinstalling ==
226
Valdis Vitolins 61.2 227 To set up empty/new XWiki instance you need to clear its database and local file storage.
Valdis Vitolins 59.1 228
229 1. (((
Thomas Mortagne 61.1 230 Empty the main database.
231 For example with MySQL server, you can execute the command:
Valdis Vitolins 59.1 232
233 {{code language="none"}}
234 mysql -uroot -p -e "drop database xwiki; CREATE DATABASE xwiki CHARACTER SET utf8 COLLATE utf8_general_ci; GRANT ALL PRIVILEGES ON xwiki.* TO 'xwiki'@'localhost' IDENTIFIED BY 'password';"
235 {{/code}}
236
Thomas Mortagne 61.1 237 where ##'password'## is password for xwiki user in MySQL database.
238
239 You should also delete the subwikis databases if any.
Valdis Vitolins 59.1 240 )))
Valdis Vitolins 60.1 241 1. (((
Thomas Mortagne 61.1 242 To clear local data in filesystem empty or remove the permanent directory (see environment.permanentDirectory property in xwiki.properties file).
Valdis Vitolins 59.1 243
Thomas Mortagne 114.1 244 For example if you have installed XWiki using [[APT>>Documentation.AdminGuide.InstallationViaAPT]], execute command:
Thomas Mortagne 61.1 245
Valdis Vitolins 59.1 246 {{code language="none"}}
Valdis Vitolins 62.1 247 sudo rm -fr /var/lib/xwiki/data /var/cache/tomcat7/Catalina/localhost/xwiki/
Valdis Vitolins 59.1 248 {{/code}}
Valdis Vitolins 60.1 249 )))
Thomas Mortagne 61.1 250 1. Restart the application server, open e.g. [[http://localhost:8080/xwiki]] and rerun distribution wizard again.
Guillaume Delhumeau 74.1 251
Guillaume Delhumeau 81.1 252 == Disable the automatic start of Distribution Wizard {{info}}(Since 7.1RC1){{/info}} ==
253
Guillaume Delhumeau 74.1 254 If, for some reason, you need to disable the Distribution Wizard when you start the wiki for the first time, you can change the configuration in ##xwiki.properties##:
255
256 {{code language="cfg"}}
257 #-------------------------------------------------------------------------------------
258 # Distribution Wizard
259 #-------------------------------------------------------------------------------------
260
261 #-# [Since 7.1RC1] Enable or disable the automatic start of Distribution Wizard on empty/outdated wiki.
262 #-#
263 #-# The default is:
264 # distribution.automaticStartOnMainWiki=true
265 # distribution.automaticStartOnWiki=true
266 {{/code}}
267
268 You just need to uncomment the above two lines and to set the options to ##false##.

Get Connected