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