Upgrade

From Biodiversity of India
Jump to: navigation, search

Upgrading MediaWiki to next version

I am documenting all the steps that we followed to upgrade from mediawiki 1.15 to 1.17. An official upgrading guide can be found here Important steps in upgrading are

  • Check Requirements
  • Backup Everything
  • Download and extract upgrade
  • Run the upgrade.php
  • Fix problems

Check Requirements

First, you need to test whether you have required versions of softwares installed. In our case, your primary concerns should be php and mysql. Technically, if you contact the web-hosting service they should be able to tell you the version numbers. To manually test them, first login to your server using ssh.

  • To check current version of php, run the following command in the terminal:

php --version

It returns something like :

PHP 5.2.17 (cli) (built: Jun 28 2011 17:39:50)
Copyright (c) 1997-2010 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2010 Zend Technologies
with Zend Extension Manager v1.2.2, Copyright (c) 2003-2007, by Zend Technologies
with Zend Optimizer v3.3.9, Copyright (c) 1998-2009, by Zend Technologies

Version is highlighted in bold text

  • To check current version of mysql, run the following command in the terminal:

mysql --version

This returns:

mysql Ver 14.12 Distrib 5.0.51a, for debian-linux-gnu (x86_64) using readline 5.2

Version is highlighted in bold text

Backup

The two most important things that you need to back up are

  • Database
 To back up the database, use the following mysql command :

mysqldump -u USERNAME -p --all-databases -h DB_SERVER_NAME > BACKUP_FILENAME

You can find values for USERNAME, DB_SERVER_NAME and password from LocalSettings.php file. BACKUP_FILENAME is totally up to you. It is generally a good idea to include the backup date in the filename. Once the command is successful just copy the back up file to your local disk using FTP.

  • Files (such as php scripts, images, everything you can imagine)

The most straightforward way of doing this is to copy the entire directory tree using FTP on to your local disk.

Download and Extract the update

Download the required version(1.17 in my case) from the mediawiki website. The latest version can be found at this link.

The downloaded program can be extracted directly into your mediawiki installation directory. Or else you can manually extract it in some temporary folder and then copy it to the main folder. Use following command to extract the files. tar xvfz TGZ_FILE -C DESTINATION_FOLDER

Once you copy all the files, you just need to run the update.php script from the maintenance folder. Use following command to do it. cd maintenance php update.php

The script takes a few seconds. So leave it alone. Once it terminates, you are done. The basic upgrade is over.

Fix problems

Skin

The one problem which we will ALWAYS encounter is skin. In our case, the "modern" skin was over-written to make brahma skin. Hence, we will always have issues with the skin being overwritten again. So you may have to manually copy all the files in skin/modern/ from your backup. I am going to try and create a new skin called "brahma" to fix this problem. ETA unknown.

Update Even after copying the skin files, the original skin is not completely restored. I do not know why. One of the image files (header-left.jpg) is not rendering at all.

Update Ok So the upgrade over-writes some of the scripts as well. they are in ./skin/folder. In our case, the scripts we need to worry are Modern.php and Modern.dep.php. Be on a lookout for possible changes in CSS files.

Broken functions

  • Gallery tags did not work. Instead of a nice gallery, it started showing a bulleted list of images.
  • $wgEnableMWsuggest function stopped working for some reason.
  • Also upgraded SMW to 1.6. In the table result format, the columns stopped being sortable. However, class=wikitable still shows the arrows at the top of the table for sorting. Is fixed in SMW 1.7 which should be released in late 2011. Gauravm 06:34, 16 November 2011 (PST)

Gauravm 05:11, 11 November 2011 (PST)