Manual:update.php
| MediaWiki file: update.php | |
|---|---|
| Location: | maintenance/ |
| Source code: | master • 1.27.0 • 1.26.3 |
| Classes: | UpdateMediaWiki |
Contents
Details[edit]
update.php checks if the MediaWiki database schema needs to be updated in order to work with the current version of MediaWiki. You should run update.php after each upgrade of MediaWiki or after the update or install of an extension that requires a schema update. Most extensions that require schema updates will say so in their documentation.
From the browser[edit]
If you do not have access to the command line of your server, then use the web updater to run the update script.
From the command line[edit]
From the command line, or an SSH shell or similar:
- Change to the maintenance directory
- Run the update script:
$ php update.php
Warning: update.php may exit with errors, leaving the database in an inconsistent state. Always backup the database before running the script!
Note: Use the following on Vagrant instances (from within your vagrant ssh).
$ mwscript update.php
Parameters[edit]
This script offers several parameters (generic, script dependent and script specific) which may be required in some wiki environments.
Generic maintenance parameters[edit]
--help- used to get a prompt of all available script parameters (generic, script dependent and script specific) together with short explanations of their usage. These are less often used parameters.
Script specific parameters[edit]
--quick- skip countdown sequence
--nopurge- do not purge objectcache table. Normally update.php purges the objectcache (generally contains the parser cache and the messages cache), msg_resource and msg_resource_links (these are used for ResourceLoader message caching and are cleared in 1.21 and later) tables in the database, if you don't want to purge this table, use the --nopurge option.
--doshared- Update shared tables as well.
--force- Run this script even if it is disabled by configuration options.
--skip-compat-checks- Skips compatibility checks
| Only recommended for use by developers. |
Extensions can install/update their schemas using LoadExtensionSchemaUpdates hook.
See also[edit]
- Manual:$wgDBadminuser and Manual:$wgDBadminpassword
- For detailed instruction on using update.php, see Manual:Upgrading, Manual:Upgrading#Command_line

