Tech:Semantic MediaWiki

Semantic MediaWiki is a unique extension that requires additional steps to enable on wikis and to upgrade the extension.

Enabling on Wikis

Semantic MediaWiki requires running setupStore.php on installation. This is normally done by ManageWiki when it is enabled so there is usually no need for it to be ran manually except if certain settings are changed.

The data generated by this script needs to be on all MediaWiki appservers. Due to this, it does not work running setupStore.php in ManageWikiInstaller directly. It has to be manually ran and deployed using the following steps.

Running setupStore via mwscript

Login to mwtask181, then run these commands.

mwscript SemanticMediaWiki:setupStore <wiki>
mwscript SemanticMediaWiki:setupStore <wiki>
  • Replace <wiki> with the database name of the wiki you’re enabling SMW on.

The setupStore script should be run twice as it can fail on the first run.

Upgrading Extension

{{ {{Note}} }} These steps are not yet confirmed but are theoretically how it should work. It should first be tested on test151 before attempted in production.

Unlike most extensions, Semantic MediaWiki is not installed via git, but rather via composer. Therefore the usual method of upgrading it using mwdeploy --upgrade-extensions=SemanticMediaWiki will not work for SMW.

To upgrade SMW follow the following steps:

  • Bump the version in the composer.local.json in the mediawiki-repos git repository
  • Run puppet on puppet181
  • Run puppet on mwtask181 and test151
  • Run mwdeploy --world --versions=all --servers=all on mwtask181 and test151

Categories

Applying local patches

Since Semantic MediaWiki is installed via composer, the staging folder is not a git repository. Instead of git am, you have to use the patch command to apply a patch. Example:

cd /srv/mediawiki-staging/1.44/extensions/SemanticMediaWiki
sudo -u www-data patch -p1 < ~/ExamplePatch.patch
mwdeploy --folders=1.44/extensions/SemanticMediaWiki --servers=all

Go to Source →