Make escapenoentities work again, broken by r68801
[lhc/web/wiklou.git] / UPGRADE
1 This file provides an overview of the MediaWiki upgrade process. For help with
2 specific problems, check
3
4 * the documentation at http://www.mediawiki.org
5 * the mediawiki-l mailing list archive at
6 http://lists.wikimedia.org/pipermail/mediawiki-l/
7 * the bug tracker at https://bugzilla.wikimedia.org
8
9 for information and workarounds to common issues.
10
11 == Overview ==
12
13 Comprehensive documentation on upgrading to the latest version of the software
14 is available at http://www.mediawiki.org/wiki/Manual:Upgrading.
15
16 === Consult the release notes ===
17
18 Before doing anything, stop and consult the release notes supplied with the new
19 version of the software. These detail bug fixes, new features and functionality,
20 and any particular points that may need to be noted during the upgrade
21 procedure.
22
23 === Backup first ===
24
25 It is imperative that, prior to attempting an upgrade of the database schema,
26 you take a complete backup of your wiki database and files and verify it. While
27 the upgrade scripts are somewhat robust, there is no guarantee that things will
28 not fail, leaving the database in an inconsistent state.
29
30 http://www.mediawiki.org/wiki/Manual:Backing_up_a_wiki provides an overview of
31 the upgrade process. You should also refer to the documentation for your
32 database management system for information on backing up a database, and to
33 your operating system documentation for information on making copies of files.
34
35 === Perform the file upgrade ===
36
37 Download the files for the new version of the software. These are available
38 as a compressed "tar" archive from the Wikimedia Download Service
39 (http://download.wikimedia.org/mediawiki).
40
41 You can also obtain the new files directly from our Subversion source code
42 repository, via a checkout or export operation.
43
44 Replace the existing MediaWiki files with the new. You should preserve the
45 LocalSettings.php file and the "extensions" and "images" directories.
46
47 Depending upon your configuration, you may also need to preserve additional
48 directories, including a custom upload directory ($wgUploadDirectory),
49 deleted file archives, and any custom skins.
50
51 === Perform the database upgrade ===
52
53 You will need to have $wgDBadminuser and $wgDBadminpassword set in your
54 LocalSettings.php, see there for more info.
55
56 From the command line, browse to the "maintenance" directory and run the
57 update.php script to check and update the schema. This will insert missing
58 tables, update existing tables, and move data around as needed. In most cases,
59 this is successful and nothing further needs to be done.
60
61 If you have a Chinese or Japanese wiki ($wgLanguageCode is set to one
62 of "zh", "ja", or "yue") and you are using MySQL fulltext search, you
63 will probably want to update the search index.
64
65 In the "maintenance" directory, run the updateDoubleWidthSearch.php
66 script. This will update the searchindex table for those pages that
67 contain double-byte latin characters.
68
69 === Check configuration settings ===
70
71 The names of configuration variables, and their default values and purposes,
72 can change between release branches, e.g. $wgDisableUploads in 1.4 is replaced
73 with $wgEnableUploads in later versions. When upgrading, consult the release
74 notes to check for configuration changes which would alter the expected
75 behaviour of MediaWiki.
76
77 === Check installed extensions ===
78
79 In MediaWiki 1.14 some extensions are migrated into the core. Please see the
80 HISTORY section "Migrated extensions" and disable these extensions in your
81 LocalSettings.php
82
83 === Test ===
84
85 It makes sense to test your wiki immediately following any kind of maintenance
86 procedure, and especially after upgrading; check that page views and edits work
87 normally and that special pages continue to function, etc. and correct errors
88 and quirks which reveal themselves.
89
90 You should also test any extensions, and upgrade these if necessary.
91
92 == Upgrading from 1.8 wikis ==
93
94 MediaWiki 1.9 and later no longer keep default localized message text
95 in the database; 'MediaWiki:'-namespace pages that do not exist in the
96 database are simply transparently filled-in on demand.
97
98 The upgrade process will delete any 'MediaWiki:' pages which are left
99 in the default state (last edited by 'MediaWiki default'). This may
100 take a few moments, similar to the old initial setup.
101
102 Note that the large number of deletions may cause older edits to expire
103 from the list on Special:Recentchanges, although the deletions themselves
104 will be hidden by default. (Click "show bot edits" to list them.)
105
106
107 See RELEASE-NOTES for more details about new and changed options.
108
109
110 == Upgrading from 1.7 wikis ==
111
112 $wgDefaultUserOptions now contains all the defaults, not only overrides.
113 If you're setting this as a complete array(), you may need to change it
114 to set only specific items as recommended in DefaultSettings.php.
115
116 == Upgrading from 1.6 wikis ==
117
118 $wgLocalTZoffset was in hours, it is now using minutes.
119 Link autonumbering got fixed (#5918) for protocols other than http.
120 - 'irc://irc.server.tld/' render as a link with a chat icon
121 - '[irc://irc.server.tld]' render as an autonumbered link: [1]
122
123 == Upgrading from pre-1.5 wikis ==
124
125 Major changes have been made to the schema from 1.4.x. The updater
126 has not been fully tested for all conditions, and might well break.
127
128 On a large site, the schema update might take a long time. It might
129 explode, or leave your database half-done or otherwise badly hurting.
130
131 Among other changes, note that Latin-1 encoding (ISO-8859-1) is
132 no longer supported. Latin-1 wikis will need to be upgraded to
133 UTF-8; an experimental command-line upgrade helper script,
134 'upgrade1_5.php', can do this -- run it prior to 'update.php' or
135 the web upgrader.
136
137 If you absolutely cannot make the UTF-8 upgrade work, you can try
138 doing it by hand: dump your old database, convert the dump file
139 using iconv as described here:
140 http://portal.suse.com/sdb/en/2004/05/jbartsh_utf-8.html
141 and then reimport it. You can also convert filenames using convmv,
142 but note that the old directory hashes will no longer be valid,
143 so you will also have to move them to new destinations.
144
145 Message changes:
146 * A number of additional UI messages have been changed from HTML to
147 wikitext, and will need to be manually fixed if customized.
148
149 === Configuration changes from 1.4.x: ===
150
151 $wgDisableUploads has been replaced with $wgEnableUploads.
152
153 $wgWhitelistAccount has been replaced by the 'createaccount' permission
154 key in $wgGroupPermissions. To emulate the old effect of setting:
155 $wgWhitelistAccount['user'] = 0;
156 set:
157 $wgGroupPermissions['*']['createaccount'] = false;
158
159 $wgWhitelistEdit has been replaced by the 'edit' permission key.
160 To emulate the old effect of setting:
161 $wgWhitelistEdit = true;
162 set:
163 $wgGroupPermissions['*']['edit'] = false;
164
165 If $wgWhitelistRead is set, you must also disable the 'read' permission
166 for it to take affect on anonymous users:
167 $wgWhitelistRead = array( "Main Page", "Special:Userlogin" );
168 $wgGroupPermissions['*']['read'] = false;
169
170 Note that you can disable/enable several other permissions by modifying
171 this configuration array in your LocalSettings.php; see DefaultSettings.php
172 for the complete default permission set.
173
174 If using Memcached, you must enabled it differently now:
175 $wgUseMemCached = true;
176 should be replaced with:
177 $wgMainCacheType = CACHE_MEMCACHED;
178
179
180 === Web installer ===
181
182 You can use the web-based installer wizard if you first remove the
183 LocalSettings.php file; be sure to give the installer the same
184 information as you did on the original install (language/encoding,
185 database name, password, etc). This will also generate a fresh
186 LocalSettings.php, which you may need to customize.
187
188 You may change some settings during the install, but be very careful!
189 Changing the encoding in particular will generally leave you with a
190 lot of corrupt pages, particularly if your wiki is not in English.
191
192 === Command-line upgrade ===
193
194 Additionally, as of 1.4.0 you can run an in-place upgrade script from
195 the command line, keeping your existing LocalSettings.php. This requires
196 that you set $wgDBadminuser and $wgDBadminpassword with an appropriate
197 database user and password with privileges to modify the database structure.
198
199 Once the new files are in place, go into the maintenance subdirectory and
200 run the script:
201
202 php update.php
203
204 See caveats below on upgrading from 1.3.x or earlier.
205
206
207 == Backups! ==
208
209 To upgrade an existing MediaWiki installation, first BACK UP YOUR WIKI!
210 If something goes wrong, you want to be able to start again.
211
212 Your image files, configuration, etc can simply be copied or archived as
213 you would any other files. (Make sure that the contents of your
214 LocalSettings.php are not accidentally made public, as this contains
215 a database password.)
216
217 To back up the database, use the tools provided by your service provider
218 (if applicable) or the standard mysqldump or pg_dump programs.
219
220 For general help on mysqldump:
221 http://dev.mysql.com/doc/mysql/en/mysqldump.html
222
223 WARNING: If using MySQL 4.1.x, mysqldump's charset conversion may in
224 some cases damage data in your wiki. If necessary, set the charset
225 option to 'latin1' to avoid the conversion.
226
227 For general help on pg_dump:
228 http://www.postgresql.org/docs/current/static/app-pgdump.html
229
230
231 == Caveats ==
232
233 === Postgres ===
234
235 Postgres support is new, and much of the upgrade instructions may
236 not apply. The schema was changed significantly from 1.7 to 1.8,
237 so you will need to at least use the update.php or web installer,
238 as described above.
239
240
241 === Upgrading from 1.4.2 or earlier ===
242
243 1.4.3 has added new fields to the sitestats table. These fields are
244 optional and help to speed Special:Statistics on large sites. If you
245 choose not to run the database upgrades, everything will continue to
246 work in 1.4.3.
247
248 You can apply the update by running maintenance/update.php, or
249 manually run the SQL commands from this file:
250 maintenance/archives/patch-ss_total_articles.sql
251
252
253 === Upgrading from 1.4rc1 or earlier betas ===
254
255 The logging table has been altered from 1.4beta4 to 1.4beta5
256 and again in 1.4.0 final. Copy in the new files and use the web
257 installer to upgrade, or the command-line maintenance/update.php.
258
259 If you cannot use the automated installers/updaters, you may
260 update the table by manually running the SQL commands in these
261 files:
262 maintenance/archives/patch-log_params.sql
263 maintenance/archives/patch-logging-title.sql
264
265
266 === Upgrading from 1.3.x ===
267
268 This should generally go smoothly.
269
270 If you keep your LocalSettings.php, you may need to change the style paths
271 to match the newly rearranged skin modules. Change these lines:
272 $wgStylePath = "$wgScriptPath/stylesheets";
273 $wgStyleDirectory = "$IP/stylesheets";
274 $wgLogo = "$wgStylePath/images/wiki.png";
275
276 to this:
277 $wgStylePath = "$wgScriptPath/skins";
278 $wgStyleDirectory = "$IP/skins";
279 $wgLogo = "$wgStylePath/common/images/wiki.png";
280
281 As well as new messages, the processing of some messages has changed.
282 If you have customized them, please compare the new format using
283 Special:Allmessages or the relevant LanguageXX.php files:
284 copyrightwarning
285 dberrortext
286 editingcomment (was named commentedit)
287 editingsection (was named sectionedit)
288 numauthors
289 numedits
290 numtalkauthors
291 numtalkedits
292 numwatchers
293 protectedarticle
294 searchresulttext
295 showhideminor
296 unprotectedarticle
297
298 Note that the 1.3 beta releases included a potential vulnerability if PHP
299 is configured with register_globals on and the includes directory is
300 served to the web. For general safety, turn register_globals *off* if you
301 don't _really_ need it for another package.
302
303 If your hosting provider turns it on and you can't turn it off yourself,
304 send them a kind note explaining that it can expose their servers and their
305 customers to attacks.
306
307
308 === Upgrading from 1.2.x ===
309
310 If you've been using the MediaWiki: namespace for custom page templates,
311 note that things are a little different. The Template: namespace has been
312 added which is more powerful -- templates can include parameters for
313 instance.
314
315 If you were using custom MediaWiki: entries for text inclusions, they
316 will *not* automatically be moved to Template: entries at upgrade time.
317 Be sure to go through and check that everything is working properly;
318 you can move them manually or you can try using moveCustomMessages.php
319 in maintenance/archives to do it automatically, but this might break things.
320
321 Also, be sure to pick the correct character encoding -- some languages were
322 only available in Latin-1 on 1.2.x and are now available for Unicode as well.
323 If you want to upgrade an existing wiki from Latin-1 to Unicode you'll have
324 to dump the database to SQL, run it through iconv or another conversion tool,
325 and restore it. Sorry.
326
327
328 === Upgrading from 1.1.x or earlier ===
329
330 This is less thoroughly tested, but should work.
331
332 You need to specify the *admin* database username and password to the
333 installer in order for it to successfully upgrade the database structure.
334 You may wish to manually change the GRANTs later.
335
336 If you have a very old database (earlier than organized MediaWiki releases
337 in late August 2003) you may need to manually run some of the update SQL
338 scripts in maintenance/archives before the installer is able to pick up
339 with remaining updates.
340
341
342 === Upgrading from UseModWiki or old "phase 2" Wikipedia code ===
343
344 There is a semi-maintained UseModWiki to MediaWiki conversion script at
345 maintenance/importUseModWiki.php; it may require tweaking and customization
346 to work for you.
347
348 Install a new MediaWiki first, then use the conversion script which will
349 output SQL statements; direct these to a file and then run that into your
350 database.
351
352 You will have to rebuild the links tables etc after importing.