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