MediaWIKI Upgrade: Difference between revisions

 
(7 intermediate revisions by the same user not shown)
Line 1: Line 1:
There are all sorts of tutorials on upgrading MediaWiki.  Here's the "down and dirty" version.
There are all sorts of tutorials on upgrading MediaWiki.  Here's the "down and dirty" version.
NOTE: As of 2020 and MediaWiki 1.35.0, the Visual Editor is include within the MediaWiki package.  And it works out of the box for HTTP and HTTPS (dang that used to be difficult to figure out how to install and then configure to use with STUNNEL).


==BACKUP!==
==BACKUP!==
Don't take a chance that the upgrade will mess something up.  Make a backup.  For MediaWiki, that consists of two items: The website files and the data base.
Don't take a chance!  Assume the upgrade will mess something up.  So make a backup.  For MediaWiki, that consists of two items: The website files and the data base.


Backup the website files (actually make a copy)<syntaxhighlight lang="text">
Backup the website files (actually make a copy)<syntaxhighlight lang="text">
Line 46: Line 48:
===LocalSettings.php===
===LocalSettings.php===
Copy the old copy of the LocalSettings.php file into the upgrade directory as the "new one", if it exists, wouldn't be overwritten with the new copy process.  See this for a tip on the LocalSettings.php file.
Copy the old copy of the LocalSettings.php file into the upgrade directory as the "new one", if it exists, wouldn't be overwritten with the new copy process.  See this for a tip on the LocalSettings.php file.
===Images===
Make sure the /WhatEverPathToWiki/images permissions are writable for the Owner.  IE, if the images Directory is owned by Apache, it needs to be writable.  777 works, 755 is recommended, but if it doesn't work, go with 777.


===Scribunto & Lua===
===Scribunto & Lua===
If the Mediawiki software being upgraded uses the Scribunto and Lua extensions, then change permissions on the following file;<syntaxhighlight lang="text">
If the Mediawiki software being upgraded uses the Scribunto and Lua extensions, then change permissions on the following file;<syntaxhighlight lang="text">
chmod a+x /var/www/html/Wiki.RiseOfTheSaltonSea.com/extensions/Scribunto/includes/engines/LuaStandalone/binaries/lua5_1_5_linux_64_generic/lua
chmod a+x /var/www/html/WhatEverWebSite/extensions/Scribunto/includes/engines/LuaStandalone/binaries/lua5_1_5_linux_64_generic/lua


Older versions of Mediawiki use the below path;
Older versions of Mediawiki use the below path;


/var/www/html/Wiki.RiseOfTheSaltonSea.com/extensions/Scribunto/engines/LuaStandalone/binaries/lua5_1_5_linux_64_generic
/var/www/html/WhatEverWebSite/extensions/Scribunto/engines/LuaStandalone/binaries/lua5_1_5_linux_64_generic
</syntaxhighlight>Not doing the above item will hose the Wiki!
</syntaxhighlight>Not doing the above item will hose the Wiki!


Line 71: Line 76:


===Alternative for Modifying Files (CSS)===
===Alternative for Modifying Files (CSS)===
Instead of changing code in files, CSS can be used to modify visibility of elements on a MediaWiki Site.  The below script can be placed in the LocalSettings.php file and modify what appears for anonymous users and logged in users (probably not necessary to change anything for logged in users.<syntaxhighlight lang="text">
Instead of changing code in files, CSS can be used to modify visibility of elements on a MediaWiki Site.  The below script can be placed in the LocalSettings.php file and modify what appears for anonymous users and logged in users (probably not necessary to change anything for logged in users).<syntaxhighlight lang="text">
function efAddSkinStyles(OutputPage &$out, Skin &$skin) {
function efAddSkinStyles(OutputPage &$out, Skin &$skin) {
     if(!$skin->getUser()->isLoggedIn()) {
     if(!$skin->getUser()->isRegistered()) {
         if ($skin->getSkinName() == 'vector') {
         if ($skin->getSkinName() == 'vector') {
             $out->addInlineStyle('#ca-history { display:none; }');
             $out->addInlineStyle('#ca-history { display:none; }');
Line 84: Line 89:
             $out->addInlineStyle('#ca-talk { display:none; }');
             $out->addInlineStyle('#ca-talk { display:none; }');
             $out->addInlineStyle('#ca-viewsource { display:none; }');
             $out->addInlineStyle('#ca-viewsource { display:none; }');
             # $out->addInlineStyle('#footer-info-lastmod { display:none; }');
             $out->addInlineStyle('#footer-info-lastmod { display:none; }');
             }
             }
     } else {
     } else {
Line 95: Line 100:
$wgHooks['BeforePageDisplay'][] = 'efAddSkinStyles';
$wgHooks['BeforePageDisplay'][] = 'efAddSkinStyles';
</syntaxhighlight>The "#footer-info-lastmod" ID that is commented out above will disable the display of "Last edited / Last modified" for anonymous users.
</syntaxhighlight>The "#footer-info-lastmod" ID that is commented out above will disable the display of "Last edited / Last modified" for anonymous users.
As of version 1.36.0, an error message noting a "Deprecated Function" will pop up if the following line is left in place:     if(!$skin->getUser()->IsLoggedIn()) {
The above code replaces the IsLoggedIn with isRegistered Function.


===Extensions===
===Extensions===
Upgrade extensions (if there are upgrades).  Visual Editor is one that needs to be kept up.  Hopefully nothing breaks for extensions that don't have upgrades available.
Upgrade extensions (if there are upgrades).  Visual Editor is one that needs to be kept up.  Hopefully nothing breaks for extensions that don't have upgrades available.
<br />
 
==Database Update==
...and finally, don't forget to update the database structure.  From the /WhatEverPathToWebSite/WebSite/maintenance Directory;<syntaxhighlight lang="text">
php update.php
</syntaxhighlight>It can be done from the GUI, but is recommended that it be done from the command line.<br />