Manual:update.php
MediaWiki file: update.php | |
---|---|
Location: | maintenance/ |
Source code: | master • 1.42.3 • 1.41.4 • 1.39.10 |
Classes: | UpdateMediaWiki |
Details
editThe maintenance script update.php checks if the MediaWiki database schema needs to be updated 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.
Usage
editFrom the browser
editIf 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
editUse the following from the command line, or an SSH shell or similar:
$ php maintenance/run.php update
Use the following on Vagrant instances (from within your vagrant ssh).
$ mwscript update.php
Parameters
editThis script offers several parameters (generic, script-dependent, and script-specific) that 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.
--wiki wikiId
- update wiki family if database name depends on a virtual host, where wikiId - database name (e.g., enwiki, dewiki ...)
--conf
- Specifies the config file (the
LocalSettings.php
file for the specific wiki). Used for wiki families.
Script specific parameters
edit--quick
- skip countdown sequence
--initial
- (introduced in 1.43) Do initial updates required after manual installation using tables-generated.sql
--doshared
- Update shared tables as well.
--noschema
- All changes to the table structure or table additions are skipped. Only data changes are made.
--schema
- No schema changes are made to the database, but the schema changes are saved to a separate SQL file that can be run.
- Allows "update.php" to be run when $wgAllowSchemaUpdates is set to false. This is useful for non-WMF environments where strict DB permissions allow database updates (which "update.php" performs), but no schema changes (such as adding or dropping tables or indexes, which "update.php" also performs).
--force
- Run this script even if configuration options disable it.
--skip-external-dependencies
- when using composer.local.json to let Composer install extensions and their dependencies, you may see an error message saying that there is a mismatch between the installed and required version (e.g. "mediawiki/semantic-breadcrumb-links: 1.3.0 installed, ~1.3 required"). You can use this parameter to ignore the message and run update.php regardless.
--skip-config-validation
- (introduced in 1.39) Skips checking whether the existing configuration is valid. Otherwise, this script will not run if an invalid configuration is detected.
--skip-compat-checks
- (removed in 1.41) Skips compatibility checks, Gerrit change 851684
--nopurge
- (removed in 1.36) do not purge objectcache table. Normally
update.php
purges the objectcache table (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.
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