Wiki source code of Draft

Last modified by Manuel Leduc on 2023/10/12 11:02

Show last authors
1 {{warning}}
2 Version went [[live>>xwiki:Documentation.AdminGuide.Upgrade]] on 12.10.2018
3 {{/warning}}
4
5 {{box cssClass="floatinginfobox" title="**Contents**"}}
6 {{toc/}}
7 {{/box}}
8
9 (% class="label label-default" %)Note 1(%%) XWiki provides migration paths to upgrade from any older version to any newer one. You don't need to upgrade to intermediary versions.
10
11 (% class="label label-default" %)Note 2(%%) It's also good to check the [[Release Notes>>xwiki:ReleaseNotes.WebHome]] for the versions between your old version and the new version you're upgrading to. You should pay an extra care about the section in the release notes entitled ##"Issues specific to XWiki <version>"##.
12
13 (% class="label label-primary" %)Backup(%%) Before you proceed, be sure to [[backup>>xwiki:Documentation.AdminGuide.Backup]] all of your data, just in case something goes wrong with the update / downgrade. Depending on your usage, you should be backing up your information regularly.
14
15 = Upgrading =
16
17 Keep your XWiki instance up to date to benefit from the best new features and keep your data safe from security threats. There are multiple methods to upgrade XWiki depending on how many data you need to migrate or how experienced you are with different tools.
18
19 In the majority of cases an upgrade consists of two parts:
20
21 * Part 1: Upgrading the //distribution// on the //server / filesystem// and
22 * Part 2: Upgrading the //flavor (wiki pages)// from a //browser//.
23
24 ----
25
26 == (% class="label label-primary" %)Part 1(%%) Upgrading the distribution ==
27
28 === (% class="label label-default" %)Method 1.A(%%) Upgrading from the Debian package (% class="badge fill-gray pull-right" %).DEB(%%) ===
29
30 * (((
31 Update packages index:
32
33 {{code language="bash"}}
34 sudo apt-get update
35 {{/code}}
36 )))
37
38 * (((
39 Package upgrade:
40
41 {{code language="bash"}}
42 sudo apt-get upgrade
43 {{/code}}
44
45 This will upgrade all packages, not just XWiki. If you want to avoid all the other packages and only update XWiki, you can use {{code}}sudo apt-get install xwiki-tomcat8-mysql{{/code}} (change xwiki-tomcat8-mysql for the top level package you installed if you installed something else).
46
47 {{warning}}
48 When upgrading from pre 9.5 version {{code}}apt-get upgrade{{/code}} won't find anything because the package name changed ([[XWiki Enterprise does not exist anymore>>xwiki:Blog.XWiki Enterprise is dead, long live XWiki!]]).
49
50 All you have to do in this case is install the ##xwiki-tomcat*## package corresponding to the top level ##xwiki-enterprise-tomcat*## one you installed previously. For example if you had ##xwiki-enterprise-tomcat8-mysql## 9.4 you should do {{code}}sudo apt-get install xwiki-tomcat8-mysql{{/code}}.
51 {{/warning}}
52 )))
53
54 * (((
55 Pages upgrade:
56
57 However after upgrading you still need to install the new UI; see next step [[Upgrading the flavor>>.||anchor="HPart2Upgradingtheflavor"]] below.
58 )))
59
60 === (% class="label label-default" %)Method 1.B(%%) Upgrading from Docker (% class="badge fill-gray pull-right" %).Docker(%%) ===
61
62 * If you've installed XWiki by using the official XWiki Docker image, [[follow the instructions there>>https://hub.docker.com/_/xwiki/]] for upgrading it.
63
64 === (% class="label label-default" %)Method 1.C(%%) Upgrading the webapp (% class="badge fill-gray pull-right" %).WAR(%%) ===
65
66 * The general strategy is to [[download the new WAR distribution>>xwiki:Main.Download]] and to replace your current installed WAR with it. However make sure you don't copy on top since this could leave some old files around which would make XWiki fail (like if old JARs are lying around in ##WEB-INF/lib##). In addition you would override some XWiki configuration files located in ##WEB-INF## (##xwiki.properties## and ##xwiki.cfg## to name just two).
67
68 * Thus, before replacing your current WAR, make sure you [[back it up, including configuration and data files>>xwiki:Documentation.AdminGuide.Backup]].
69
70 * (((
71 Also you need to ensure that you use the same XWiki Permanent directory (configured in ##WEB-INF/xwiki.properties## using the ##environment.permanentDirectory## property). {{warning}}Best is to not copy the ##solr/## subdirectory since the SOLR schema could have changed and it's best to let XWiki reindex using the new schema{{/warning}}
72 )))
73
74 * Some additional operations may be required for upgrading and you must check the [[release notes>>xwiki:ReleaseNotes.WebHome]] for all the versions from the version you're upgrading from up to the new version you're installing. It's also possible that new features are available and that some configuration files need to be modified. If this is the case then it'll be specified in the release notes.
75
76 * {{include reference="xwiki:Documentation.AdminGuide.UpgradeDatabase"/}}
77
78 * (((
79 **Invalid Extensions**
80
81 Also note that when you upgrade, some extensions that were previously valid may become invalid (for example they may have been renamed, removed or have versions that do not match the version of the WAR you've installed as is the case with the example below). In this case you'll see in the console messages such as:
82
83 {{code language="noformat"}}
84 2013-12-02 11:43:01,688 [localhost-startStop-1] WARN ltInstalledExtensionRepository - Invalid extension [org.xwiki.enterprise:xwiki-enterprise-ui-common-5.2.1] on namespace [wiki:xwiki]
85 2013-12-02 11:43:01,688 [localhost-startStop-1] WARN ltInstalledExtensionRepository - Invalid extension [org.xwiki.platform:xwiki-platform-workspace-ui-5.2.1] on namespace [wiki:xwiki]
86 2013-12-02 11:43:01,688 [localhost-startStop-1] WARN ltInstalledExtensionRepository - Invalid extension [org.xwiki.enterprise:xwiki-enterprise-ui-mainwiki-5.2.1] on namespace [wiki:xwiki]
87 2013-12-02 11:43:01,689 [localhost-startStop-1] WARN ltInstalledExtensionRepository - Invalid extension [org.xwiki.enterprise:xwiki-enterprise-ui-wiki-all-5.2.1] on namespace [wiki:workspacetemplate]
88 {{/code}}
89
90 These are just warnings and don't affect that stability of your instance. Actually the Distribution Wizard you get (see the next section on "Upgrading wiki documents") will ask you to upgrade those invalid extensions and will remove the old versions that became invalid.
91 )))
92
93 * After upgrading you still need to install the new UI; see next step [[Upgrading the flavor>>.||anchor="HPart2Upgradingtheflavor"]] below.
94
95 === (% class="label label-default" %)Method 1.D(%%) Upgrading the demo package (% class="badge fill-gray pull-right" %).ZIP(%%) ===
96
97 * If you've installed the standard distribution (##zip## or ##jar## distribution) and you wish to upgrade it, the simplest is to [[download>>xwiki:Main.Download]] the new version and install it as you did the first time. Just make sure you don't install the new version over the old one (both installations need to exist).
98
99 * Then copy [[the configuration files and the permanent directory>>xwiki:Documentation.AdminGuide.Backup]] from the old installation to the new one ({{warning}}Best is to not copy the ##solr/## subdirectory since the SOLR schema could have changed and it's best to let XWiki reindex using the new schema{{/warning}}). Ideally you should not copy over the configuration files exactly since the new version could have added new configuration options and thus ideally you should do a merge instead of a pure copy. Another strategy is to use the new configuration files, not copy over the old configuration files and instead manually edit the new configuration to make the same changes as you have may done before (If you've never touched the configuration files then there's nothing to do obviously!).
100
101 * (((
102 If you're on a unix system here are some commands that may help you doing the merge instead of doing it fully manually:
103
104 {{code language="none"}}
105 ## Note: We're assuming that "xwiki.new" is a symbolic link that points to the location
106 ## where the new xwiki version is located and that "xwiki" is the location of the previous
107 ## xwiki installation.
108 mv xwiki.new/WEB-INF/web.xml xwiki.new/WEB-INF/web.xml.ori; sudo sdiff xwiki/WEB-INF/web.xml xwiki.new/WEB-INF/web.xml.ori -B -W -E -o xwiki.new/WEB-INF/web.xml
109 mv xwiki.new/WEB-INF/xwiki.cfg xwiki.new/WEB-INF/xwiki.cfg.ori; sudo sdiff xwiki/WEB-INF/xwiki.cfg xwiki.new/WEB-INF/xwiki.cfg.ori -B -W -E -o xwiki.new/WEB-INF/xwiki.cfg
110 mv xwiki.new/WEB-INF/xwiki.properties xwiki.new/WEB-INF/xwiki.properties.ori; sudo sdiff xwiki/WEB-INF/xwiki.properties xwiki.new/WEB-INF/xwiki.properties.ori -B -W -E -o xwiki.new/WEB-INF/xwiki.properties
111 mv xwiki.new/WEB-INF/struts-config.xml xwiki.new/WEB-INF/struts-config.xml.ori; sudo sdiff xwiki/WEB-INF/struts-config.xml xwiki.new/WEB-INF/struts-config.xml.ori -B -W -E -o xwiki.new/WEB-INF/struts-config.xml
112 mv xwiki.new/WEB-INF/classes/logback.xml xwiki.new/WEB-INF/classes/logback.xml.ori; sudo sdiff xwiki/WEB-INF/classes/logback.xml xwiki.new/WEB-INF/classes/logback.xml.ori -B -W -E -o xwiki.new/WEB-INF/classes/logback.xml
113 {{/code}}
114 )))
115
116 * {{include reference="xwiki:Documentation.AdminGuide.UpgradeDatabase"/}}
117
118 * After upgrading you still need to install the new UI; see next step [[Upgrading the flavor>>.||anchor="HPart2Upgradingtheflavor"]] below.
119
120 ----
121
122 == (% class="label label-primary" %)Part 2(%%) Upgrading the flavor ==
123
124 === (% class="label label-default" %)Method 2.A(%%) Using Distribution Wizard ===
125
126 (% class="label label-success" %)Recommended(%%) The recommended way to upgrade an XWiki installation is to use the [[Distribution Wizard>>xwiki:Documentation.UserGuide.Features.DistributionWizard]] which is automatically triggered after you upgrade the XWiki WAR. It allows you to automatically upgrade extensions installed in your wiki, supporting automatic merges and conflict resolution.
127
128 {{warning}}
129 Make sure you run the Distribution Wizard (DW) with a user having Programming Rights. The following pages require being saved by a user having Programming Rights to work correctly and they may happen to have been modified and thus the DW may need to modify them:
130
131 * ##AppWithinMinutes.DynamicMessageTool## (kept for backward-compatibility, not used)
132 * ##AnnotationCode.Style##
133 * ##AppWithinMinutes.LiveTableEditSheet##
134 * ##AppWithinMinutes.ClassEditSheet##
135 * ##Main.Activity##
136 * ##AnnotationCode.Script##
137 * ##XWiki.OfficeImporterAdmin##
138 * ##Filter.WebHome##
139 * ##XWiki.DeletedAttachments## (Fixed in XWiki 9.8RC1)
140 * ##XWiki.DeletedDocuments## (Fixed in XWiki 9.8RC1)
141 * ##WikiManager.Translations##
142
143 If you have already done the upgrade with a user not having Programming Rights, then log in with a user having those permissions (or ask someone who has them), [[navigate to those pages>>xwiki:FAQ.How can I navigate to a given page]], edit them (using the wiki editor preferably) and save them without any modification.
144 {{/warning}}
145
146 === (% class="label label-default" %)Method 2.B(%%) Using Manual Import ===
147
148 (% class="label label-warning" %)Old versions < 4.3(%%) Prior to XWiki 4.3, Distribution Wizard didn't existed and you had to perform the upgrade manually as explained below.
149
150 As mentioned in the [[Installing the Default Wiki XAR section>>xwiki:Documentation.AdminGuide.InstallationWAR||acnhor="HInstallingtheDefaultWikiXAR"]] you should be very careful and when doing the import make sure you selectively decide what pages you wish to import. More specifically the following pages should be imported with great care:
151
152 * XWiki.XWikiPreferences: This page contains some configuration of your wiki (it overrides the configuration defined in ##xwiki.cfg##). If you import a new version of this page you'll lose any customization you may have made such as the skin to use, the rights for your wiki, etc.
153 * XWiki.WebPreferences, Main.WebPreferences, and all other spaces WebPreferences pages: Same as XWiki.XWikiPreferences but at the level of a space
154 * XWiki.XWikiAllGroup (list of registered users) and XWiki.AdminGroup (list of Admins): If you have existing users and import a new version of these pages, you'll find that your users do not belong to these groups anymore and thus may not be able to edit pages, log in, etc. You'll need to add them again to the right groups
155 * XWiki.Admin: This page contains the Admin user with the default password. If you import it you'll create a security hole. Thus it's very important not to import this page
156 * *.*Config: These are configuration pages and thus must not be overwritten. Some examples:
157 ** XWiki.RegistrationConfig: Contains Registration configuration of your wiki
158 ** Invitation.InvitationConfig: Configuration for the [[Invitation Application>>extensions:Extension.Invitation Application]]
159 * XWiki.XWikiServerXwiki (multi wiki): This page contains the server descriptors and wiki properties
160 * Any other page you have modified, such as Main.WebHome, a modified Panel, etc.
161
162 ----
163
164 == (% class="label label-default" %)Alternative(%%) Start fresh, plus Export and Reimport your data ==
165
166 There are cases when it's a better solution to [[export your current content as a XAR>>xwiki:Documentation.AdminGuide.ImportExport]] and [[reimport it>>xwiki:Documentation.AdminGuide.ImportExport]] into [[a new instance>>xwiki:Documentation.AdminGuide.Installation]]. For example this would be a good method if you have a very old version of XWiki and wish to move to a new version. You should use this method when you know exactly what content you have created and you manually check to not forget anything on the old instance.
167
168 Some tips:
169
170 * This method should work because the XWiki project takes great pride in being careful about backward compatibility and content created several years ago should still work well in new versions of XWiki. There are some configurations you need to change in case you have content written in the old [[XWiki Syntax 1.0>>extensions:Extension.Old XWiki 1\.0 syntax renderer]].
171 * Make sure to only import your own content pages and not the default XWiki pages since you’d overwrite the ones provided in new XWiki install.
172 * You may get issues when trying to export a large XAR. In that case you may want to try installing [[one of the Export Extensions>>extensions:Main.Tags||queryString="do=viewTag&tag=export"]] but you'll need to verify that the one you install will work on your old version of XWiki.
173
174 ----
175
176 = Downgrading =
177
178 {{warning}}
179 You should try to upgrade to a version that fixes the issue you're facing instead of downgrading. However if you really need to downgrade, read on...
180 {{/warning}}
181
182 A previous upgrade may have modified the database schema and the data saved in the permanent directory may also have incompatible changes. Thus the best strategy for downgrading is using the [[Alternative Method>>.||anchor="HAlternativeStartfresh2CplusExportandReimportyourdata"]], and that consists of [[exporting your wiki pages as XAR>>xwiki:Documentation.AdminGuide.Backup||anchor="HUsingtheXWikiExportfeature"]] (the ones having your content, not the default wiki pages provided by the XWiki distribution or installed Extensions). Then install the older XWiki version and re-install optional Extensions that you need. Then reimport your XAR in it.

Get Connected