UPGRADE 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307
  1. This file provides an overview of the MediaWiki upgrade process. For help with
  2. specific problems, check
  3. * the documentation at https://www.mediawiki.org/wiki/Special:MyLanguage/Help:Contents
  4. * the mediawiki-l mailing list archive at
  5. https://lists.wikimedia.org/pipermail/mediawiki-l/
  6. * the bug tracker at https://phabricator.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 https://www.mediawiki.org/wiki/Special:MyLanguage/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. https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Backing_up_a_wiki provides an overview of
  22. the backup 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. (https://releases.wikimedia.org/mediawiki/).
  29. You can also obtain the new files directly from our Git source code
  30. repository.
  31. Replace the existing MediaWiki files with the new. You should preserve the
  32. LocalSettings.php file and the "extensions" and "images" directories.
  33. Depending upon your configuration, you may also need to preserve additional
  34. directories, including a custom upload directory ($wgUploadDirectory),
  35. deleted file archives, and any custom skins.
  36. === Perform the database upgrade ===
  37. As of 1.21, it is possible to separate schema changes (i.e. adding,
  38. dropping, or changing tables, fields, or indices) from all other
  39. database changes (e.g. populating fields). If you need this
  40. capability, see "From the command line" below.
  41. ==== From the web ====
  42. If you browse to the web-based installation script (usually at
  43. /mw-config/index.php) from your wiki installation you can follow the script and
  44. upgrade your database in place.
  45. ==== From the command line ====
  46. From the command line, browse to the "maintenance" directory and run the
  47. update.php script to check and update the schema. This will insert missing
  48. tables, update existing tables, and move data around as needed. In most cases,
  49. this is successful and nothing further needs to be done.
  50. If you need to separate out the schema changes so they can be run
  51. by someone with more privileges, then you can use the --schema option
  52. to produce a text file with the necessary commands. You can use
  53. --schema, --noschema, $wgAllowSchemaUpdates as well as proper database
  54. permissions to enforce this separation.
  55. === Check configuration settings ===
  56. The names of configuration variables, and their default values and purposes,
  57. can change between release branches, e.g. $wgDisableUploads in 1.4 is replaced
  58. with $wgEnableUploads in later versions. When upgrading, consult the release
  59. notes to check for configuration changes which would alter the expected
  60. behavior of MediaWiki.
  61. === Check installed extensions ===
  62. Extensions usually need to be upgraded at the same time as the MediaWiki core.
  63. In MediaWiki 1.14 some extensions were migrated into the core. Please see the
  64. HISTORY section "Migrated extensions" and disable these extensions in your
  65. LocalSettings.php
  66. === Test ===
  67. It makes sense to test your wiki immediately following any kind of maintenance
  68. procedure, and especially after upgrading; check that page views and edits work
  69. normally and that special pages continue to function, etc. and correct errors
  70. and quirks which reveal themselves.
  71. You should also test any extensions, and upgrade these if necessary.
  72. == Upgrading from 1.16 or earlier ==
  73. If you have a Chinese or Japanese wiki ($wgLanguageCode is set to one
  74. of "zh", "ja", or "yue") and you are using MySQL fulltext search, you
  75. will probably want to update the search index.
  76. In the "maintenance" directory, run the updateDoubleWidthSearch.php
  77. script. This will update the searchindex table for those pages that
  78. contain double-byte latin characters.
  79. == Upgrading from 1.10 or earlier ==
  80. If upgrading from before 1.11, and you are using a wiki as a commons
  81. repository, make sure that it is updated as well. Otherwise, errors may arise
  82. due to database schema changes.
  83. == Upgrading from 1.8 or earlier ==
  84. MediaWiki 1.9 and later no longer keep default localized message text
  85. in the database; 'MediaWiki:'-namespace pages that do not exist in the
  86. database are simply transparently filled-in on demand.
  87. The upgrade process will delete any 'MediaWiki:' pages which are left
  88. in the default state (last edited by 'MediaWiki default'). This may
  89. take a few moments, similar to the old initial setup.
  90. Note that the large number of deletions may cause older edits to expire
  91. from the list on Special:Recentchanges, although the deletions themselves
  92. will be hidden by default. (Click "show bot edits" to list them.)
  93. See RELEASE-NOTES for more details about new and changed options.
  94. == Upgrading from 1.7 or earlier ==
  95. $wgDefaultUserOptions now contains all the defaults, not only overrides.
  96. If you're setting this as a complete array(), you may need to change it
  97. to set only specific items as recommended in DefaultSettings.php.
  98. == Upgrading from 1.6 or earlier ==
  99. $wgLocalTZoffset was in hours, it is now using minutes.
  100. If upgrading from before 1.7, you may want to run refreshLinks.php to ensure
  101. new database fields are filled with data.
  102. == Upgrading from 1.5 or earlier ==
  103. Major changes have been made to the schema from 1.4.x. The updater
  104. has not been fully tested for all conditions, and might well break.
  105. On a large site, the schema update might take a long time. It might
  106. explode, or leave your database half-done or otherwise badly hurting.
  107. Among other changes, note that Latin-1 encoding (ISO-8859-1) is
  108. no longer supported. Latin-1 wikis will need to be upgraded to
  109. UTF-8; an experimental command-line upgrade helper script,
  110. 'upgrade1_5.php', can do this -- run it prior to 'update.php' or
  111. the web upgrader.
  112. NOTE that upgrade1_5.php does not work properly with recent versions
  113. of MediaWiki. If upgrading a 1.4.x wiki, you should upgrade to 1.5
  114. first. upgrade1_5.php has been removed from MediaWiki 1.21.
  115. If you absolutely cannot make the UTF-8 upgrade work, you can try
  116. doing it by hand: dump your old database, convert the dump file
  117. using iconv as described here:
  118. http://portal.suse.com/sdb/en/2004/05/jbartsh_utf-8.html
  119. and then reimport it. You can also convert filenames using convmv,
  120. but note that the old directory hashes will no longer be valid,
  121. so you will also have to move them to new destinations.
  122. Message changes:
  123. * A number of additional UI messages have been changed from HTML to
  124. wikitext, and will need to be manually fixed if customized.
  125. === Configuration changes from 1.4.x: ===
  126. $wgDisableUploads has been replaced with $wgEnableUploads.
  127. $wgWhitelistAccount has been replaced by the 'createaccount' permission
  128. key in $wgGroupPermissions. To emulate the old effect of setting:
  129. $wgWhitelistAccount['user'] = 0;
  130. set:
  131. $wgGroupPermissions['*']['createaccount'] = false;
  132. $wgWhitelistEdit has been replaced by the 'edit' permission key.
  133. To emulate the old effect of setting:
  134. $wgWhitelistEdit = true;
  135. set:
  136. $wgGroupPermissions['*']['edit'] = false;
  137. If $wgWhitelistRead is set, you must also disable the 'read' permission
  138. for it to take affect on anonymous users:
  139. $wgWhitelistRead = array( "Main Page", "Special:Userlogin" );
  140. $wgGroupPermissions['*']['read'] = false;
  141. Note that you can disable/enable several other permissions by modifying
  142. this configuration array in your LocalSettings.php; see DefaultSettings.php
  143. for the complete default permission set.
  144. If using Memcached, you must enabled it differently now:
  145. $wgUseMemCached = true;
  146. should be replaced with:
  147. $wgMainCacheType = CACHE_MEMCACHED;
  148. == Upgrading from 1.4.2 or earlier ==
  149. 1.4.3 has added new fields to the sitestats table. These fields are
  150. optional and help to speed Special:Statistics on large sites. If you
  151. choose not to run the database upgrades, everything will continue to
  152. work in 1.4.3.
  153. You can apply the update by running maintenance/update.php, or
  154. manually run the SQL commands from this file:
  155. maintenance/archives/patch-ss_total_articles.sql
  156. == Upgrading from 1.4rc1 or earlier betas ==
  157. The logging table has been altered from 1.4beta4 to 1.4beta5
  158. and again in 1.4.0 final. Copy in the new files and use the web
  159. installer to upgrade, or the command-line maintenance/update.php.
  160. If you cannot use the automated installers/updaters, you may
  161. update the table by manually running the SQL commands in these
  162. files:
  163. maintenance/archives/patch-log_params.sql
  164. maintenance/archives/patch-logging-title.sql
  165. == Upgrading from 1.3 or earlier ==
  166. This should generally go smoothly.
  167. If you keep your LocalSettings.php, you may need to change the style paths
  168. to match the newly rearranged skin modules. Change these lines:
  169. $wgStylePath = "$wgScriptPath/stylesheets";
  170. $wgStyleDirectory = "$IP/stylesheets";
  171. $wgLogo = "$wgStylePath/images/wiki.png";
  172. to this:
  173. $wgStylePath = "$wgScriptPath/skins";
  174. $wgStyleDirectory = "$IP/skins";
  175. $wgLogo = "$wgStylePath/common/images/wiki.png";
  176. As well as new messages, the processing of some messages has changed.
  177. If you have customized them, please compare the new format using
  178. Special:Allmessages or the relevant LanguageXX.php files:
  179. * copyrightwarning
  180. * dberrortext
  181. * editingcomment (was named commentedit)
  182. * editingsection (was named sectionedit)
  183. * numauthors
  184. * numedits
  185. * numtalkauthors
  186. * numtalkedits
  187. * numwatchers
  188. * protectedarticle
  189. * searchresulttext
  190. * showhideminor
  191. * unprotectedarticle
  192. Note that the 1.3 beta releases included a potential vulnerability if PHP
  193. is configured with register_globals on and the includes directory is
  194. served to the web. For general safety, turn register_globals *off* if you
  195. don't _really_ need it for another package.
  196. If your hosting provider turns it on and you can't turn it off yourself,
  197. send them a kind note explaining that it can expose their servers and their
  198. customers to attacks.
  199. == Upgrading from 1.2 or earlier ==
  200. If you've been using the MediaWiki: namespace for custom page templates,
  201. note that things are a little different. The Template: namespace has been
  202. added which is more powerful -- templates can include parameters for
  203. instance.
  204. If you were using custom MediaWiki: entries for text inclusions, they
  205. will *not* automatically be moved to Template: entries at upgrade time.
  206. Be sure to go through and check that everything is working properly;
  207. you can move them manually or you can try using moveCustomMessages.php
  208. in maintenance/archives to do it automatically, but this might break things.
  209. Also, be sure to pick the correct character encoding -- some languages were
  210. only available in Latin-1 on 1.2.x and are now available for Unicode as well.
  211. If you want to upgrade an existing wiki from Latin-1 to Unicode you'll have
  212. to dump the database to SQL, run it through iconv or another conversion tool,
  213. and restore it. Sorry.
  214. == Upgrading from 1.1 or earlier ==
  215. This is less thoroughly tested, but should work.
  216. You need to specify the *admin* database username and password to the
  217. installer in order for it to successfully upgrade the database structure.
  218. You may wish to manually change the GRANTs later.
  219. If you have a very old database (earlier than organized MediaWiki releases
  220. in late August 2003) you may need to manually run some of the update SQL
  221. scripts in maintenance/archives before the installer is able to pick up
  222. with remaining updates.