User:Rogerhc/Teflchina upgrade MW 1.16.1 to 1.18.1

Upgrade done on 2012-02-24.

SSH into the server
ssh rogerchrisman.com

cd public_html

Backup files
tar the teflchina dir but copy it to teflchina.2012-02-24.MW-1.16.1 first so the tar will gracefully unpack later without stepping on existing teflchinaorg dir!

cp -a teflchinaorg teflchinaorg.2012-02-24.MW-1.16.1

tar -czvf teflchinaorg.2012-02-24.MW-1.16.1.tgz teflchinaorg.2012-02-24.MW-1.16.1

Get the new MediaWiki 1.18.1 parts in order
Get the new MediaWiki files and copy in -a (so datestamps, permissions, etc are preserved) teflchina's


 * LocalSettings.php
 * images
 * .htaccess
 * robots.txt

w get http://download.wikimedia.org/mediawiki/1.18/mediawiki-1.18.1.tar.gz

("wget" munged to "w get" in these notes so I can save this page w/o 406)

tar -xzvf mediawiki-1.18.1.tar.gz

cp -a teflchinaorg/LocalSettings.php mediawiki-1.18.1/.

cp -a teflchinaorg/robots.txt mediawiki-1.18.1/.

cp -a teflchinaorg/.htaccess mediawiki-1.18.1/.

cp -a teflchinaorg/images mediawiki-1.18.1/.

Edit LocalSettings.php to be happy with new MW
Edit LocalSettings.php so BadBehavior extension is not called (we are using QuestyCaptcha instead), and check for other extensions that we may disable for now, such as DynamicPageList extension (outputs a bulleted list of the most recent items residing in a category, or an intersection of several categories).

cp -a LocalSettings.php LocalSettings.php---2012.02.24.MW-1.16.1

vim LocalSettings.php

Chmod 600 LocalSettings* (if they are not already that way; we do not want others reading our database user password!)

Among other things edited in LocalSettings, note this to got badlogin captcha trigger working (or not, it may only be triggering 5 minute timeout, but I don't know why): $wgMainCacheType = CACHE_DB;
 * 1) Shared memory settings
 * 2) $wgMainCacheType = CACHE_NONE;
 * 3) Roger 24 Feb 2012 change to CACH_DB so that 'badlogin' would trigger
 * 4) ConfirmEdit and $wgPasswordAttemptThrottle
 * 5) See https://forums.dathorn.com/showthread.php?3856-MediaWiki
 * 6) and http://www.mediawiki.org/wiki/Manual:$wgPasswordAttemptThrottle

Consider merging edited LocalSettings.php into new LocalSettings.php from, say, teflpedia.com where I have a MediaWiki 1.18.1 newly created version of LocalSettings.php. It may be good to do this carefully, later.

P A U S E . . . . . . . H E R E
This is a good place to take a break

The next part takes the new wiki live

Once we start the next part, we want to finish and comb out bugs

Freeze wiki
Set wiki read only in LocalSettings

Check that no images have been uploaded since we got images dir above (and get it again now if they have)

Backup database
To backup the database we dump it into a .sql file and give that a helpful name:

mysqldump -p -u roger -h localhost tcdb > roger_tcdb.2012-02-24.MW-1.16.1.sql

roger_tcdb.2012-02-24.MW-1.16.1.sql is the database backup.

To restore to this backup, if necessary we could do:

mysql -p -u roger -h localhost roger_tcdb < roger_tcdb.2012-02-24.MW-1.16.1.sql

(where "localhost" is the MySQL host, database user is "roger" and "roger_tcdb" is the database name and "roger_tcdb.2012-02-24.MW-1.16.1.sql" the backup we want to replace it with)

Updated that database to MediaWiki 1.18.1 compatibility
~/public_html/teflchinaorg/maintenance]# php update.php