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