Wikibase/Installation

This page provides a step-by-step instruction how to install a basic version of Wikibase. It just explains the minimal configuration needed for Wikibase. If you're interested in a more advanced configuration, please refer to the advanced configuration guide. A complete documentation exist in the docs folder for Wikibase, see Github: wikimedia/mediawiki-extensions-Wikibase/docs.

=Prerequisites=

MediaWiki
Technically, Wikibase is an extension (actually two extensions) to MediaWiki, so you need to set up MediaWiki first.

Composer
The easiest way to install all dependencies of Wikibase is using Composer. Here you can find installation instructions for Composer.

=Installation= A basic installation of Wikibase is pretty much straight forward and basically consists of 4 steps: The following guide will lead you through these steps.
 * 1) getting Wikibase
 * 2) fetching dependencies
 * 3) modifying LocalSettings.php
 * 4) running some maintenance scripts.

Meet the prerequisites
Make sure you've set up MediaWiki and installed Composer.

Get Wikibase
Download the version of Wikibase that matches your Mediawiki installation into the extensions folder of your MediaWiki installation. There are several ways to download Wikibase.

'''Using the wrong version of Wikibase for your Mediawiki installation will result in errors. Be aware that the latest version of Wikibase will not work with Mediawiki version 1.30.0 (latest stable version).'''

Download from Git
Make sure the folder you just downloaded is called  and located in
 * For getting the latest unstable version of Wikibase, do:
 * You should use a version of Wikibase that corresponds with the version of MediaWiki itself. For getting a specific version of Wikibase you have to specify the branch you want to download. For example, to install Wikibase for Mediawiki version 1.31.x use the Wikibase branch REL1_31:

Download archive

 * Instead of using Git you can alternatively download an archive with the latest version of Wikibase or choose to download a specific version of Wikibase.
 * Make sure you extract the archive into a new folder called  inside the extensions folder of your MediaWiki installation.

Fetch all dependencies
Using the composer-merge-plugin

Include the following into  at the root of your mediawiki installation:

and run from the root of your mediawiki installation using just one of these methods:

Adjust your LocalSettings.php
Add the following lines to LocalSettings.php of your MediaWiki installation. You have three options, depending on whether you want to enable Wikibase Repository, Wikibase Client or both of them.

Run the setup scripts
Finally, you have to run some maintenance scripts.


 * Run the database update script of your MediaWiki installation:


 * Run the script that populates the sites table:

Note: ''By default, this populates the sites table with Wikimedia's project list only. See Manual:Sites table for options to list non-WMF projects.''

For Wikibase Repository only

 * Run

For Wikibase Client only

 * If you want to run a Wikibase Client, you'll also need to run the script that populates the interwiki table:

Wikibase Repository
To verify your Wikibase Repository installation, in your MediaWiki go to Special:NewItem and you should be able to create your first Item. Enter a label and optional description and aliases and hit Create. You should be redirected to the item page.

Wikibase Client
If you've enabled Wikibase Client and everything is correct, you should see an "Add links" link in the languagelinks section in the sidebar of the main page.

= For developers =

Vagrant
An easy way to set up a developer environment for Wikibase is to use one of the wikibase_repo or wikidata role in MediaWiki-Vagrant. They are set up as plain instances including all dependent components, and provides a quick way to get ready for hacking on Wikibase code. The wikibase_repo role provides a simple environment where there is a single repo instance accessible as http://127.0.0.1:8080 (HHVM) or at http://php5.local.wmftest.net:8080 (PHP5). The wikidata role provides a complex environment where there are both repo and client instances. The English client instance is accessible at http://en.wiki.local.wmftest.net:8080 (HHVM) and the repo instance is at http://wikidata.wiki.local.wmftest.net:8080 (HHVM). For the wikibase_repo role the sources of the Wikibase extension can be found under  and sources of dependent components are under , while for the wikidata role the sources are under.

Docker
This repository contains an example docker compose file and docker images. Following these instructions, you'll be able to install a stand-alone instance of Wikibase – the collaborative structured data engine behind Wikidata – as well as fully functional SPARQL endpoint and query service, complete with a data visualization frontend and query helper (similar to the Wikidata Query Service).

There are very few languages I can set labels for in a new item
Make sure you installed Extension:UniversalLanguageSelector

There are no sites I can link pages to in an item
One or more of the following may help: