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