Wiki source code of Distribution Wizard

Version 110.4 by Vincent Massol on 2021/10/11

Show last authors
1 {{box cssClass="floatinginfobox" title="**Contents**"}}
2 {{toc/}}
3 {{/box}}
4
5 The Distribution Wizard (also known as DW) is a feature which has several purposes:
6
7 * It allows provisioning an empty wiki by allowing the administrator to select a [[Flavor>>platform:Features.Applications||anchor="#HFlavors"]] on the first run of XWiki
8 * It allows to create an administration user account in the wiki.
9 * It also allows upgrading an existing XWiki instance to a new version by upgrading all required Extensions
10
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.
12
13 = Clean Install =
14
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. If the wizard fails to appear check the [[troubleshooting section>>platform:Features.DistributionWizard||anchor="troubleshooting"]].
16
17 == Welcome Step ==
18
19 Upon first access, you will be greeted by the Distribution Wizard, offering you the 3 possible options:
20
21 * **Continue**: when choosing this option, you will move to the next step of the Distribution Wizard
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.
23 * **Never**: Discards the DW and you will have to manually import the XAR
24
25 {{image reference="dw-welcomeStep.png"/}}
26
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
33 == User Interface ==
34
35 Since 7.1 there is two modes for the Distribution Wizard: **Flavor** and **Default User Interface**.
36
37 Since 9.5 the default mode is **Flavor**.
38
39 To switch to **Default User Interface** mode you can do one of the following:
40
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
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
46 ** ##xwiki.extension.distribution.wikiui##: the extension ID of the application to use on other wikis
47 * [only 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:
48 ** ##xwiki.extension.distribution.ui##: the extension ID of the application to use on the main wiki
49 ** ##xwiki.extension.distribution.wikiui##: the extension ID of the application to use on other wikis
50
51 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.
52
53 === Flavor step ===
54
55 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.
56
57 {{image reference="dw-flavor-step1.png"/}}
58
59 * Select a flavor in the list of flavors.
60 * Click on "install flavor".(((
61 {{image reference="dw-flavor-step2.png"/}}
62 )))
63 * You can also select to let the wiki be empty.(((
64 {{image reference="dw-noflavor.png"/}}
65 )))
66 * In the case you have selected a flavor, the following steps are similar to those described in the previous section (User Interface).
67
68 === Default User Interface ===
69
70 The first step will check your XWiki version and will propose a version of the UI which is suited for your version.
71
72 * Click on **Install** to install the proposed UI. This will resolve the extensions that are going to be installed.(((
73 {{image reference="dw-uiStep.png"/}}
74 )))
75 * Click on the **Continue** button. This will start the actual installation of the previously resolved extensions.(((
76 {{image reference="dw-uiStep-installPlan.png"/}}
77 )))
78 * You will be prompted to insert credentials for the Administrator, which are **Admin/admin**.(((
79 {{image reference="dw-uiStep-login.png"/}}
80 )))
81 * After the instalation is complete, you can click on the Continue button to proceed to the next step.
82 * Since this is a clean install, steps 2 and 3 are skipped.
83
84 == Report step ==
85
86 {{info}}
87 Since 5.4
88 {{/info}}
89
90 The last step display all changes brought to the wiki.
91
92 {{image reference="dw-report.png"/}}
93
94 = Upgrade =
95
96 Distribution Wizard also allows you to perform an upgrade without having to manually import the XAR file.
97
98 {{include reference="" section="HUserInterface"/}}
99
100 == Orphaned dependencies step ==
101
102 {{info}}
103 Since 11.10
104 {{/info}}
105
106 {{image reference="orphaned.png"/}}
107
108 This step is executed right after the Flavor step.
109
110 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).
111
112 == Wikis ==
113
114 {{info}}
115 Since 5.3 and only if there is a default UI configured.
116 {{/info}}
117
118 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.
119
120 {{image reference="dw-wikisStep.png"/}}
121
122 == Extensions ==
123
124 {{image reference="dw-extensionsStep-checkForUpdates.png"/}}
125
126 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:
127
128 * computing the upgrade plan only for the main wiki + global namespace
129 * computing the upgrade plan for the entire farm (all wikis + global namespace)
130
131 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.
132
133 {{image reference="dw-extensionsStep-computingUpgradePlan.png"/}}
134
135 After the upgrade plan is computed there are two categories of extensions listed, as you can see in the image below:
136
137 * invalid: they don't work with the current XWiki version so they must be upgraded
138 * 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
139
140 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.
141
142 {{image reference="dw-extensionsStep.png"/}}
143
144 = Upgrade with Repair =
145
146 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.
147
148 {{image reference="dw-uiStep-repair-upgradeQuestion.png"/}}
149
150 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.
151
152 {{image reference="dw-uiStep-repair-selectPreviousVersion.png"/}}
153
154 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.
155
156 {{image reference="dw-uiStep-repair-suggestPreviousId.png"/}}
157
158 If it's not the right extension id then you should click on the pencil icon to change it.
159
160 {{image reference="dw-uiStep-repair-editPreviousId.png"/}}
161
162 Next you need to repair the previous UI extension. Just click on the Repair button.
163
164 {{image reference="dw-uiStep-repair.png"/}}
165
166 Finally you should be able to upgrade the default set of wiki pages like in a normal upgrade.
167
168 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.
169
170 {{image reference="dw-wikisStep-repairPreviousUI.png"/}}
171
172 {{id name="troubleshooting"/}}
173
174 = Replay Install or Upgrade =
175
176 Starting with version 7.1 you can record an install or upgrade and replay it on a different wiki:
177
178 * You start by following the steps described in the [[Clean Install>>platform:Features.DistributionWizard||anchor="HCleanInstall"]], [[Upgrade>>platform:Features.DistributionWizard||anchor="HUpgrade"]] or [[Upgrade with Repair>>platform:Features.DistributionWizard||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+).
179 * After you finished with the install/upgrade of the default/recommended UI (XAR), you can install/upgrade additional extensions.
180 * 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
181 * 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.(((
182 {{image reference="dw-welcomeStep-replayRecordedActions.png"/}}
183 )))
184 * 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)(((
185 {{image reference="extensionHistory.png"/}}
186 )))
187 * 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.
188 * The Distribution Wizard should not appear next time you restart XWiki, but if it does, just click continue.
189
190 = Automatic mode =
191
192 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.
193
194 The is several ways to do it:
195
196 * since 10.2RC1 it's possible to disable interactive more in ##xwiki.properties## using the ##distribution.job.interactive## and ##distribution.job.interactive.wiki## properties
197 * since 9.1RC1 it's possible start the ##distribution## job trough [[the Job REST API>>Documentation.UserGuide.Features.XWikiRESTfulAPI||anchor="HJobresources"]]
198
199 {{info}}
200 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.
201 {{/info}}
202
203 = Troubleshooting =
204
205 == The wizard fails to appear at startup ==
206
207 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##).
208
209 In this case only, you can remove the ##.../jobs/status/distribution/status.xml.zip## file located inside your permanent directory (##/var/lib/xwiki/...## for [[APT installation>>platform:AdminGuide.InstallationViaAPT]] or ##/var/lib/tomcatX/webapps/...## for [[WAR installation>>platform:AdminGuide.InstallationWAR]]).
210
211 {{version before="13.7RC1"}}The status file was not zipped and named: ##.../jobs/status/distribution/status.xml##.{{/version}}
212
213 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.
214
215 {{warning}}
216 In order for the Distribution Wizard to be triggered, you have to log in as administrator (or superadmin if database is empty).
217 {{/warning}}
218
219 == Setting up new XWiki instance without reinstalling ==
220
221 To set up empty/new XWiki instance you need to clear its database and local file storage.
222
223 1. (((
224 Empty the main database.
225 For example with MySQL server, you can execute the command:
226
227 {{code language="none"}}
228 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';"
229 {{/code}}
230
231 where ##'password'## is password for xwiki user in MySQL database.
232
233 You should also delete the subwikis databases if any.
234 )))
235 1. (((
236 To clear local data in filesystem empty or remove the permanent directory (see environment.permanentDirectory property in xwiki.properties file).
237
238 For example if you have installed XWiki using [[APT>>platform:AdminGuide.InstallationViaAPT]], execute command:
239
240 {{code language="none"}}
241 sudo rm -fr /var/lib/xwiki/data /var/cache/tomcat7/Catalina/localhost/xwiki/
242 {{/code}}
243 )))
244 1. Restart the application server, open e.g. [[http://localhost:8080/xwiki]] and rerun distribution wizard again.
245
246 == Disable the automatic start of Distribution Wizard {{info}}(Since 7.1RC1){{/info}} ==
247
248 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##:
249
250 {{code language="cfg"}}
251 #-------------------------------------------------------------------------------------
252 # Distribution Wizard
253 #-------------------------------------------------------------------------------------
254
255 #-# [Since 7.1RC1] Enable or disable the automatic start of Distribution Wizard on empty/outdated wiki.
256 #-#
257 #-# The default is:
258 # distribution.automaticStartOnMainWiki=true
259 # distribution.automaticStartOnWiki=true
260 {{/code}}
261
262 You just need to uncomment the above two lines and to set the options to ##false##.

Get Connected