Help:Installation/Windows environment

Installing Semantic MediaWiki as of version 1.9 on a Windows Server will require a different approach on what most of you are used to. Because of ever increasing dependencies within SMW it has become more difficult to get a stable version up and running. Especially when you want to or are used to run the development version of SMW. Because of that Composer is required when installing SMW 1.9 and higher. These instruction explain how to install SMW as of 1.9 on a Windows box using Composer.

Requirements
You need a running (working) Wiki. Consider updating MediaWiki to the latest stable version on a existing Wiki. When you are installing / updating SMW on existing Wiki back up your Wiki and its DB first! Before you start installing SMW you will need the following software / extension(s) to be installed on your Wiki server. Only start installing SMW when you have done this. Your server also needs to be connected to the Internet.

Install Composer
Download the installer from http://getcomposer.org/Composer-Setup.exe and run it. The installer will download composer for you and set up your PATH environment variable so you can simply call composer from any directory.

Install Git
Download the installer from http://git-scm.com/download/win and run the installer.

Install Extension Installer
You do not need Extension Installer when you are using MediaWiki 1.22 or later!

Download Extension Installer from the MediaWiki wiki and follow the instructions on how to install.

Install / Update SMW with Composer
When using Composer to install extensions there is no need to edit  to enable them. All extensions that support Composer will auto-load. MediaWiki provides direct support for composer as of version 1.22! However, you can edit  after setup to change extension settings, see Help:Configuration.

When you are installing SMW on a fresh MW installation start at step 3.


 * 1) Delete all required extensions for SMW from the   directory of your wiki installation these are:
 * 2) Delete all lines from required SMW extensions from   that load SMW, they are no longer needed. These are:
 * 3) Add the following line(s) to the end of your   file:
 * 4) In a terminal screen cd to the root of your wiki and execute the following commands:
 * 5) * For the latest stable SMW release use:
 * 6) * For the SMW development version use:
 * 7) In a terminal screen cd to the   directory of you wiki and run   to update your database.
 * 8) On an existing wiki you could rebuild your semantics. Please read Help:Repairing SMW's data first so you know what this will do! cd to   and execute the refreshData php script:
 * 1) Add the following line(s) to the end of your   file:
 * 2) In a terminal screen cd to the root of your wiki and execute the following commands:
 * 3) * For the latest stable SMW release use:
 * 4) * For the SMW development version use:
 * 5) In a terminal screen cd to the   directory of you wiki and run   to update your database.
 * 6) On an existing wiki you could rebuild your semantics. Please read Help:Repairing SMW's data first so you know what this will do! cd to   and execute the refreshData php script:
 * 1) In a terminal screen cd to the   directory of you wiki and run   to update your database.
 * 2) On an existing wiki you could rebuild your semantics. Please read Help:Repairing SMW's data first so you know what this will do! cd to   and execute the refreshData php script:

If you already have SMW installed via Composer, upgrading to a new version can be as simple as running "composer update". However, you may need to modify your Composer.json file first to specify which version of SMW you want installed.

Windows does not always recognize the changes made by Composer. In order to make SMW work after an upgrade, you may need to update the "modified date" of each file in the extensions/SemanticMediaWiki directory. To do this you need a bash emulator (e.g. a terminal where you can use Unix commands). If you have Git installed (which you need to use Composer) you probably have Git Bash. In your bash emulator change directory to the MediaWiki extensions directory, then run:

This will find every file and directory in the SemanticMediaWiki directory and execute the "touch" command, updating it's modification date.

Install / Update SMW extensions that support Composer
You can, if you need them, install some SMW extension with Composer. When you are installing SMW on a fresh MW installation or you never used these extension before go to step 3.
 * 1) In explorer delete all older SMW extensions from the extensions directory of your wiki installation. These are:
 * 2) Delete all lines from SMW extensions from   that load SMW extensions, they are no longer needed. These are:
 * 3) In a terminal screen cd to the root of your wiki and execute the following commands to install the extensions you need:
 * You need to install Maps first!
 * 1) Delete all lines from SMW extensions from   that load SMW extensions, they are no longer needed. These are:
 * 2) In a terminal screen cd to the root of your wiki and execute the following commands to install the extensions you need:
 * You need to install Maps first!
 * 1) In a terminal screen cd to the root of your wiki and execute the following commands to install the extensions you need:
 * You need to install Maps first!
 * You need to install Maps first!
 * You need to install Maps first!

Install / Update other SMW extensions through Git
You can also install these extensions by downloading them from MediaWiki. When you are using Git, in a terminal screen cd to the extensions directory of your wiki and execute the following commands for the extensions you need or want to update, some examples below:

Of course, you then have to edit  to enable these extensions. For documentation on this look on the individual extension pages on the MediaWiki wiki.

Downgrading
If for some reason you need to downgrade from one Composer-supported version of SMW to another Composer-supported version, perform the following:


 * 1) Update Composer.json to the state the specific version of SMW you want installed (e.g. "2.0" is specific, versus "~2.0" will install the latest version less than 3.0).
 * 2) Run "composer update"
 * 3) You may need to run "composer dump-autoload --optimize"