I have a MediaWiki installation in my Home Lab. It is for my own internal purpose. There are many sensitive information. So there is no way to access it from the Internet.

The MediaWiki installation was 1.39.2.

MediaWiki 1.39.2
MediaWiki 1.39.2

To upgrade the MediaWiki, there are some important procedures that have to be followed.

Backup Database and the existing folder

I SSH to the server and use mysqldump command to back up the database.

Then, I use tar command to pack the whole wiki folder.

Download and unpack the new file

cd ~/temp/
wget https://releases.wikimedia.org/mediawiki/1.40/mediawiki-1.40.0.tar.gz
tar -xvzf mediawiki-1.40.0.tar.gz
rm mediawiki-1.40.0.tar.gz

Move and copy the files

cd ~/mysite/
mv wiki wiki.1.39.2
mkdir wiki
cd ~/temp/mediawiki-1.40.0
cp * -R ~/mysite/wiki/
cd ../wiki.1.39.2/
cp LocalSettings.php ../wiki/
cd ./images/
cp * -R ~/mysite/wiki/images/
cd ~/mysite/wiki/
chmod 777 -R images

Here, I move the old MediaWiki 1.39.2 folder to a temporary folder. Make a new folder wiki.

Copy the configuration settings file to the folder wiki.

Copy the images folder to the new wiki folder.

Install the new version of Extensions

I checked my extensions folder. There are some extensions installed by myself. Such as AdvancedSearch, CirrusSearch, Elastica, RenameUser, LocalisationUpdate.

I go to the official site and look at each of these extensions. LocalisationUpdate is abandoned. So delete it.

I keep them all the latest versions by downloading and installing them on the wiki extensions folder.

Run the update Script

cd ~/mysite/wiki/maintenance/
php update.php

It is done.

MediaWiki 1.40.0
MediaWiki 1.40.0

Add MobileFriendly skin

MinervaNeue skin is already included in MediaWiki 1.40. So I just need to add the following to LocalSettings.php file:
wfLoadSkin( 'MinervaNeue' );

And to make it work when users view the Wiki site with mobile phones, I installed the extension MobileFrontend.

Follow the instruction to download and unpack the file and upload it to the Extensions folder.

Add the following to LocalSettings.php file:

wfLoadExtension( 'MobileFrontend' );
$wgDefaultMobileSkin = 'minerva';

When I use a mobile device to browse the Wiki, it looks like this.

Mobile view
Minerva Neue Skin, Mobile device

It looks nice.

The Desktop looks as below:

Desktop Vector skin
Vector skin


David Yin

David is a blogger, geek, and web developer — founder of FreeInOutBoard.com. If you like his post, you can say thank you here

Leave a Reply

Your email address will not be published. Required fields are marked *