Difference between revisions of "MediaWiki/Upgrade/REL1 25 to REL1 26"
m (Freephile moved page MediaWiki/Upgrade/REL1 25 to REL1 26 to MediaWiki/Upgrade/REL1 25 to REL1 26: organize) |
|||
(18 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
+ | === Overview === | ||
+ | |||
Last updated in 2008, it was time to revisit this page and make some new notes. Even though the README, UPGRADE and online help are very detailed, I find it helpful to note my personal preferences, observations, and clarifications. Still, for the do-it-yourself types, the [[mw:Manual:Upgrading#Using_Git|official docs]] are the best resource. If you need professional help with MediaWiki, then contact [[User:Freephile|Greg Rundlett]] | Last updated in 2008, it was time to revisit this page and make some new notes. Even though the README, UPGRADE and online help are very detailed, I find it helpful to note my personal preferences, observations, and clarifications. Still, for the do-it-yourself types, the [[mw:Manual:Upgrading#Using_Git|official docs]] are the best resource. If you need professional help with MediaWiki, then contact [[User:Freephile|Greg Rundlett]] | ||
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 follow the same practice and run off either the latest release branch or master from the [[git]] repository. So, I simply did a <code>composer update --no-dev && git fetch</code> to prepare for an upgrade. | 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 follow the same practice and run off either the latest release branch or master from the [[git]] repository. So, I simply did a <code>composer update --no-dev && git fetch</code> to prepare for an upgrade. | ||
− | == Consult the release notes == | + | === Consult the release notes === |
− | Before doing anything, stop and consult the | + | 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, | 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. There was a lot here, although nothing that impacted the function of my installation. | 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 and testing ground. | I copied my filesystem as a backup and testing ground. | ||
Line 16: | Line 18: | ||
For the database, I have a backup script that in addition to timed backups, will create a spot backup on demand: <code>~/bin/backup.db.sh mediawiki</code> | For the database, I have a backup script that in addition to timed backups, will create a spot backup on demand: <code>~/bin/backup.db.sh mediawiki</code> | ||
− | == Perform the file upgrade == | + | === Perform the file upgrade === |
− | + | The mechanism for loading extensions has changed, so the old 'requires' can be replaced by 'wfLoadExtension' function <code>require_once\( *"\$IP/extensions/.*/([^/]*)" * \); wfLoadExtension( '\1' );</code> | |
With the software downloaded (git fetch), and a check to see if you've modified anything (git status), you can simply switch the branch you're on <code>git checkout -b REL1_26 origin/REL1_26</code> and then do the database upgrade. | With the software downloaded (git fetch), and a check to see if you've modified anything (git status), you can simply switch the branch you're on <code>git checkout -b REL1_26 origin/REL1_26</code> and then do the database upgrade. | ||
Line 24: | Line 26: | ||
You must preserve: | You must preserve: | ||
− | + | * The LocalSettings.php file | |
− | + | * DatabaseSettings 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. | If using an alternative uploads directory, preserve this; and if using custom skins, preserve these too. The core code is now updated. | ||
− | == Perform the database upgrade == | + | === Perform the database upgrade === |
+ | |||
+ | 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 | From the command line, browse to the maintenance directory and run the | ||
Line 44: | Line 49: | ||
</pre> | </pre> | ||
− | == Check configuration settings == | + | === Check configuration settings === |
The names of configuration variables, and their default values and purposes, | The names of configuration variables, and their default values and purposes, | ||
Line 50: | Line 55: | ||
with $wgEnableUploads in later versions. When upgrading, consult the release | with $wgEnableUploads in later versions. When upgrading, consult the release | ||
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. | |
− | == Change the wiki pointer == | + | === Change the wiki pointer === |
− | In order to quickly upgrade, revert or take the site offline, you can simply use a symbolic link and point that to the correct target folder. However, note that this can present problems for your extensions when <code>$IP</code> is not defined correctly | + | In order to quickly upgrade, revert or take the site offline, you can simply use a symbolic link and point that to the correct target folder. However, note that this can present problems for your extensions when <code>$IP</code> is not defined correctly |
− | == Test == | + | === Test === |
It makes sense to test your wiki immediately following any kind of maintenance | It makes sense to test your wiki immediately following any kind of maintenance | ||
Line 62: | Line 67: | ||
and quirks which reveal themselves. | and quirks which reveal themselves. | ||
− | + | === Extension and Skin Upgrades === | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | == Extension and Skin Upgrades == | ||
− | Your MediaWiki site will contain many | + | Your MediaWiki site will contain many extensions to provide extra functionality. You also have one or more skins installed. Those need to be upgraded independently since they are not distributed with the core. The [[Special:Version]] page will list the ones in use, so go through the list one at a time and check for upgrades. |
− | + | If you manage extensions with git but not as submodules, you can fetch the latest updates to the code with something like | |
<source lang="bash"> | <source lang="bash"> | ||
− | |||
− | |||
cd extensions | cd extensions | ||
base=`pwd`; | base=`pwd`; | ||
Line 86: | Line 79: | ||
echo "fetching $ext"; | echo "fetching $ext"; | ||
git fetch; | git fetch; | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
cd $base; | cd $base; | ||
done | done | ||
</source> | </source> | ||
− | Also, if you don't even know whether there are submodules in use, you can search for those by looking for .gitmodules or .git '''files''' <code>find . -type f -name .git</code> | + | Also, if you don't even know whether there are submodules in use, you can search for those by looking for .gitmodules or .git '''files''' <code>find . -type f -name .git</code> |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | == Debug == | + | === Debug === |
When things don't quite work as expected, you're left to figure out why. There are [[mw:Manual:How to debug|several debugging options]] that can assist you. | When things don't quite work as expected, you're left to figure out why. There are [[mw:Manual:How to debug|several debugging options]] that can assist you. | ||
[[Category:Wiki]] | [[Category:Wiki]] |
Revision as of 13:22, 8 January 2016
Contents
Overview[edit | edit source]
Last updated in 2008, it was time to revisit this page and make some new notes. Even though the README, UPGRADE and online help are very detailed, I find it helpful to note my personal preferences, observations, and clarifications. Still, for the do-it-yourself types, the official docs are the best resource. If you need professional help with MediaWiki, then contact Greg Rundlett
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 follow the same practice and run off either the latest release branch or master from the git repository. So, I simply did a composer update --no-dev && git fetch
to prepare for an upgrade.
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 and testing ground.
For the database, I have a backup script that in addition to timed backups, will create a spot backup on demand: ~/bin/backup.db.sh mediawiki
Perform the file upgrade[edit | edit source]
The mechanism for loading extensions has changed, so the old 'requires' can be replaced by 'wfLoadExtension' function require_once\( *"\$IP/extensions/.*/([^/]*)" * \); wfLoadExtension( '\1' );
With the software downloaded (git fetch), and a check to see if you've modified anything (git status), you can simply switch the branch you're on git checkout -b REL1_26 origin/REL1_26
and then do the database upgrade.
You must preserve:
- The LocalSettings.php file
- DatabaseSettings 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.
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, you can simply use a symbolic link and point that to the correct target folder. However, note that this can present problems for your extensions when $IP
is not defined correctly
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.
Extension and Skin Upgrades[edit | edit source]
Your MediaWiki site will contain many extensions to provide extra functionality. You also have one or more skins installed. Those need to be upgraded independently since they are not distributed with the core. The Special:Version page will list the ones in use, so go through the list one at a time and check for upgrades.
If you manage extensions with git but not as submodules, you can fetch the latest updates to the code with something like
cd extensions
base=`pwd`;
for ext in `find . -type d -name .git | sed 's/.git//' `; do
cd $ext;
echo "fetching $ext";
git fetch;
cd $base;
done
Also, if you don't even know whether there are submodules in use, you can search for those by looking for .gitmodules or .git files find . -type f -name .git
Debug[edit | edit source]
When things don't quite work as expected, you're left to figure out why. There are several debugging options that can assist you.