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