UPGRADE 13 KB

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