############ Upgrading MediaWiki from 1.30 to 1.35.1 ##################
Process: Will create a sub directory near the place where the current MW install is at.
In that new subdir we will download the the MediaWiki 1.35.1 tarball, then run a command to install the new version into the area where the current install of 1.30 is when the extract is completed, it is necessary to run the update.php utility to take care of the PHP configuration adjustments
(optional) if you rebooted the system or restarted apache2, disable it now
systemctl stop apache2
make sure we are starting in the home dir
cd ~
create a new dir called MW near the current MediaWiki install. This new dir will be the working directory for downloading the new version of MediWiki 1.35.1
mkdir /var/www/mw
go into the new MW working dir
cd /var/www/mw
Backup the current MediaWiki LocalSettings.php file
This file is critical and contains all the configuration info for your MW install
cp /var/www/html/LocalSettings.php /var/www/html/LocalSettings.php.old.bak
download the new MediaWiki tarball
wget https://releases.wikimedia.org/mediawiki/1.35/mediawiki-1.35.1.tar.gz
(optional) can do a snapshot now as the next steps will install and overwrite the MW 1.30
Extract and install the new version of MediaWiki into the current working directory
tar xvzf mediawiki-1.35.1.tar.gz -C /var/www/html/ --strip-components=1
The extract and install should complete quickly
At this point MediaWiki 1.35.1 is installed. You can start apache2 and try to log in but the landing page will give an error and say the MW 1.35.1 is not configured
We need to complete the install with the update.php utility
/var/www/html/maintenance/update.php
The install should be completed and if you start apache2 (OPTIONAL) you can log into the MW. If you navigate to the special pages and version, it should say 1.35.1, however the VisualEditor and Editor are broken
Editing LocalSettings.php
(optional) Stop apache2 and we need to edit the LocalSettings.php
systemctl stop apache2
using nano we can edit the LocalSettings.php file, adjusting the configuration to use the new extensions. It seems that for upgrading existing installations of the MW with the VisualEditor extension, the upgrade reuses (or keeps) the existing install and configuration of VisualEditor
Have done new clean builds of MediaWiki with 1.35.x and there is no need to install and configure parsoid as it is built into the 1.35. Proof of this is the contents of the LocalSettings.php file after the first time run and initial MW configuration wizard.The LocalSetting.php file does not contain the sections related to $wgVirtualRestConfig
editing LocalSettings.php
nano /var/www/html/LocalSettings.php
Inside this file we need to comment out sections and add items. All of the work is done towards the bottom of the file as the Extensions are enabled and configured here
Comment out the old Extensions first by adding // each of the entries. It should look like this when completed. Added // OLD Options over this section for reference
// OLD Options
//wfLoadExtension( ‘Cite’ );
//wfLoadExtension( ‘CiteThisPage’ );
//wfLoadExtension( ‘Gadgets’ );
//wfLoadExtension( ‘ImageMap’ );
//wfLoadExtension( ‘InputBox’ );
//wfLoadExtension( ‘ParserFunctions’ );
//wfLoadExtension( ‘Poem’ );
//wfLoadExtension( ‘Renameuser’ );
//wfLoadExtension( ‘SyntaxHighlight_GeSHi’ );
//wfLoadExtension( ‘MsUpload’ );
//require_once “$IP/extensions/Vector/Vector.php”;
//wfLoadExtension( ‘WikiEditor’ );
//wfLoadExtension( ‘OATHAuth’ );
//wfLoadExtension( ‘UserPageViewTracker’ );
//wfLoadExtension( ‘VisualEditor’ );
##############################################################################
Next adding the new extensions to the file. Some of these may be options you find later you do not want or need. They can be disabled by adding // before the extension name. For continuity, I added these where the old ones started under and sent the old ones, commented out earlier, below the new ones
##############################################################################
wfLoadExtension( ‘CategoryTree’ );
wfLoadExtension( ‘Cite’ );
wfLoadExtension( ‘CiteThisPage’ );
wfLoadExtension( ‘ConfirmEdit’ );
wfLoadExtension( ‘Gadgets’ );
wfLoadExtension( ‘ImageMap’ );
wfLoadExtension( ‘InputBox’ );
wfLoadExtension( ‘Interwiki’ );
wfLoadExtension( ‘LocalisationUpdate’ );
wfLoadExtension( ‘MultimediaViewer’ );
wfLoadExtension( ‘Nuke’ );
wfLoadExtension( ‘OATHAuth’ );
wfLoadExtension( ‘PageImages’ );
wfLoadExtension( ‘ParserFunctions’ );
wfLoadExtension( ‘PdfHandler’ );
wfLoadExtension( ‘Poem’ );
wfLoadExtension( ‘Renameuser’ );
wfLoadExtension( ‘ReplaceText’ );
wfLoadExtension( ‘Scribunto’ );
wfLoadExtension( ‘SecureLinkFixer’ );
wfLoadExtension( ‘SpamBlacklist’ );
wfLoadExtension( ‘SyntaxHighlight_GeSHi’ );
wfLoadExtension( ‘TemplateData’ );
wfLoadExtension( ‘TextExtracts’ );
wfLoadExtension( ‘TitleBlacklist’ );
wfLoadExtension( ‘VisualEditor’ );
wfLoadExtension( ‘WikiEditor’ );
The end of the file contains the configuration for parsoid and the VisualEditor. My working example looks like this
// Enable by default for everybody
$wgDefaultUserOptions[‘visualeditor-enable’] = 1;
//
// // Optional: Set VisualEditor as the default for anonymous users
// // otherwise they will have to switch to VE
$wgDefaultUserOptions[‘visualeditor-editor’] = “visualeditor”;#
//
// // Don’t allow users to disable it
$wgHiddenPrefs[] = ‘visualeditor-enable’;
//
// // OPTIONAL: Enable VisualEditor’s experimental code features
$wgDefaultUserOptions[‘visualeditor-enable-experimental’] = 1;
//
$wgVisualEditorEnableWikitext = true;
$wgDefaultUserOptions[‘visualeditor-newwikitext’] = 1;
$wgHiddenPrefs[] = ‘visualeditor-newwikitext’;
$wgDisableUploadScriptChecks = true;
$wgVirtualRestConfig[‘modules’][‘parsoid’] = array(
// URL to the Parsoid instance
// Use port 8142 if you use the Debian package
‘url’ => ‘http://localhost:8142’,
// Parsoid “domain”, see below (optional)
‘domain’ => ‘localhost’,
// Parsoid “prefix”, see below (optional)
‘prefix’ => ‘localhost’
);
$wgVirtualRestConfig[‘modules’][‘parsoid’][‘forwardCookies’] = true;
// End of Old Options
$wgFileExtensions = array( ‘png’, ‘gif’, ‘jpg’, ‘jpeg’, ‘doc’,
‘xls’, ‘xml’, ‘txt’, ‘mpp’, ‘pdf’, ‘ppt’, ‘tiff’, ‘bmp’, ‘docx’, ‘xlsx’, ‘db’, ‘key’,
‘pptx’, ‘ps’, ‘odt’, ‘ods’, ‘odp’, ‘unf’, ‘cfg’, ‘zip’, ‘xml’, ‘odg’
);
$wgMaxUploadSize = 50000000;
$wgUploadSizeWarning - 0;
$wgVerifyMimeType = false;
$wgMSU_useDragDrop = true; // Should the drag & drop area be shown? (Not set by default)
$wgMSU_showAutoCat = true; // Files uploaded while editing a category page will be added to that category
$wgMSU_checkAutoCat = true; // Whether the checkbox for adding a category to a page is checked by default
$wgMSU_useMsLinks = false; // Insert links in Extension:MsLinks style?
$wgMSU_confirmReplace = true; // Show the “Replace file?” checkbox
$wgMSU_imgParams = ‘400px’; // The default size for images inserted on the edit page
$wgEnableWriteAPI = true; // Enable the API
$wgEnableUploads = true; // Enable uploads
$wgAllowJavaUploads = true; // Solves problem with Office 2007 and newer files (docx, xlsx, etc.)
$wgGroupPermissions[‘user’][‘upload’] = true; // Allow regular users to upload files
$wgDefaultUserOptions[‘usebetatoolbar’] = 1;
End of automatically generated settings.
Add more configuration options below.
##################################################################################
This should complete the editing of the LocalSettings.php file, save the changes and reload apache2
systemctl restart apache2
(optional) you can see the status of the apache2 process with
systemctl status apache2
This should complete the upgrade. Log into the Wiki server and try the standard and visual editors
#################################################################################