Upgrade wiki
From PTAGISWiki
Locate the latest version of mediawiki and download:
Lock out edits on the original wiki
// temporarily disable all edits // this is useful when the wiki is being updated $wgGroupPermissions['*']['edit'] = false; $wgGroupPermissions['user']['edit'] = false; $wgGroupPermissions['sysop']['edit'] = false;
Backup the existing wiki database
- Backup wiki (takes about 1 min)
Gunzip and untar the package to bay:/usr/local/ptagis/wiki
Copy the existing extensions from the current wiki to the new wiki
Copy the existing images from the current wiki to the new wiki (the upload and temp directories)
- rsync -av ../wiki/images/* images/
Copy the existing LocalSettings.php to the new wiki
Copy the existing AdminSettings.php to the new wiki
Create a new mysql database for the new wiki version with http://bay.psmfc.org/phpMyAdmin/
Restore the existing wiki database (ptagiswiki) to a new database named ptagiswiki-version, ie. ptagiswiki17 for version 1.7 (takes about 5 min)
- This tests the backup as well as preparing for the new version.
Edit the LocalSettings.php to
- set $wgDBname to the ptagiswiki17 database
- set $IP to full directory name instead of the symlink "wiki", ie. mediawiki-1.7.1
- set $wgScriptPath to "/mediawiki-1.7.1"
give privileges to wikiuser@% on database ptagiswiki17
give wikiadmin user privileges to alter structure on database ptagiswiki17
follow any version-specific upgrade directions.
- run the command line update script in maintenance: php update.php (takes about 15 min)
Manually re-restrict the list of restricted pages
Copy the PTAGIS logo to front page
- copy image to /wiki/skins/common/images/ptagis.org_hor2.gif
Remove edit lockout in LocalSettings.php ($wgGroupPermissions)
Contents |
Issues
We make use of an access restriction patch that is no longer supported by mediawiki. (Note: see below for the real extension/patch that we use for page restriction and its status.) It looks like an equivalent extension is Group Based Access Control (http://www.mediawiki.org/wiki/Extension:Group_Based_Access_Control)
I attempted to use the most recent version of our old restriction patch, but it was for version 1.6.8 and I couldn't make it work.
Installed the Group Based Access Control extension in a test wiki. It appears to work, but searching is broken. All searches return "no access" for anonymous users. If you are logged in, a search returns a fatal error. Actually, trying to view a protected page returns a fatal error as well.
Catchable fatal error: Argument 1 passed to Article::__construct() must be an instance of Title, string given, called in /usr/local/pitweb/ptagis/wiki/mediawiki-1.13.3-restricted/extensions/accesscontrol.php on line 204 and defined in /usr/local/pitweb/ptagis/wiki/mediawiki-1.13.3-restricted/includes/Article.php on line 47
Everything but search works if I set wgWikiVersion to 1.8. I get the fatal errors if I am honest and set the version to 1.13.
I tried opting to use the mediawiki groups instead of the Usergroup pages, but the behavior is the same (all anonymous searches result in No Access).
The Group Based Access Control extension doesn't seem to be very robust according to the comments posted on the authors page (http://blog.pagansoft.de/index.php?/archives/27-Version-0.8-of-AccessControl-Extension-for-MediaWiki.html).
The IT wiki is working at version 1.6.7 with page restrictions. The current version of that release is 1.6.11. I should probably just stay at the 1.6 level.
I just found the updated version of our restricted pages patch. Thank goodness it is still maintained. http://www.mediawiki.org/wiki/Extension:Page_access_restriction The most recent version of the patch is for mediawiki-1.13.2, so I'll install that and proceed with the upgrade from there.
Installed 1.13.2, copied in the local config files, ran the update.php, then left for vacation. Need to pick up from here.
The upgrade.php finished without errors. The 1.13.2 wiki is functional, but has no images.
I applied the patch for adding page restriction:
bash-3.00# pwd /usr/local/pitweb/ptagis/wiki bash-3.00# /usr/local/bin/patch -p0 < mediawiki-1.13.2-restrict-0.8.4.patch patching file mediawiki-1.13.2/README.restriction-patch patching file mediawiki-1.13.2/includes/Article.php patching file mediawiki-1.13.2/includes/DefaultSettings.php patching file mediawiki-1.13.2/includes/Export.php patching file mediawiki-1.13.2/includes/LogPage.php patching file mediawiki-1.13.2/includes/OutputHandler.php patching file mediawiki-1.13.2/includes/OutputPage.php patching file mediawiki-1.13.2/includes/QueryPage.php patching file mediawiki-1.13.2/includes/Skin.php patching file mediawiki-1.13.2/includes/SkinTemplate.php patching file mediawiki-1.13.2/includes/SpecialPage.php patching file mediawiki-1.13.2/includes/Title.php patching file mediawiki-1.13.2/includes/User.php patching file mediawiki-1.13.2/includes/Wiki.php patching file mediawiki-1.13.2/includes/parser/Parser.php patching file mediawiki-1.13.2/includes/parser/Parser_OldPP.php patching file mediawiki-1.13.2/includes/specials/SpecialAllmessages.php patching file mediawiki-1.13.2/includes/specials/SpecialAllpages.php patching file mediawiki-1.13.2/includes/specials/SpecialAncientpages.php patching file mediawiki-1.13.2/includes/specials/SpecialBrokenRedirects.php patching file mediawiki-1.13.2/includes/specials/SpecialCategories.php patching file mediawiki-1.13.2/includes/specials/SpecialContributions.php patching file mediawiki-1.13.2/includes/specials/SpecialDisambiguations.php patching file mediawiki-1.13.2/includes/specials/SpecialDoubleRedirects.php patching file mediawiki-1.13.2/includes/specials/SpecialImagelist.php patching file mediawiki-1.13.2/includes/specials/SpecialListredirects.php patching file mediawiki-1.13.2/includes/specials/SpecialLog.php patching file mediawiki-1.13.2/includes/specials/SpecialMIMEsearch.php patching file mediawiki-1.13.2/includes/specials/SpecialMostcategories.php patching file mediawiki-1.13.2/includes/specials/SpecialMostlinked.php patching file mediawiki-1.13.2/includes/specials/SpecialMostlinkedcategories.php patching file mediawiki-1.13.2/includes/specials/SpecialMostrevisions.php patching file mediawiki-1.13.2/includes/specials/SpecialNewimages.php patching file mediawiki-1.13.2/includes/specials/SpecialNewpages.php patching file mediawiki-1.13.2/includes/specials/SpecialPopularpages.php patching file mediawiki-1.13.2/includes/specials/SpecialPrefixindex.php patching file mediawiki-1.13.2/includes/specials/SpecialRandompage.php patching file mediawiki-1.13.2/includes/specials/SpecialRecentchangeslinked.php patching file mediawiki-1.13.2/includes/specials/SpecialRestrictedpages.php patching file mediawiki-1.13.2/includes/specials/SpecialSearch.php patching file mediawiki-1.13.2/includes/specials/SpecialShortpages.php patching file mediawiki-1.13.2/includes/specials/SpecialUnusedcategories.php patching file mediawiki-1.13.2/includes/specials/SpecialUnwatchedpages.php patching file mediawiki-1.13.2/includes/specials/SpecialVersion.php patching file mediawiki-1.13.2/languages/messages/MessagesCa.php patching file mediawiki-1.13.2/languages/messages/MessagesCs.php patching file mediawiki-1.13.2/languages/messages/MessagesDe.php patching file mediawiki-1.13.2/languages/messages/MessagesEn.php patching file mediawiki-1.13.2/languages/messages/MessagesEs.php patching file mediawiki-1.13.2/languages/messages/MessagesFi.php patching file mediawiki-1.13.2/languages/messages/MessagesFr.php patching file mediawiki-1.13.2/languages/messages/MessagesHe.php patching file mediawiki-1.13.2/languages/messages/MessagesNl.php patching file mediawiki-1.13.2/languages/messages/MessagesPl.php patching file mediawiki-1.13.2/languages/messages/MessagesRu.php patching file mediawiki-1.13.2/languages/messages/MessagesSv.php bash-3.00#
Now the wiki is working at the 1.13.2 revision level with page restriction. However, the list of restricted pages has been lost and all pages are unrestricted. I'll have to manually re-restrict each of the 71 restricted pages. Not a terribly big deal, but somewhat bothersome.
upgrade from 1.5.6 to 1.7.1
bay.psmfc.org:C1:root: > php update.php MediaWiki 1.7.1 Updater Going to run database updates for ptagiswiki17 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. Creating transcache table...ok ...trackbacks table already exists. Creating externallinks table...ok Creating job table...ok Creating langlinks table...ok Creating querycache_info table...ok Creating filearchive 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. ...have user_email_token field in user table. Adding user_registration field to table user...ok ...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. Adding ipb_range_start field to table ipblocks...ok Adding ss_images field to table site_stats...ok ...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... ok ...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. Creating templatelinks table... Populating... Done. Please run maintenance/refreshLinks.php for a more thorough templatelinks update. 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. Making wl_notificationtimestamp nullable... ok Adding timestamp key on logging table... ok Setting page_random to a random value on rows where it equals 0...changed 0 rows Initialising "MediaWiki" namespace... Clearing message cache...Done. Done. ld.so.1: php: fatal: relocation error: file /usr/local/bin/php: symbol xmlRelaxNGCleanupTypes: referenced symbol not found Killed
upgrade from 1.5.6 to 1.13.3
bash-3.00# php update.php MediaWiki 1.13.3 Updater Going to run database updates for wiki13-mw_ Depending on the size of your database this may take a while! Abort with control-c in the next five seconds...0 ...have ipb_id field in ipblocks table. ...have ipb_expiry field in ipblocks table. ...already have interwiki table ...indexes seem up to 20031107 standards ...hitcounter table already exists. ...have rc_type field in recentchanges table. ...have user_real_name field in user table. ...querycache table already exists. ...objectcache table already exists. ...categorylinks table already exists. Already have pagelinks; skipping old links table updates. ...have rc_ip field in recentchanges table. ...image primary key already set. ...have rc_id field in recentchanges table. ...have rc_patrolled field in recentchanges table. ...logging table already exists. ...have user_token field in user table. The watchlist table is already set up for email notification. Adding missing watchlist talk page rows... ok ...user table does not contain old email authentication field. ...page table already exists. ...have log_params field in logging table. logging table has correct log_title encoding. ...have ar_rev_id field in archive table. ...have page_len field in page table. revision timestamp indexes already up to 2005-03-13 ...rev_text_id already in place. ...have rev_deleted field in revision table. ...have img_width field in image table. ...have img_metadata field in image table. ...have user_email_token field in user table. ...have ar_text_id field in archive table. ...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)). ...have img_media_type field in image table. ...already have pagelinks table. 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. ...have ss_total_pages field in site_stats table. ...user_newtalk table already exists. Creating transcache table...ok ...have iw_trans field in interwiki table. ...trackbacks table already exists. Making wl_notificationtimestamp nullable... ok Adding timestamp key on logging table... ok Adding ipb_range_start field to table ipblocks...ok Setting page_random to a random value on rows where it equals 0...changed 0 rows Adding user_registration field to table user...ok Creating templatelinks table... Populating... Done. Please run maintenance/refreshLinks.php for a more thorough templatelinks update. Creating externallinks table...ok Creating job table...ok Adding ss_images field to table site_stats...ok Creating langlinks table...ok Creating querycache_info table...ok Creating filearchive table...ok Adding ipb_anon_only field to table ipblocks...ok Checking for additional recent changes indices... ...index `rc_ns_usertext` not found; adding...done. ...index `rc_user_text` not found; adding...done. Adding user_newpass_time field to table user...ok Creating redirect table...ok Creating querycachetwo table...ok Adding ipb_enable_autoblock field to table ipblocks...ok Checking for backlinking indices... Checking if pagelinks index pl_namespace includes field pl_from... ...index pl_namespace on table pagelinks has no field pl_from; adding ...backlinking indices updated Adding rc_old_len field to table recentchanges...ok Adding user_editcount field to table user...ok Creating page_restrictions table...ok Migrating old restrictions to new table...ok Adding log_id field to table logging...ok Adding rev_parent_id field to table revision...ok ...have pr_id field in page_restrictions table. Adding rev_len field to table revision...ok Adding rc_deleted field to table recentchanges...ok Adding log_deleted field to table logging...ok Adding ar_deleted field to table archive...ok Adding ipb_deleted field to table ipblocks...ok Adding fa_deleted field to table filearchive...ok Adding ar_len field to table archive...ok Adding ipb_block_email field to table ipblocks...ok Checking for categorylinks indices... Checking if categorylinks index cl_sortkey includes field cl_from... ...index cl_sortkey on table categorylinks has no field cl_from; adding ...categorylinks indices updated Adding oi_metadata field to table oldimage...ok Adding usertext,timestamp key on archive table... ok Adding usertext,timestamp key on image table... ok Adding usertext,timestamp key on oldimage table... ok Adding ar_page_id field to table archive...ok Adding img_sha1 field to table image...ok Creating protected_titles table...ok Adding ipb_by_text field to table ipblocks...ok Creating page_props table...ok Creating updatelog table...ok Creating category table...ok Populating category table, printing progress markers. For large databases, you may want to hit Ctrl-C and do this manually with maintenance/ populateCategory.php. Category population complete. Done populating category table. Adding ar_parent_id field to table archive...ok Adding user_last_timestamp field to table user_newtalk...ok Populating rev_parent_id column ...doing rev_id from 1 to 200 ...doing rev_id from 200 to 399 ...doing rev_id from 399 to 598 ...doing rev_id from 598 to 797 ...doing rev_id from 797 to 996 ...doing rev_id from 996 to 1195 ...doing rev_id from 1195 to 1394 ...doing rev_id from 1394 to 1593 ...doing rev_id from 1593 to 1792 ...doing rev_id from 1792 to 1991 ...doing rev_id from 1991 to 2190 ...doing rev_id from 2190 to 2389 ...doing rev_id from 2389 to 2588 ...doing rev_id from 2588 to 2787 ...doing rev_id from 2787 to 2986 ...doing rev_id from 2986 to 3185 ...doing rev_id from 3185 to 3384 ...doing rev_id from 3384 to 3583 ...doing rev_id from 3583 to 3782 ...doing rev_id from 3782 to 3981 ...doing rev_id from 3981 to 4180 ...doing rev_id from 4180 to 4379 ...doing rev_id from 4379 to 4578 ...doing rev_id from 4578 to 4777 ...doing rev_id from 4777 to 4976 ...doing rev_id from 4976 to 5175 ...doing rev_id from 5175 to 5374 ...doing rev_id from 5374 to 5573 ...doing rev_id from 5573 to 5772 ...doing rev_id from 5772 to 5971 ...doing rev_id from 5971 to 6170 ...doing rev_id from 6170 to 6369 ...doing rev_id from 6369 to 6568 ...doing rev_id from 6568 to 6767 ...doing rev_id from 6767 to 6966 ...doing rev_id from 6966 to 7165 ...doing rev_id from 7165 to 7364 ...doing rev_id from 7364 to 7563 ...doing rev_id from 7563 to 7762 ...doing rev_id from 7762 to 7961 ...doing rev_id from 7961 to 8160 ...doing rev_id from 8160 to 8359 ...doing rev_id from 8359 to 8558 ...doing rev_id from 8558 to 8757 ...doing rev_id from 8757 to 8956 ...doing rev_id from 8956 to 9155 ...doing rev_id from 9155 to 9354 ...doing rev_id from 9354 to 9553 ...doing rev_id from 9553 to 9752 ...doing rev_id from 9752 to 9951 ...doing rev_id from 9951 to 10150 ...doing rev_id from 10150 to 10349 ...doing rev_id from 10349 to 10548 ...doing rev_id from 10548 to 10747 ...doing rev_id from 10747 to 10946 ...doing rev_id from 10946 to 11145 ...doing rev_id from 11145 to 11344 ...doing rev_id from 11344 to 11543 ...doing rev_id from 11543 to 11742 ...doing rev_id from 11742 to 11941 ...doing rev_id from 11941 to 12140 ...doing rev_id from 12140 to 12339 ...doing rev_id from 12339 to 12538 ...doing rev_id from 12538 to 12737 ...doing rev_id from 12737 to 12936 ...doing rev_id from 12936 to 13135 ...doing rev_id from 13135 to 13334 ...doing rev_id from 13334 to 13533 ...doing rev_id from 13533 to 13732 ...doing rev_id from 13732 to 13931 ...doing rev_id from 13931 to 14130 ...doing rev_id from 14130 to 14329 ...doing rev_id from 14329 to 14528 ...doing rev_id from 14528 to 14727 ...doing rev_id from 14727 to 14926 ...doing rev_id from 14926 to 15125 ...doing rev_id from 15125 to 15324 ...doing rev_id from 15324 to 15523 ...doing rev_id from 15523 to 15722 ...doing rev_id from 15722 to 15921 ...doing rev_id from 15921 to 16120 ...doing rev_id from 16120 to 16319 ...doing rev_id from 16319 to 16518 ...doing rev_id from 16518 to 16717 ...doing rev_id from 16717 to 16916 ...doing rev_id from 16916 to 17115 ...doing rev_id from 17115 to 17314 ...doing rev_id from 17314 to 17513 rev_parent_id population complete ... 16817 rows [11511 changed] protected_titles table has correct pt_title encoding. Checking filearchive indices... ...filearchive indices updated Updating password hash format...done Deleting old default messages (this may take a long time!)...Done Checking site_stats row...ok. Purging caches...done. Done.
upgrade from 1.5.6 to 1.6.11
bash-3.00# php update.php MediaWiki 1.6.11 Updater Going to run database updates for wiki16 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 ...trackbacks table already exists. Creating externallinks table...ok Creating job 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. ...have user_email_token field in user table. Adding user_registration field to table user...ok ...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. Adding ipb_range_start field to table ipblocks...ok Adding ss_images field to table site_stats...ok ...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... ok ...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. Creating templatelinks table... Populating... Done. Please run maintenance/refreshLinks.php for a more thorough templatelinks update. 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. Making wl_notificationtimestamp nullable... ok Adding timestamp key on logging table... ok Setting page_random to a random value on rows where it equals 0...changed 0 rows Initialising "MediaWiki" namespace... Clearing message cache...Done. Done.
