Help:Setup information file

From semantic-mediawiki.org

Both the generated upgrade key1 as well as other status information23 as described on the help page on upgrades are stored in the setup information file called ".smw.json".

The setup information file is generated or updated during the upgrade of the database by running maintenance script "setupStore.php"Allows to set up the data backend/store or maintenance script "update.php" (MediaWiki.org) respectively. Moreover the other status information are also updated by 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.

If the upgrade key was not set or is incorrect the Update Error Screen is shown to the users and if the other status information are set to "false" the upgrade information error message is shown to the users.

The file is stored at the location defined via configuration parameter $smwgConfigFileDirSets the directory for storing the setup information file ensuring database consistency4 which is by default the root directory of the Semantic MediaWiki Software, i.e. /path/to/extensions/SemanticMediaWiki. This path must be writable, persistent and accessible for Semantic MediaWiki throughout its operation. If this is not the case the Update Error Screen is shown informing about this problem. Note that the Update Error Screen is also shown if the file was manually manipulated.5

If the file cannot be written to the directory defined by configuration parameter $smwgConfigFileDirSets the directory for storing the setup information file ensuring database consistency an additional error message is shown to the system administrator apart from the the Update Error Screen which is shown to the users at the same time:

ERROR: /var/www/html/02100/w/.smw.json is not writable.

       The "smwgConfigFileDir" setting should point to a
       directory that is persistent and writable!
Every time the Update Error Screen and the just mentioned error message is shown the setup information file must be generated or regenerated by running maintenance script "setupStore.php"Allows to set up the data backend/store or maintenance script "update.php" (MediaWiki.org).
Example content for the setup key file ".smw.json"
{
    "0210020150926-02100_": {
        "upgrade_key": "b1d9d6bec582041a8aca10a4d380cfc75aa86e7f",
        "populate.smw_hash_field_complete": true
    }
}

The wiki's upgrade key as well as other status information is referenced by the identifier holding the respective upgrade key. The identifier uses the wiki ID of the wiki, e.g. "0210020150926-02100_".

A file was chosen to be able to store such information without relying on a database connection. Moreover the "LocalSettings.php" cannot be manipulated to set these variables which would also be out of scope of this configuration file.6

See also[edit]


References

  1. ^  Semantic MediaWiki: GitHub pull request gh:smw:3095
  2. ^  Semantic MediaWiki: GitHub pull request gh:smw:3611
  3. ^  Semantic MediaWiki: GitHub pull request gh:smw:3715
  4. ^  Semantic MediaWiki: GitHub pull request gh:smw:3596
  5. ^  Semantic MediaWiki: GitHub issue comment gh:smw:3596:453788765
  6. ^  Semantic MediaWiki: GitHub issue comment gh:smw:3611:453855704