Wiki source code of Distribution Wizard

Version 86.1 by Marius Dumitru Florea on 2015/06/15

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
Marius Dumitru Florea 15.1 5 Starting with XWiki 4.2, the Distribution Wizard (also known as DW) was introduced as an experimental feature which helps users migrate their XWiki instances to newer versions without having to manually import the XAR (wiki pages) corresponding to their new version.
Sorin Burjan 1.1 6
Vincent Massol 50.1 7 XWiki's Distribution Wizard comes as an aid to ease the migration and installation of the desired user interface (UI, the default set of wiki pages) in your flavour. 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 8
Marius Dumitru Florea 15.1 9 = Clean Install =
Sorin Burjan 1.1 10
Vincent Massol 50.1 11 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>>||anchor="troubleshooting"]].
Sorin Burjan 1.1 12
Marius Dumitru Florea 15.1 13 == Welcome Step ==
Sorin Burjan 1.1 14
15 Upon first access, you will be greeted by the Distribution Wizard, offering you the 3 possible options:
Marius Dumitru Florea 15.1 16
Marius Dumitru Florea 36.1 17 * **Continue**: when choosing this option, you will move to the next step of the Distribution Wizard
Marius Dumitru Florea 84.1 18 * **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 19 * **Never**: Discards the DW and you will have to manually import the XAR
Sorin Burjan 1.1 20
Valdis Vitolins 57.1 21 {{image reference="dw-welcomeStep.png"/}}
Sorin Burjan 1.1 22
Marius Dumitru Florea 15.1 23 == User Interface ==
24
Sorin Burjan 1.1 25 The first step will check your XWiki version and will propose a version of the UI which is suited for your version.
26
Marius Dumitru Florea 15.1 27 * Click on **Install** to install the proposed UI. This will resolve the extensions that are going to be installed.(((
Valdis Vitolins 57.1 28 {{image reference="dw-uiStep.png"/}}
Marius Dumitru Florea 15.1 29 )))
30 * Click on the **Continue** button. This will start the actual installation of the previously resolved extensions.(((
Valdis Vitolins 57.1 31 {{image reference="dw-uiStep-installPlan.png"/}}
Marius Dumitru Florea 15.1 32 )))
33 * You will be prompted to insert credentials for the Administrator, which are **Admin/admin**.(((
Valdis Vitolins 57.1 34 {{image reference="dw-uiStep-login.png"/}}
Marius Dumitru Florea 15.1 35 )))
Sorin Burjan 1.1 36 * After the instalation is complete, you can click on the Continue button to proceed to the next step.
Marius Dumitru Florea 15.1 37 * Since this is a clean install, steps 2 and 3 are skipped.
Sorin Burjan 1.1 38
Guillaume Delhumeau 81.1 39 {{info}}
40 This step is displayed only if you have the following properties set properly in the file ##META-INF/maven/org.xwiki.enterprise/xwiki-enterprise-web/pom.xml## of the web app:
41 * ##xwiki.extension.distribution.ui##: the extension ID of the application to use on the main wiki
42 * ##xwiki.extension.distribution.wikiui##: the extension ID of the application to use on other wikis
43
44 These are the default settings, which means you will have this step by default on XWiki Enterprise:
45
46 {{code language="xml"}}
47 <!-- The default UI associated to this WAR -->
48 <xwiki.extension.distribution.ui>org.xwiki.enterprise:xwiki-enterprise-ui-mainwiki</xwiki.extension.distribution.ui>
49 <xwiki.extension.distribution.wikiui>org.xwiki.enterprise:xwiki-enterprise-ui-wiki</xwiki.extension.distribution.wikiui>
50 {{/code}}
51
52 {{/info}}
53
54 == Flavor ==
55
56 Since XWiki 7.1RC1, 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.
57
58 {{image reference="dw-flavor-step1.png"/}}
59
60 * Select a flavor in the list of flavors.
61 * Click on "install flavor".(((
62 {{image reference="dw-flavor-step2.png"/}}
63 )))
64 * You can also select to let the wiki be empty.(((
65 {{image reference="dw-noflavor.png"/}}
66 )))
67 * In the case you have selected a flavor, the following steps are similar to those described in the previous section (User Interface).
68
Thomas Mortagne 26.1 69 == Report step ==
70
Valdis Vitolins 57.1 71 {{info}}
72 Since 5.4
73 {{/info}}
Thomas Mortagne 28.1 74
Thomas Mortagne 26.1 75 The last step display all changes brought to the wiki.
76
77 {{image reference="dw-report.png"/}}
78
Marius Dumitru Florea 20.1 79 = Upgrade =
Sorin Burjan 1.1 80
81 Distribution Wizard also allows you to perform an upgrade without having to manually import the XAR file.
82
Marius Dumitru Florea 15.1 83 == User Interface ==
Sorin Burjan 1.1 84
Manuel Smeria 62.2 85 * The Distribution Wizard detects that the UI version is not the latest and proposes to upgrade. Click on the **Upgrade** button. After the required dependencies are resolved, click **Continue** button to begin the actual installation of the new UI:(((
Marius Dumitru Florea 41.1 86 {{image reference="dw-uiStep-upgrade.png"/}}
Marius Dumitru Florea 15.1 87 )))
Manuel Smeria 62.2 88 * During the instalation you might get merge conflicts. Although XWiki does automatically a 3 way merge, sometimes the merge might fail. Solve your conflict and click on **Continue**:(((
89 {{image reference="DW_Upgrade_4.png"/}}
Marius Dumitru Florea 15.1 90 )))
Marius Dumitru Florea 20.1 91
Thomas Mortagne 28.1 92 == Wikis ==
Marius Dumitru Florea 20.1 93
Valdis Vitolins 57.1 94 {{info}}
95 Since 5.3
96 {{/info}}
Marius Dumitru Florea 20.1 97
Thomas Mortagne 28.1 98 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 99
Valdis Vitolins 57.1 100 {{image reference="dw-wikisStep.png"/}}
Marius Dumitru Florea 23.1 101
Marius Dumitru Florea 20.1 102 == Extensions ==
Marius Dumitru Florea 23.1 103
Valdis Vitolins 57.1 104 {{image reference="dw-extensionsStep-checkForUpdates.png"/}}
Marius Dumitru Florea 24.1 105
Marius Dumitru Florea 53.1 106 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:
107
Marius Dumitru Florea 56.1 108 * computing the upgrade plan only for the main wiki + global namespace
Marius Dumitru Florea 53.1 109 * computing the upgrade plan for the entire farm (all wikis + global namespace)
110
Marius Dumitru Florea 56.1 111 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 112
Valdis Vitolins 57.1 113 {{image reference="dw-extensionsStep-computingUpgradePlan.png"/}}
Marius Dumitru Florea 53.1 114
115 After the upgrade plan is computed there are two categories of extensions listed, as you can see in the image below:
116
Marius Dumitru Florea 24.1 117 * invalid: they don't work with the current XWiki version so they must be upgraded
118 * 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
119
Marius Dumitru Florea 56.1 120 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 121
Valdis Vitolins 57.1 122 {{image reference="dw-extensionsStep.png"/}}
Marius Dumitru Florea 49.1 123
124 = Upgrade with Repair =
125
126 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.
127
Valdis Vitolins 57.1 128 {{image reference="dw-uiStep-repair-upgradeQuestion.png"/}}
Marius Dumitru Florea 49.1 129
130 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.
131
Valdis Vitolins 57.1 132 {{image reference="dw-uiStep-repair-selectPreviousVersion.png"/}}
Marius Dumitru Florea 49.1 133
134 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.
135
Valdis Vitolins 57.1 136 {{image reference="dw-uiStep-repair-suggestPreviousId.png"/}}
Marius Dumitru Florea 49.1 137
138 If it's not the right extension id then you should click on the pencil icon to change it.
139
Valdis Vitolins 57.1 140 {{image reference="dw-uiStep-repair-editPreviousId.png"/}}
Marius Dumitru Florea 49.1 141
142 Next you need to repair the previous UI extension. Just click on the Repair button.
143
Valdis Vitolins 57.1 144 {{image reference="dw-uiStep-repair.png"/}}
Marius Dumitru Florea 49.1 145
146 Finally you should be able to upgrade the default set of wiki pages like in a normal upgrade.
147
148 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.
149
Valdis Vitolins 57.1 150 {{image reference="dw-wikisStep-repairPreviousUI.png"/}}
Vincent Massol 50.1 151
Vincent Massol 51.1 152 {{id name="troubleshooting"/}}
Valdis Vitolins 57.1 153
Marius Dumitru Florea 85.1 154 = Replay Install or Upgrade =
155
156 Starting with version 7.1 you can record an install or upgrade and replay it on a different wiki:
157 * 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+).
158 * After you finished with the install/upgrade of the default/recommended UI (XAR), you can install/upgrade additional extensions.
159 * 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
160 * 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.(((
161 {{image reference="dw-welcomeStep-replayRecordedActions.png"/}}
162 )))
163 * 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)(((
164 {{image reference="extensionHistory.png"/}}
165 )))
166 * 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.
167 * The Distribution Wizard should not appear next time you restart XWiki, but if it does, just click continue.
168
Vincent Massol 50.1 169 = Troubleshooting =
170
171 == The wizard fails to appear at startup ==
172
173 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##).
174
Valdis Vitolins 58.1 175 Thus you'll need to remove the ##.../jobs/status/distribution/status.xml## file located inside your permanent directory (##/var/lib/xwiki/...## for [[APT installation>>AdminGuide.InstallationViaAPT]] or ##/var/lib/tomcatX/webapps/...## for [[WAR installation>>AdminGuide.InstallationWAR]]).
Vincent Massol 50.1 176
177 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 178
179 == Setting up new XWiki instance without reinstalling ==
180
Valdis Vitolins 61.2 181 To set up empty/new XWiki instance you need to clear its database and local file storage.
Valdis Vitolins 59.1 182
183 1. (((
Thomas Mortagne 61.1 184 Empty the main database.
185 For example with MySQL server, you can execute the command:
Valdis Vitolins 59.1 186
187 {{code language="none"}}
188 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';"
189 {{/code}}
190
Thomas Mortagne 61.1 191 where ##'password'## is password for xwiki user in MySQL database.
192
193 You should also delete the subwikis databases if any.
Valdis Vitolins 59.1 194 )))
Valdis Vitolins 60.1 195 1. (((
Thomas Mortagne 61.1 196 To clear local data in filesystem empty or remove the permanent directory (see environment.permanentDirectory property in xwiki.properties file).
Valdis Vitolins 59.1 197
Thomas Mortagne 61.1 198 For example if you have installed XWiki using [[APT>>AdminGuide.InstallationViaAPT]], execute command:
199
Valdis Vitolins 59.1 200 {{code language="none"}}
Valdis Vitolins 62.1 201 sudo rm -fr /var/lib/xwiki/data /var/cache/tomcat7/Catalina/localhost/xwiki/
Valdis Vitolins 59.1 202 {{/code}}
Valdis Vitolins 60.1 203 )))
Thomas Mortagne 61.1 204 1. Restart the application server, open e.g. [[http://localhost:8080/xwiki]] and rerun distribution wizard again.
Guillaume Delhumeau 74.1 205
Guillaume Delhumeau 81.1 206 == Disable the automatic start of Distribution Wizard {{info}}(Since 7.1RC1){{/info}} ==
207
Guillaume Delhumeau 74.1 208 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##:
209
210 {{code language="cfg"}}
211 #-------------------------------------------------------------------------------------
212 # Distribution Wizard
213 #-------------------------------------------------------------------------------------
214
215 #-# [Since 7.1RC1] Enable or disable the automatic start of Distribution Wizard on empty/outdated wiki.
216 #-#
217 #-# The default is:
218 # distribution.automaticStartOnMainWiki=true
219 # distribution.automaticStartOnWiki=true
220 {{/code}}
221
222 You just need to uncomment the above two lines and to set the options to ##false##.

Get Connected