[Mediawiki-l] Problems upgrading from version 1.4 to 1.[89].x

Andreas Tille tillea at rki.de
Thu May 10 12:12:26 UTC 2007


I have to use a mediawiki from one host to an other and want
to use the chance to upgrade the old fashioned 1.4 version
(I'm using the Debian packaged version).  The new machine
is based on SLES9.  While I'm a Debian developer personally
circumstances require to use this system and I mention it
here to make clear that while I'm an experienced Linux user
I'm completely new to SLES - perhaps that matters.

This new hosts has the following components:

    $ mysql --version
    mysql  Ver 14.12 Distrib 5.0.26, for pc-linux-gnu (i686) using readline 5.0

as RPM from "anywhere"

    $ > php --version
    PHP 5.2.0RC4 (cli) (built: Oct 30 2006 13:25:26)
    Copyright (c) 1997-2006 The PHP Group
    Zend Engine v2.2.0, Copyright (c) 1998-2006 Zend Technologies

perhaps from source or binary distribution to /usr/local/bin while

    $ /usr/bin/php --version
    PHP 4.3.4 (cli) (built: Mar  2 2007 21:34:32)
    Copyright (c) 1997-2003 The PHP Group
    Zend Engine v1.3.0, Copyright (c) 1998-2003 Zend Technologies

resides in parallel on this machine.

Moreover the former admin has installed

    MediaWiki 1.8.2 (from October 13, 2006)

under /srv/www/htdocs/wiki.  It would be no problem for me to replace
this installation by tha latest stable mediawiki version if this is
advised and would help in the problem, provided that the LDAP patch
which was manually added will work as flawlessly as in this installation.

I noticed that the former admin did not set an mysql passwd and
you might call me paranoid but I did

     /usr/bin/mysqladmin -u root password 'passwd'

(Perhaps this is the source of my trouble.)

I mysqldumped my wikidb and rsynced it to the new host and inserted
it via

    echo "CREATE DATABASE wikidb;" | mysql
    cat wikidb.dump | mysql wikidb

Now I found in the docs that an upgrade from mediawiki 1.4 to 1.5
requires to change the encoding to UTF8 which can be done using


Because this script failed connecting to the database I (as a
complete PHP beginner) did some print-Hello-World debugging and
found that the root password is not given problem, that I was
able to solve via

--- FiveUpgrade.inc.orig        2007-05-10 14:02:15.436601496 +0200
+++ FiveUpgrade.inc     2007-05-10 14:01:21.893741248 +0200
@@ -65,6 +65,8 @@
                 global $wgDBadminuser, $wgDBadminpassword;
                 global $wgDBserver, $wgDBname;

+# Hack 1
                 $db = new Database( $wgDBserver, $wgDBadminuser, $wgDBadminpassword, $wgDBname );
                 return $db;
@@ -335,7 +337,8 @@

                 $this->log( "Checking cur table for unique title index and applying if necessary" );

-               checkDupes( true );
+# Hack 2
+#              checkDupes( true );

                 $this->log( "...converting from cur/old to page/revision/text DB structure." );

while "Hack 1" enabled me to run the script at all and Hack 2
just skips a step that failed for reasons I can not imagine.
After this the script runned kind of successfully.  I have
no idea at all why the root password was

   1. needed at all if $wgDBuser and $wgDBpassword was given in

   2. not read correctly after even adding
      $wgDBpassword = $wgDBadminpassword = "passwd";
      in ../LocalSettings.php which I tried in a second step.

Anyway I tried to continue with

    $ php update.php
    MediaWiki 1.8.2 Updater

    A connection to the database could not be established. Check the
    values of $wgDBadminuser and $wgDBadminpassword.

which smells like the very same problem with the missing password and
I tried something like "Hack 1" again and patched the root passwd directly
into the code.  This at least helped a little bit:

$ php update.php
MediaWiki 1.8.2 Updater

Going to run database updates for wikidb-wikidb
Depending on the size of your database this may take a while!
Abort with control-c in the next five seconds...0
...hitcounter table already exists.
...querycache table already exists.
...objectcache table already exists.
...categorylinks table already exists.
...logging table already exists.
...user_newtalk table already exists.
...transcache table already exists.
...trackbacks table already exists.
...externallinks table already exists.
...job table already exists.
...langlinks table already exists.
...querycache_info table already exists.
...filearchive table already exists.
...have ipb_id field in ipblocks table.
...have ipb_expiry field in ipblocks table.
...have rc_type field in recentchanges table.
...have rc_ip field in recentchanges table.
...have rc_id field in recentchanges table.
...have rc_patrolled field in recentchanges table.
...have user_real_name field in user table.
...have user_token field in user table.
...have user_email_token field in user table.
...have user_registration field in user table.
...have log_params field in logging table.
...have ar_rev_id field in archive table.
...have ar_text_id field in archive table.
...have page_len field in page table.
...have rev_deleted field in revision table.
...have img_width field in image table.
...have img_metadata field in image table.
...have img_media_type field in image table.
...have ss_total_pages field in site_stats table.
...have iw_trans field in interwiki table.
...have ipb_range_start field in ipblocks table.
...have ss_images field in site_stats table.
...have ipb_anon_only field in ipblocks table.
...already have interwiki table
...indexes seem up to 20031107 standards
Already have pagelinks; skipping old links table updates.
...image primary key already set.
The watchlist table is already set up for email notification.
...watchlist talk page rows already present
...user table does not contain old email authentication field.
Logging table has correct title encoding.
...page table already exists.
revision timestamp indexes already up to 2005-03-13
...rev_text_id already in place.
...page_namespace is already a full int (int(11)).
...ar_namespace is already a full int (int(11)).
...rc_namespace is already a full int (int(11)).
...wl_namespace is already a full int (int(11)).
...qc_namespace is already a full int (int(11)).
...log_namespace is already a full int (int(11)).
...already have pagelinks table.
...templatelinks table already exists
No img_type field in image table; Good.
Already have unique user_name index.
...user_groups table already exists.
...user_groups is in current format.
...wl_notificationtimestamp is already nullable.
...timestamp key on logging already exists.
Setting page_random to a random value on rows where it equals 0...changed 0 rows
Checking for additional recent changes indices...
...seems to be ok
Initialising "MediaWiki" namespace for language code de...
DB connection error: Unknown error (localhost)


Well, now I decided to stop this dirty patching and ask for professional
help here on this list.  Can anybody enlighten me what might went wrong
and how I can move my wikidb to the new server flawlessly?

Kind regards and thanks for any help



More information about the MediaWiki-l mailing list