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