Upgrade from SMW 2.5.x to SMW 3.0.x (MW 1.27.0 to MW 1.31.x)

From semantic-mediawiki.org
< Help:Upgrade
Administrator manualInstallationUpgradeUpgrade from SMW 2.5.x to SMW 3.0.x (MW 1.27.0 to MW 1.31.x)
Installation
This page describes the upgrade procedure from SMW 2.5.x to SMW 3.0.x (native Composer support).
Further Information
Installation type: upgrade
Installation method: Composer
MediaWiki version: 1.27.0 to 1.31.x
Table of Contents

This help page describes the upgrade procedure from Semantic MediaWiki 2.5.x to Semantic MediaWiki 3.0.x with native Composer support.

  • Note that this help page assumes that you use MediaWiki 1.27.0 to 1.30.x. See also the help page on compatibility.
  • Once you have upgraded to Semantic MediaWiki 3.0.x you can continue to upgrade as explained in the relevant help pages.

Step 1 - Backup database and wiki[edit]

Backup your wiki database and wiki installation.

Step 2 - Update setup file[edit]

Change to the base directory of your wiki1 in your server's shell and modify the "composer.local.json" file to look like this2:

{
	"require": {
                  "mediawiki/semantic-media-wiki": "~3.0.0"
        }
}

Step 3 - Update software[edit]

Run the composer command34 from the base directory of your wiki1 in your server's shell to upgrade the source code of Semantic MediaWiki and dependencies:

php composer.phar update --no-dev

Step 4 - Update database[edit]

Run maintenance script "update.php" (MediaWiki.org) from the base directory of your wiki1 in your server's shell to apply the schema changes to your wiki's database:

php maintenance/update.php

Or alternatively use maintenance script "setupStore.php"Allows to set up the data backend/store:

php extensions/SemanticMediaWiki/maintenance/setupStore.php

Step 5 - Update database cont.[edit]

If you see the upgrade information error message on your wiki's pages run maintenance script "populateHashField.php"Allows to do mass populating of database field "smw_hash" when initially upgrading to Semantic MediaWiki 3.0.1 and later from the base directory of your wiki1 in your server's shell to apply further changes to your wiki's database:

php extensions/SemanticMediaWiki/maintenance/populateHashField.php -v
If you do not see the upgrade information error message on your wiki's pages you may skip this step and directly do the next one.

Step 6 - Rebuild data[edit]

Run maintenance script "rebuildData.php"Allows to rebuild all the semantic data for a selected data backend/store from the base directory of your wiki1 in your server's shell to rebuild the semantic data in wiki's database:

php extensions/SemanticMediaWiki/maintenance/rebuildData.php -v --with-maintenance-log

Step 7 - Update configuration[edit]

Go to the "Deprecation notices" tab on special page "SemanticMediaWiki"Provides functions for wiki administrators that assist in doing their administration work and update your wiki's "LocalSettings.php" file according to the information provided on that page.

If you do not see the "Deprecation notices" tab on on your wiki's special page "SemanticMediaWiki"Provides functions for wiki administrators that assist in doing their administration work you may skip this step and you are done.
Some changes to the settings of configuration parameters may require you to rebuild the wiki's semantic data again. This is documented on each configuration parameters documentation page. In this case go back to step 6.

Done![edit]

Semantic MediaWiki and the database use should now be upgraded properly. The wiki may now be used again.

Semantic MediaWiki 3.0.0Released on 11 October 2018 and compatible with MW 1.27.0 - 1.31.x. brought deliberate syntax changes which may affect your wiki. Thus have a look at the migration guide for further information.

See also[edit]


References

  1. a b c d e  This is the directory which contains the "LocalSettings.php" file.
  2. ^  | |  This help page assumes that your are only upgrading Semantic MediaWiki. In case you installed further extensions to Semantic MediaWiki the "composer.local.json" needs to be adapted accordingly. See an example.
  3. ^  | |  In case you installed Composer "globally" on your server, you will have to drop the php and .phar particles from the command.
  4. ^  | |  This help page assumes that the "composer.phar" file is located in the base directory of your wiki. If not the path to the "composer.phar" file needs to be adapted to the server's situation.