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