升级MediaWiki 1.4.15到1.5.8

因为服务器系统的关系,想将LVS知识库从MediaWiki 1.4.15升级到1.5.8。

按照文档中提示,备份数据库和文档,覆盖代码文件,修改LocalSettings,最后运行"php update.php",但是在改变watchlist表时总是失败。

[root@dragon maintenance]# php update.php
Content-type: text/html
X-Powered-By: PHP/4.3.2
 
Going to run database updates for lvskb
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.
...validate table already exists.
...user_newtalk table already exists.
...transcache table already exists.
...trackbacks 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 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 val_ip field in validate table.
...have ss_total_pages field in site_stats table.
...have iw_trans field in interwiki 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.
Adding missing watchlist talk page rows... A database error has occurred
Query: INSERT IGNORE INTO `watchlist` (wl_user,wl_namespace,wl_title,wl_notificationtimestamp)
SELECT wl_user,wl_namespace | 1,wl_title,wl_notificationtimestamp FROM `watchlist` WHERE (NOT 
(wl_namespace & 1))
Function: do_watchlist_update
Error: 1066 Not unique table/alias: 'watchlist' (localhost)
 
Backtrace:
GlobalFunctions.php line 450 calls wfbacktrace()
Database.php line 397 calls wfdebugdiebacktrace()
Database.php line 347 calls database::reportqueryerror()
Database.php line 1268 calls database::query()
updaters.inc line 195 calls database::insertselect()
updaters.inc line 677 calls do_watchlist_update()
update.php line 31 calls do_all_updates()

怎么试都不行,转而想到看升级到先前的1.5.x版本行不行,于是挑了1.5.5。重复升级步骤,升级成功。;)

[root@dragon maintenance]# php update.php
Content-type: text/html
X-Powered-By: PHP/4.3.2
 
Going to run database updates for lvskb
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.
...validate table already exists.
...user_newtalk table already exists.
Creating transcache table...ok
Creating trackbacks table...ok
...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.
Adding user_email_token field to table user...ok
...have log_params field in logging table.
Adding ar_rev_id field to table archive...ok
Adding ar_text_id field to table archive...ok
...page table does not exist, skipping new field patch
...revision table does not exist, skipping new field patch
Adding img_width field to table image...ok
Adding img_metadata field to table image...ok
Adding img_media_type field to table image...ok
Adding val_ip field to table validate...ok
...have ss_total_pages field in site_stats table.
Adding iw_trans field to table interwiki...ok
...already have interwiki table
...indexes seem up to 20031107 standards
Converting links table to ID-ID...
Schema already converted
...image primary key already set.
Adding wl_notificationtimestamp field for email notification management.ok
...user table does not contain old email authentication field.
Logging table has correct title encoding.
...converting from cur/old to page/revision/text DB structure.
1148793565......checking for duplicate entries.
1148793565......Creating tables.
1148793565......Locking tables.
1148793565......maxold is 1625
1148793565......Moving text from cur.
1148793566......Setting up revision table.
1148793566......Setting up page table.
1148793566......Unlocking tables.
1148793566......Renaming old.
1148793566...done.
revision timestamp indexes already up to 2005-03-13
Adding rev_text_id field... ok
...page_namespace is already a full int (int(11)).
Promoting ar_namespace from tinyint(2) unsigned to int... ok
Promoting rc_namespace from tinyint(3) to int... ok
Promoting wl_namespace from tinyint(2) unsigned to int... ok
Promoting qc_namespace from tinyint(2) unsigned to int... ok
Promoting log_namespace from tinyint(3) unsigned to int... ok
Converting links and brokenlinks tables to pagelinks... ok
Cleaning up broken links for namespace -2... ok
Cleaning up broken links for namespace -1... ok
Cleaning up broken links for namespace 1... ok
Cleaning up broken links for namespace 2... ok
Cleaning up broken links for namespace 3... ok
Cleaning up broken links for namespace 4... ok
Cleaning up broken links for namespace 5... ok
Cleaning up broken links for namespace 6... ok
Cleaning up broken links for namespace 7... ok
Cleaning up broken links for namespace 8... ok
Cleaning up broken links for namespace 9... ok
Cleaning up broken links for namespace 10... ok
Cleaning up broken links for namespace 11... ok
Cleaning up broken links for namespace 12... ok
Cleaning up broken links for namespace 13... ok
Cleaning up broken links for namespace 14... ok
Cleaning up broken links for namespace 15... ok
No img_type field in image table; Good.
Checking for duplicate accounts...
Found 0 accounts with duplicate records on lvskb.
 
It is now safe to apply the unique index on user_name.
Adding unique index on user_name... ok
Adding user_groups table... ok
Converting user_rights table to user_groups... ok
Initialising "MediaWiki" namespace...
Clearing message cache...Done.
Done.

大概是1.5.8中的升级程序update.php有点问题。文档中说1.5系列的数据库模板是一样的,所以直接将程序升级到1.5.8,不再运行update.php。

randomness