Data items/Technical Site Configuration

From OpenStreetMap Wiki
Jump to navigation Jump to search

Completed steps

  • Add a small custom extension OsmWikibase to modify Wikibase defaults:
cd /srv/
git clone
  • Update all Mediawiki extensions to REL1_31
  • Add wikibase extensions code from REL1_31, e.g.
cd /srv/
git clone -b REL1_31
cd Wikibase
git submodule update --init --recursive
  • Create /srv/, of if exists, add Wikibase to it:
  "extra": {
    "merge-plugin": {
      "include": [
  • Configure Wikibase extension. See Current OSM LocalSettings.php config
  • Run composer install --no-dev from the MW root. We may have to do composer update to get the latest dependencies instead of the locked ones.
  • Update databases: php maintenance/update.php
  • Add this OSM wiki site to the sites table:
/srv/ php maintenance/shell.php
  $site = new OsmWikibase\OsmSite();
  $site->setGlobalId( 'wiki' );
  $site->setGroup( 'osm' );
  $site->setPath( Site::PATH_LINK, "$1" );
  // If updating, make sure to keep internal ID  
  $store = SiteSQLStore::newInstance();
  $oldSite = $store->getSite( $site->getGlobalId() );
  if ( $oldSite ) $site->setInternalId( $oldSite->getInternalId() );
  $store->saveSites( [ $site ] );
  • Edit LocalSettings.php - bump per request memory limit to 500MB:
  $wgMemoryLimit = "500M";


  • Automate Wikibase data dumps, e.g. via a weekly cron job:
# All params except no-cache are the same as default, so technically not required
# we only have two types of entities, so entity-type is also a noop
php extensions/Wikibase/repo/maintenance/dumpRdf.php \
				--wiki wiki \
				--format ttl \
				--flavor full-dump \
				--entity-type item \
				--entity-type property \
				--no-cache \
     2>> $errorLog | gzip -9 > $tempDir/osmwikibase.gz
mv $tempDir/osmwikibase.gz $publicDir/osmwikibase.gz