Friday, March 23, 2007

Upgrading MediaWiki 1.8.4 to 1.9

I've just upgrade my MediaWiki from 1.8.4 to 1.9.3. Here is step-by-step instruction how I upgrade the Wiki.

  1. Make a full backup of the database.
    From shell,
    mysqldump -u wikidbuser -p --opt
    --databases wikdb > wikidb-backup.sql
    If you don't have insufficient privilege to MySQL database, you might get following errors:
    mysqldump: Got error: 1044: Access denied for
    user 'wikidbuser'@'localhost' to database 'wikidb'
    when using LOCK TABLES
    You may have to use MySQL root account to backup or without --opt option. Since the MediaWiki installation, I've actually used MySQL so I've done full backup.
    mysqldump -u root -p --add-drop-table
    --all-databases > backup.sql
    Of course, you can also use phpMyAdmin to all the work.
  2. Make a backup the MediaWiki directory.
    Make sure at least you backup AdminSettings.php file, LocalSettings.php file, images folder, and extensions directory. I've just done full backup.
    cp -a /var/www/mediawiki
    ~/Backup/mediawiki.backup
  3. Upgrading WikiMedia
    Getting the newest WikiMedia source
    wget http://mirror/mediawiki-1.9.3.tar.gz
    tar xvfz mediawiki-1.9.3.tar.gz
    Updating files
    /bin/cp -R mediawiki-1.9.3.tar.gz /var/www/mediawiki
  4. Run maintenance script.
    cd /var/www/mediawiki/maintenance
    php update.php
    I've just renamed LocalSettings.php and re-run the web installation. And move back LocalSettings.php file. Check Special:Version for MediaWiki version.
  5. Copy back extensions and images folder if necessary.

I've had problem with file permission on MediaWiki files which were own by apache:apache and I was installing from user account. If you have root account, it shouldn't be a problem.

No comments:

Post a Comment