Difference between revisions of "MediaWiki/Upgrade/REL1 25 to REL1 26"

From Freephile Wiki
Jump to navigation Jump to search
 
(upgraded to HEAD)
Line 1: Line 1:
 
=== Overview ===
 
=== Overview ===
  
I just upgraded my wiki site, and thought I would write down the steps for further reference.  Even though the instructions that come with the source are very detailed, I find it helpful to note my personal preferences, observations, and clarifications where I might not understand the instructions.
+
I just upgraded my wiki site, and thought I would write down the steps for further reference.  Even though the README, UPGRADE and online help are very detailed, I find it helpful to note my personal preferences, observations, and clarifications where I might not understand the instructions.
  
The process obviously started with downloading the source from the web.  I saved it locally to the site where it's installed, above the docroot so that it wasn't accessible to site visitors. I uncompressed it after checking that it wouldn't accidentally overwrite an existing directory.
+
The process obviously started with downloading the source from the web.  However, since the wikipedia project uses the continuous integration method of development (meaning they always run their own latest code), I decided to join that practice and run off SVN trunk. So, I simply did a <code>svn checkout http://svn.wikimedia.org/svnroot/mediawiki/trunk/phase3</code> to get the code.
  
I performed a diff of the entire tree v. my installed copy using the venerable KDiff3 to get an idea of the magnitude of the code changes; to learn by reading some code changes and get a feel for the 'current best practices'.  It also helped me to see what old stuff was deprecated, or that I had lying around as cruft on my filesystem.  I figured that when I updated my files with rsync, I would use the --delete switch to remove any of the cruft on the target.
+
I performed a diff of the entire tree v. my installed copy using the venerable KDiff3 to get an idea of the magnitude of the code changes; to learn by reading some code changes and get a feel for the 'current best practices'.  It also helped me to see what old stuff was deprecated, or that I had lying around as cruft on my filesystem.  Since it had been a long time since my last upgrade, there was a large delta.  I didn't want to or have time to look at all the code improvements so I moved on to the next step.
  
 
=== Consult the release notes ===
 
=== Consult the release notes ===
Line 12: Line 12:
 
version of the software. This detail bug fixes, new features and functionality,
 
version of the software. This detail bug fixes, new features and functionality,
 
and any particular points that may need to be noted during the upgrade
 
and any particular points that may need to be noted during the upgrade
procedure.
+
procedure.  There was a lot here, although nothing that impacted the function of my installation.
  
 
=== Backup first ===
 
=== Backup first ===
  
I copied my filesystem as a backup.  This is not explicitly mentioned in the UPGRADE file, but obvious if you want to be able to revert.
+
I copied my filesystem as a backup.
 
 
I copied my database as a backup.  I noticed that phpMyAdmin failed silently to create a backup because it exhausted the PHP memory limit.  When I say 'failed silently' I mean that it saved the export as a compressed file on my system without complaining, but the contents of that file were the plain-text error message from PHP.  I could have increased the script memory limit, but instead I used mysql-admin.  The Mysql Administrator client had it's own bug, in that one of my prior backup profiles was somehow corrupt (maybe it no longer existed on the filesystem?) and Mysql Administrator would crash whenever I clicked on that profile.  I'll have to figure out if there is a setting file where I can manually remove this 'profile' to prevent further crashes.
 
  
 +
I copied my database as a backup.  I noticed that phpMyAdmin failed silently to create a backup because it exhausted the PHP memory limit.  When I say 'failed silently' I mean that it saved the export as a compressed file on my system without complaining, but the contents of that file were the plain-text error message from PHP.  I could have increased the script memory limit, but instead I found that an uncompressed version of the export would work.  I also could have used mysqldump or the Mysql Administrator client.
  
 
=== Perform the file upgrade ===
 
=== Perform the file upgrade ===
Line 55: Line 54:
 
cd wiki/maintenance/
 
cd wiki/maintenance/
 
ls
 
ls
php ./update.php
+
php -q ./update.php
 
</pre>
 
</pre>
  
Line 65: Line 64:
 
notes to check for configuration changes which would alter the expected
 
notes to check for configuration changes which would alter the expected
 
