MediaWiki Upgrade January 2014

From Free Knowledge Base- The DUCK Project: information for everyone
Jump to: navigation, search

MediaWiki Successfully Updated

update completed: 10:02 PM Tuesday, January 28, 2014

Prior to updating the mediawiki, a few things need to be determined.

First, read MediaWiki Upgrade April 2011 for notes on the last mediawiki upgrade.

Refer to Manual:Upgrading

Determine the current version of MediaWiki. You can find the MediaWiki version on your server in the file includes/DefaultSettings.php. It should be a variable assigned somewhere in the first 50 lines or so. (see Upgrade - need to find version)

Determine the MySQL version. Since the last upgrade the MySQL server was independently updated, as was PHP, Apache, and the OS (kernel_

HowTo Backup and Upgrade XXXXXXXXXXXX in MediaWiki

The unedited version of this guide is called versions.txt and stored on roachnet secure.

steps

1. check requirements, all LAMP versions

2. lock mediawiki from writes

  vi /xxxxx/LocalSettings.php
  add the line:
  $wgReadOnly = 'Dumping Database, Access will be restored shortly';
  (the funny thing is that this line did nothing on version 1.16.4)

3. backup wiki files and database

  mysqldump --opt xxxxx --lock-tables -p | gzip > xxxxx2014012801.sql.gz
  php ./dumpBackup.php  --full | gzip > /mediawiki-xxxxx-xmldump.xml.gz
  tar -sp -zcvf /xxxxx/mysql2014012801.tgz /xxxxx/mysql
  tar -sp -zcvf /mediawiki2014012801.tgz /xxxxx/mediawiki

4. download latest mediawiki version

  wget http://download.wikimedia.org/mediawiki/xxx/mediawiki-xxxxx.tar.gz

5. extract to correct path

  tar xzvf mediawiki-xxxxx.gz -C /xxxxx/

6. copy/overwrite some config files

  ln -s mediawiki-xxxxx mediawiki
  cp mediawiki-xxxxx/LocalSettings.php ./mediawiki
  cp -r /xxxxx/mediawiki-xxxxx/images /xxxxx/mediawiki
  xxxxx
  cp -r /xxxxx/mediawiki-xxxxx/extensions /xxxxx/mediawiki (answer "no" to overwrite individual files)
      (the update.php script wouldn't work without copying these extensions first)

7. Run the update script

  php /xxxxx/mediawiki/maintenance/update.php     (this will take awhile)

8. Unlock the wiki

  vi /xxxxx/mediawiki/LocalSettings.php
  remove the line:
  $wgReadOnly = 'Dumping Database, Access will be restored shortly';

9. Once the upgrade has been completed, browse to the wiki and check that the following operations work as expected:

  Viewing pages
  Editing pages
  Uploading a file
  Visit Special:Version and check that the version shown is correct and that the extensions are present.

Testing

Editing text... successful

Carindalinux.png

uploading files... error

fix.. had to change owner of images directory to web daemon.

Special:Version ... ok

Additional Modification

hide SpecialVersion.php

I don't like Special:version being visible unless I need it for testing.

 chmod 000 /xxxxx/mediawiki-xxxxx/includes/specials/SpecialVersion.php

MobileFrontend

MediaWiki does not yet come with mobile device display (wap) built in and enabled by deault.

The extension MobileFrontend has to be downloaded and installed. Once that is done, mbstring needs to be installed as a module to php and enabled. MobileFrontend will not function without PHP having mbstring installed and enabled.

 yum install php-mbstring 
 httpd -k restart

Mobile Pages should not be https

There is a bug in Extension:MobileFrontend that causes the WAP/WML view to sometimes goto https instead of http. We don't want to use SSL for viewing the mobile version of the site.

vi MobileFrontend/includes/MobileContext.php

line 610

$parsedUrl['scheme'] = 'https';

change to

$parsedUrl['scheme'] = 'http';

Later after I corrected the problem I found the following link: HTTPs in Mobile Link View

New user email confirmation not working

First, some lines need to be added to LocalSettings.php

$wgSMTP = array(
        'host'     => "127.0.0.1",
        'IDHost'   => "txxxxx.robotz.com",
        'port'     => xx,
        'auth'     => xxxxx,
);

CentOS includes the pear package for php. Pear is incomplete.

pear install Mail-1.2.0
pear install Net_SMTP

error about ulimit in log

permission to bash internals restricted for this page.

To resolve, I had to directly edit mediawiki-1.22.2/includes/limit.sh

 vi mediawiki-1.22.2/includes/limit.sh