Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Numinix MediaWiki Demo
Search
Search
Appearance
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
Manual/Upgrading
(section)
Page
Discussion
English
Read
Edit
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
View history
General
What links here
Related changes
Special pages
Page information
Appearance
move to sidebar
hide
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== Run the update script == <!--T:81--> </translate> <!-- NOTE TO EDITORS: As of r72451 <https://www.mediawiki.org/wiki/rev:72451>, this section name is linked from an error message hard-coded into MediaWiki, so if you change the section name, add <span id="Run_the_update_script"></span> or something so that the links still work. --> <translate> <!--T:82--> You can upgrade the MediaWiki database in two ways: Either from the command line or from the web browser. If you have shell access to your server, upgrading from the command line is recommended, since this reduces the risk of the upgrade process being interrupted by a timeout or connection reset. <!--T:83--> The script will also notify you if any of MediaWiki core's PHP dependencies are out of date. === Command line === <!--T:84--> </translate> <translate><!--T:594--> Access the command line of your server or an SSH shell or similar. You can access the command line by connecting to your server via SSH.</translate> <translate><!--T:600--> Current versions of all major operating systems (including Windows 10 and 11) contain a command-line [[w:OpenSSH|OpenSSH]] client either by default or as an installable feature.</translate> <translate><!--T:601--> If the local PC you are working on runs Microsoft Windows, you may want to (or, if it's 8.1 or older, have to) install <tvar name=putty>[https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html PuTTY]</tvar>, which features a wizard-like interface (or a similar tool).</translate> <translate><!--T:602--> From the command line or the Shell, execute the [[<tvar name=script>Special:MyLanguage/Manual:update.php</tvar>|update script]]:</translate> $ php maintenance/run.php update $ php maintenance/update.php <translate><!--T:86--> On a Linux server if you get an error, try performing the same command as root (by using the <tvar name=1><kbd>sudo</kbd></tvar> command).</translate> <translate><!--T:214--> Note for simple installations on Windows (e.g. with <tvar name=xampp></tvar>):</translate> <translate><!--T:215--> First make sure that your web server (such as Apache) and your database (such as MySQL) are running.</translate> <translate><!--T:216--> Then run <tvar name=1><code>update.php</code></tvar>: right-click it, select Open With, and browse to <tvar name=2>PHP.exe</tvar>.</translate> <translate><!--T:217--> The resulting command prompt window will likely autoclose when the schema upgrade completes.</translate> <translate> <!--T:88--> MediaWiki will inspect the existing schema and update it to work with the new code, adding tables and columns as needed.</translate> {{Note|1=<translate><!--T:150--> If you use a [[<tvar name=shared-db>Special:MyLanguage/Manual:Shared database</tvar>|Shared database]], you should pass the <tvar name=doshared><code>--doshared</code></tvar> parameter if you want the shared tables to be updated. Otherwise, they won't be touched by the update script.</translate>}} <translate> ==== What to do if it says "MediaWiki requires PHP x.y.z or higher; you are using PHP x.w.v" ==== <!--T:606--> <!--T:607--> See {{<tvar name=1>ll|Manual:Common errors and symptoms#MediaWiki requires PHP 7.4.3 or higher; you are using PHP 7.3.17</tvar>|Manual:Common errors and symptoms#MediaWiki requires PHP 7.4.3 or higher; you are using PHP 7.3.17}} ==== What to do if php update.php fails to do anything, resulting in a quick pause and then return to command prompt ==== <!--T:219--> <!--T:220--> This can be caused by a malfunctioning extension or skin. <!--T:221--> * Check that all extensions and skins called for in <tvar name=1>LocalSettings.php</tvar> are present</translate> <translate> <!--T:222--> * Check that extensions are using the correct registration method (<tvar name=1>wfLoadExtension</tvar> vs. <tvar name=2>require_once</tvar>)</translate> <translate> <!--T:556--> * Comment out the first half of the extensions in <tvar name=1>LocalSettings.php</tvar>.</translate> <translate><!--T:557--> If this causes <tvar name=1>update.php</tvar> to work, uncomment half of that half (so 1/4 of the extensions).</translate> <translate><!--T:558--> If this does NOT cause <tvar name=1>update.php</tvar> to work, uncomment the first half but comment out the second half, and then comment out half of the second half, etc.</translate> <translate><!--T:223--> Repeat until <tvar name=1>update.php</tvar> works to find the one that is failing.</translate> <translate> ==== What to do in case of "ALTER command denied to user" error (or similar) ==== <!--T:89--> <!--T:90--> In case the scripts abort with a message similar to: </translate> <pre> Error: 1142 ALTER command denied to user 'wiki'@'localhost' for table 'mytable' (localhost) ERROR: must be the owner of the mytable relation </pre> <translate> <!--T:91--> This means that you should check that you have defined <tvar name=1></tvar> and <tvar name=2></tvar> in your <tvar name=3></tvar> file (in the main directory). These are the user and password needed by this script in order to access to the database. </translate> <translate><!--T:200--> In some cases, an old $wgDBmwschema variable (for Postgres) seems to be read for the table name to update instead of $wgDBname, even when MySQL is used.</translate> <translate><!--T:598--> If this is the case, just get rid of the <tvar name=1><code>$wgDBmwschema</code></tvar> definition in <tvar name=2><code>LocalSettings.php</code></tvar>.</translate> <translate> ====What to do in case of 'register_argc_argv is set to false' error==== <!--T:100--> <!--T:101--> You may encounter the error: </translate> <pre style="overflow:auto;"> Cannot get command line arguments, register_argc_argv is set to false </pre> # <translate><!--T:102--> Go to <tvar name=1>~/maintenance</tvar>.</translate> <translate><!--T:613--> Either edit an existing <tvar name=2>php.ini</tvar> file, or create one.</translate> # <translate><!--T:103--> Add a line as follows:</translate> <pre style="overflow:auto;"> register_argc_argv=true </pre> # <translate><!--T:104--> Re-run <tvar name=1><code>php update.php</code></tvar></translate> <translate> ===Web browser=== <!--T:105--> </translate> <translate> <!--T:106--> : ''See also <tvar name=update></tvar>'' <!--T:107--> If your database is already big and in high production usage, then you should not be using the Web updater, e.g. because the update process will time out when the ''maximum_execution_time'' is reached. In that case you should use [[update.php]] from the command-line interface (not from the web). What exactly is "too big" depends on your server (e.g. on its performance, the load and on how long the maximum execution time of PHP allows the script to run). If your wiki is too big for the web updater and your hosting provider does not allow command-line access, then you need to migrate your wiki to another hosting account, preferably to one that does have shell access. </translate> # <translate><!--T:108--> Always [[<tvar name=1>Special:MyLanguage/Manual:Backing up a wiki</tvar>|back up]] before performing database maintenance.</translate> # <translate><!--T:109--> Navigate your web browser to <tvar name=1><code>'''/mw-config/index.php'''</code></tvar>.</translate> <translate><!--T:559--> For example, if your wiki is at <tvar name=1><code><nowiki>http://example.org/w/index.php</nowiki></code></tvar>, then navigate to <tvar name=2><code><nowiki>http://example.org/w/mw-config/index.php</nowiki></code></tvar>.</translate> # <translate><!--T:110--> Select your language and click continue.</translate> # <translate><!--T:111--> The existing installation should be detected. Follow the instructions on the screen to upgrade it.<br/>If asked for the "upgrade key", open your <tvar name=localsettings></tvar> file and look for the key assigned to <tvar name=upgkey></tvar>.</translate> <translate> <!--T:112--> It might happen that the web-updater does not seem to work: Instead of seeing the initial language selection screen, you might see an empty wiki page, possibly with some error message. In this case it is most likely that your web server uses Rewrite Rules (most likely for [[<tvar name=shorturl>Special:MyLanguage/Manual:Short URL</tvar>|short URLs]]), which do not show you the updater at ''mw-config/'', but a wiki page at ''Mw-config/'', with capital "M". In this case, rename the ''.htaccess'' file for the time of the update. Then you should be able to access the web-updater.</translate> {{Warning|1=<translate><!--T:113--> If you use this method, make sure to '''change the name of the .htaccess file back''' after running the upgrade script! Otherwise, short URLs and possibly other stuff will be broken!</translate>}} <translate>
Summary:
Please note that all contributions to Numinix MediaWiki Demo may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Project:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)