behaviour of MediaWiki.
 
behaviour of MediaWiki.
 +
 +
=== Change the wiki pointer ===
 +
In order to quickly upgrade, revert or take the site offline, I simply use a symbolic link and point that to the folder that I want.  In order to complete the upgrade, all that was left was to change the target of my wiki symbolic link from phase3_1_7_1 to phase3_1_11
  
 
=== Test ===
 
=== Test ===

Revision as of 21:41, 26 May 2007

Overview[edit | edit source]

I just upgraded my wiki site, and thought I would write down the steps for further reference. Even though the README, UPGRADE and online help are very detailed, I find it helpful to note my personal preferences, observations, and clarifications where I might not understand the instructions.

The process obviously started with downloading the source from the web. However, since the wikipedia project uses the continuous integration method of development (meaning they always run their own latest code), I decided to join that practice and run off SVN trunk. So, I simply did a svn checkout http://svn.wikimedia.org/svnroot/mediawiki/trunk/phase3 to get the code.

I performed a diff of the entire tree v. my installed copy using the venerable KDiff3 to get an idea of the magnitude of the code changes; to learn by reading some code changes and get a feel for the 'current best practices'. It also helped me to see what old stuff was deprecated, or that I had lying around as cruft on my filesystem. Since it had been a long time since my last upgrade, there was a large delta. I didn't want to or have time to look at all the code improvements so I moved on to the next step.

Consult the release notes[edit | edit source]

Before doing anything, stop and consult the release notes supplied with the new version of the software. This detail bug fixes, new features and functionality, and any particular points that may need to be noted during the upgrade procedure. There was a lot here, although nothing that impacted the function of my installation.

Backup first[edit | edit source]

I copied my filesystem as a backup.

I copied my database as a backup. I noticed that phpMyAdmin failed silently to create a backup because it exhausted the PHP memory limit. When I say 'failed silently' I mean that it saved the export as a compressed file on my system without complaining, but the contents of that file were the plain-text error message from PHP. I could have increased the script memory limit, but instead I found that an uncompressed version of the export would work. I also could have used mysqldump or the Mysql Administrator client.

Perform the file upgrade[edit | edit source]

Having downloaded the desired new version of the software, either as a package from SourceForge, or via an export from Subversion, decompress the files as needed, and replace the existing MediaWiki files with the new.

You should preserve:

  • The LocalSettings.php file
  • The AdminSettings.php file, where it exists
  • The extensions directory
  • The images directory

If using an alternative uploads directory, preserve this; and if using custom skins, preserve these too. The core code is now updated.

I did all of those because I do have an 'accessible' skin. The easy way to do the filesystem upgrade is with the rsync command. Besides the filesystem update, you also need to create a AdminSettings.php file with credentials to access your database.

user@host:/path/to/docroot$ rsync -vrc --delete --stats --progress --exclude images/ --exclude extensions/ --exclude LocalSettings.php --exclude skins/disabled/ mediawiki-1.6.1/ wiki


Perform the database upgrade[edit | edit source]

You will need an AdminSettings.php file set up in the correct format; see AdminSettings.sample in the wiki root for more information and examples.

From the command line, browse to the maintenance directory and run the update.php script to check and update the schema. This will insert missing tables, update existing tables, and move data around as needed. In most cases, this is successful and nothing further needs to be done.

cd wiki/maintenance/
ls
php -q ./update.php

Check configuration settings[edit | edit source]

The names of configuration variables, and their default values and purposes, can change between release branches, e.g. $wgDisableUploads in 1.4 is replaced with $wgEnableUploads in later versions. When upgrading, consult the release notes to check for configuration changes which would alter the expected behaviour of MediaWiki.

Change the wiki pointer[edit | edit source]

In order to quickly upgrade, revert or take the site offline, I simply use a symbolic link and point that to the folder that I want. In order to complete the upgrade, all that was left was to change the target of my wiki symbolic link from phase3_1_7_1 to phase3_1_11

Test[edit | edit source]

It makes sense to test your wiki immediately following any kind of maintenance procedure, and especially after upgrading; check that page views and edits work normally and that special pages continue to function, etc. and correct errors and quirks which reveal themselves.