Wikidata build, including related components used for


#Wikidata Build

Wikidata is using a build with Wikibase and its dependencies packaged into one git repo.

If you update the master branch of the Wikidata build repository it will be overwritten daily. To change things please instead make changes to the wikidata/build-resources repository which is used as one of the resources for automated Wikidata builds.


  1. Clone the git repo into the mediawiki extensions directory
  2. Add the following line to your LocalSettings.php. This entry point in turn loads all other entry points.
To enable Repo add the following
$wgEnableWikibaseRepo = true;
$wgEnableWikibaseClient = false;
$wmgUseWikibaseRepo = true;
$wmgUseWikibaseClient = false;
require_once __DIR__ . "/extensions/Wikidata/Wikidata.php";
require_once __DIR__ . "/extensions/Wikidata/extensions/Wikibase/repo/ExampleSettings.php";
To enable Client add the following
$wgEnableWikibaseRepo = false;
$wgEnableWikibaseClient = true;
$wmgUseWikibaseRepo = false;
$wmgUseWikibaseClient = true;
require_once __DIR__ . "/extensions/Wikidata/Wikidata.php";


Wikibase itself needs to be configured, with appropriate settings. See the below links:

Using this repo provides extra options to allow you to choose to deploy the Repo and/or Client.

// Load the Repo Extension (default false)
$wmgUseWikibaseRepo = true;
// Load the Client Extension (default false)
$wmgUseWikibaseClient = true;

Maintenance scripts

The Maintenance scripts help within this repo will not work if you do not have the environment variable MW_INSTALL_PATH defined.

If you do not and can not define this variable please use the runScript.php maintenance script within mediawiki core (see comments in that file for instructions).

Manually update a build

Manually updating a Wikidata build requires composer to be installed on the system.

The Wikidata build uses grunt (node.js) to provide some convenience functions. To use this, do:

npm install

Then to make a build, run:

grunt install

To clean the install (remove composer.lock, /vendor and /extensions):

grunt uninstall

To make a deployment build, using appropriate branchName argument:

grunt branch --branchName="wmf/1.25wmf1"

For deployment builds, this sets the autoloader-suffix config option in the composer.json to be based on the branch name, which makes the composer autoloader code more stable when deployed and synced to multiple servers.

The sharedCacheKeyPrefix setting is also set to be based on the branch version, and can be manually changed when doing backports to a deployment branch, as needed for invalidating memcached entries.

To update a single component:

composer update --prefer-dist -o --no-dev wikibase/wikibase

Updating this README

This README is located in the wikidata/build-resources repository. Any changes made to the README in the Wikidata build repository will be overwritten daily.