Help:Installation/Using Composer with MediaWiki 1.25+

Fresh install
Use these instructions for a new Semantic MediaWiki installation in chronological order as they appear on this page.

Install Composer
Install Composer first since this software is required to install Semantic MediaWiki. Please follow the instructions at installing Composer on how to do this.

Check compatibility
Make sure that you have a compatible version of MediaWiki installed. Special page "Version" contains the MediaWiki version and it is recommended to compare compatibility with Update to the appropriate version of MediaWiki and COMPATIBILITY.md.

Using Composer
If you do not have a "composer.local.json" file yet, create one and add the following content to it:

If you already have a "composer.local.json" file add the following line to the end of the "require" section in your file:

Remember to add a comma to the end of the preceding line in this section. See an example "composer.local.json" file.

Run the update script
Run the installation script from the base directoryCiteRef::install:base:dir of your MediaWiki installation: Note if you have Git installed on your system add the  flag to the above command. Also note that it may be necessary to run this command twice. If unsure do it twice right away.

Run the maintenance script
Run the setup script from the base directoryCiteRef::install:base:dir of your MediaWiki installation:

Enable Semantic MediaWiki
Add a call to  to the end of the "LocalSettings.php" file. takes in the domain name of the wiki; a wiki located at "example.org", for instance, should have the following call: Starting with an informative error description page will be shown if this was forgotten for some reason.CiteRef::gh:smw:4153

Add optional settingsCiteRef::install:config apart from one exception namely CiteRef::install:config:namespaceindex to the "LocalSettings.php" file as desired below the  call.

In case you want to use additional semantic extensions please refer to their respective documentation on how to invoke them. In any case make sure that you invoke them below the  call in your "LocalSettings.php" file.

Check and verify
Check the "Special:Version" page on your wiki and verify that the extension has been successfully installed and enabled.

Test your installation as described on the help page about testing Semantic MediaWiki.

Done!

Update
Use these instructions to update an existing Semantic MediaWiki installation.

Backup
Backup your database and installation.

Run the update script
Run the update script from the base directoryCiteRef::install:base:dir of your MediaWiki installation:CiteRef::install:composer:global

Note if you have Git installed on your system add the  flag to the above command. Also note that it may be necessary to run this command twice. If unsure do it twice right away.

Run the maintenance script
Run the setup script from the base directoryCiteRef::install:base:dir of your MediaWiki installation:

Run the refresh database script from the base directoryCiteRef::install:base:dir of your MediaWiki installation:CiteRef::install:refresh

Check and verify
Check the "Special:Version" page on your wiki and verify that the extension has been successfully updated.

Done!

Upgrade

 * Help page on upgrading from SMW 2.5 and later for MW 1.25 and later
 * Help page on upgrading from SMW 1.9 and later for MW 1.22 and later