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