The ScoutWiki Network server was upgraded on November 20th, 2019. The maintenance is now over. Please inform us in Slack or via email support@scoutwiki.org if you encounter any unexpected errors – it's possible the upgrade has missed something. Thanks and happy scoutwiki'ng!

Difference between revisions of "MediaWiki upgrade"

From ScoutWiki Network
Jump to navigation Jump to search
(→‎The upgrade: headers, correct patch command)
 
(75 intermediate revisions by 2 users not shown)
Line 1: Line 1:
Assuming these directories
+
==MediaWiki==
 +
===Minor release===
 +
[https://www.mediawiki.org/wiki/Manual:Upgrading#Using_patch Upgrading using patch]
  
* Current version: /scoutwiki/fi
+
A small patch file is usually made available for a minor version upgrade. Download and extract the patch files.
* Extracted version: /scoutwiki/mediawiki-1.12.0
 
* New version: /scoutwiki/fi-n
 
  
== The upgrade ==
+
# Make a backup of the MediaWiki directory.
 +
#* <code>cp -vr /srv/www/scoutwiki/htdocs-{{#sub:{{CURRENTVERSION}}|0|4}} /srv/www/scoutwiki/htdocs-{{CURRENTVERSION}}</code>
 +
# Change to the MediaWiki directory.
 +
#* <code>cd /srv/www/scoutwiki/htdocs-{{#sub:{{CURRENTVERSION}}|0|4}}</code>
 +
# Download the patch file and gunzip it.
 +
#* <code>wget http://releases.wikimedia.org/mediawiki/{{#sub:{{CURRENTVERSION}}|0|4}}/mediawiki-{{#sub:{{CURRENTVERSION}}|0|4}}.{{#expr: 1 + {{#explode:{{CURRENTVERSION}}|.|2}}}}.patch.gz</code>
 +
#* <code>gunzip mediawiki-{{#sub:{{CURRENTVERSION}}|0|4}}.{{#expr: 1 + {{#explode:{{CURRENTVERSION}}|.|2}}}}.patch.gz</code>
 +
# Use <code>patch -p1 --dry-run</code> to check what will be changed
 +
#* <code>patch -p1 --dry-run < mediawiki-{{#sub:{{CURRENTVERSION}}|0|4}}.{{#expr: 1 + {{#explode:{{CURRENTVERSION}}|.|2}}}}.patch</code>
 +
# If all is well, run patch again without <code>--dry-run</code>.
 +
#* <code>patch -p1 < mediawiki-{{#sub:{{CURRENTVERSION}}|0|4}}.{{#expr: 1 + {{#explode:{{CURRENTVERSION}}|.|2}}}}.patch</code>
 +
# Check the [[Special:Version]] on all ScoutWiki's and you should see the new version number in place.
  
=== Do once ===
+
===Major release===
 +
# Go to the directory with web files
 +
#* <code>cd /srv/www/scoutwiki/</code>
 +
# backup  the database
 +
#* (to be added)
 +
# Download the release file and untar it.
 +
#* <code>wget http://download.wikimedia.org/mediawiki/{{#sub:{{CURRENTVERSION}}|0|2}}{{#expr: 1 + {{#explode:{{CURRENTVERSION}}|.|1}}}}/mediawiki-{{#sub:{{CURRENTVERSION}}|0|2}}{{#expr: 1 + {{#explode:{{CURRENTVERSION}}|.|1}}}}.0.tar.gz</code>
 +
#* <code>tar vxfz mediawiki-{{#sub:{{CURRENTVERSION}}|0|2}}{{#expr: 1 + {{#explode:{{CURRENTVERSION}}|.|1}}}}.0.tar.gz</code>
 +
# Rename the new installation directory
 +
#* <code>mv -v mediawiki-{{#sub:{{CURRENTVERSION}}|0|2}}{{#expr: 1 + {{#explode:{{CURRENTVERSION}}|.|1}}}}.0 htdocs-{{#sub:{{CURRENTVERSION}}|0|2}}{{#expr: 1 + {{#explode:{{CURRENTVERSION}}|.|1}}}}</code>
 +
# Change or add some subdirectories and copy some files from the old to the new installation directory
 +
#* <code>cd htdocs-{{#sub:{{CURRENTVERSION}}|0|2}}{{#expr: 1 + {{#explode:{{CURRENTVERSION}}|.|1}}}}</code>
 +
#* <code>cp -vr ../htdocs-{{#sub:{{CURRENTVERSION}}|0|2}}{{#explode:{{CURRENTVERSION}}|.|1}}/skins/common skins</code>
 +
#* <code>cp -vr ../htdocs-{{#sub:{{CURRENTVERSION}}|0|2}}{{#explode:{{CURRENTVERSION}}|.|1}}/skins/scoutwiki skins</code>
 +
#* <code>mv extensions extensions.old</code>
 +
#* <code>ln -s ../extensions extensions</code>
 +
#* <code>ln -s ../sites sites</code>
 +
#* <code>cp -v ../htdocs-{{#sub:{{CURRENTVERSION}}|0|2}}{{#explode:{{CURRENTVERSION}}|.|1}}/.[^.]* ./</code>
 +
#* <code>cp -v ../htdocs-{{#sub:{{CURRENTVERSION}}|0|2}}{{#explode:{{CURRENTVERSION}}|.|1}}/LocalSettings.php ./</code>
 +
#* <code>cp -r ../htdocs-{{#sub:{{CURRENTVERSION}}|0|2}}{{#explode:{{CURRENTVERSION}}|.|1}}/srv ./</code>
 +
#* <code>cp -v ../htdocs-{{#sub:{{CURRENTVERSION}}|0|2}}{{#explode:{{CURRENTVERSION}}|.|1}}/*.sh ./</code>
 +
#* <code>cp -v ../htdocs-{{#sub:{{CURRENTVERSION}}|0|2}}{{#explode:{{CURRENTVERSION}}|.|1}}/composer ./</code>
 +
# Run composer on the new installation directory
 +
#* <code>./composer require "mediawiki/bootstrap:~1.0"</code>
 +
#* <code>./composer update --no-dev</code>
 +
# Link the MediaWiki web root to the new installation directory
 +
#*<code>rm -i ../htdocs; ln -s ../htdocs-{{#sub:{{CURRENTVERSION}}|0|2}}{{#expr: 1 + {{#explode:{{CURRENTVERSION}}|.|1}}}} ../htdocs</code>
 +
# Check the ScoutWiki's, they most likely give some database error, not a blank screen or "can't find LocalSettings.php"
 +
# Run the update script for each ScoutWiki. Going from small to big.
 +
#* <code>./update.sh xx</code>, xx is the language code, include asso and media
 +
#* Check the ScoutWiki, it should work again.
 +
# Update the extensions
  
* Download the new MediaWiki (take the whole package) and extract it.
+
==Extensions==
* Create a patch for the common table functionality in includes/Database.php:
+
A list of all the [http://www.scoutwiki.org/mediawiki_extensions.php mediawiki_extensions] on the ScoutWiki's including ES and HU.
: cd fi-n/
+
===Git  maintained extensions===
: diff -Naur includes/Database.backup.php includes/Database.php > ../common-fix-1.12.0.diff
+
To update the extensions run <code>./update.sh</code> in <code>/srv/www/scoutwiki/extensions/</code>
: cd ../
 
  
=== For every wiki ===
+
Most extensions follow the "Release" branch when available otherwise the "Master" branch.
 +
:<code>git checkout REL{{#sub:{{CURRENTVERSION}}|0|1}}_{{#sub:{{CURRENTVERSION}}|2|2}}</code>
  
* Copy the whole directory containing the new MediaWiki version as [lang]-n.
+
===Composer  maintained extensions===
: cp -R mediawiki-1.12.0/ fi-n/
+
Run [https://getcomposer.org/ composer] in <code>/srv/www/scoutwiki/composer</code> only use <code>./composer.sh</code> instead of <code>php composer.phar</code>. So to update the extensions that are maintained with composer run <code>./composer.sh update</code>
* Copy LocalSettings.php, AdminSettings.php, .htaccess, favicon.ico, logo.png, editcount.php, google*:
+
 
: cp fi/LocalSettings.php fi/AdminSettings.php fi/.htaccess fi/favicon.ico fi/logo.png fi/editcount.php fi/google*.html fi-n/
+
===Other extensions===
* Copy skin:
+
 
'''fi. and sv.'''
+
==Customizations==
: cp -R fi/skins/MonoBook* fi/skins/monobook/ fi-n/skins/
+
 
* Copy extensions:
+
===Non-standard language/other side bar links===
: cp -R fi/extensions/ fi-n/
+
There may be a time when you want your interwiki links to appear in the siderbar, instead of in-text. To achieve this, simply add the interwiki prefix and the name of the site to /languages/data/Names.php, in the same format as the languages already there:
* Patch the common table functionality:
+
:<code>'iw_prefix' => 'Description of language/site',</code>
: cd fi-n/
+
for example:
: patch -p0 < ../common-fix.1.12.0.diff
+
:<code>'scout-o-wiki' => 'scout-o-wiki',</code>
: cd ../
+
 
* Take the new version into use:
+
Make sure the last line has no comma, and the second last line has one, and make sure your interwiki prefix is not not duplicating an existing language!
: mv fi fi-w
+
 
: mv fi-n fi
+
 
* '''Now fi is the new version and fi-w is the old one.'''
+
[[category:server administration]]
* Upgrade database:
 
: cd fi/maintenance/
 
: php update.php
 
* Notice that this does NOT update the common interwiki table. If any updates to the table exist, update as necessary (only once, it's the same for all wikis.)
 
* '''Add a note (by editing MediaWiki:Sitenotice) to your wiki about the upgrade. Remember to tell where to report any bugs!
 

Latest revision as of 12:28, 11 January 2020

MediaWiki

Minor release

Upgrading using patch

A small patch file is usually made available for a minor version upgrade. Download and extract the patch files.

  1. Make a backup of the MediaWiki directory.
    • cp -vr /srv/www/scoutwiki/htdocs-1.33 /srv/www/scoutwiki/htdocs-1.33.2
  2. Change to the MediaWiki directory.
    • cd /srv/www/scoutwiki/htdocs-1.33
  3. Download the patch file and gunzip it.
  4. Use patch -p1 --dry-run to check what will be changed
    • patch -p1 --dry-run < mediawiki-1.33.3.patch
  5. If all is well, run patch again without --dry-run.
    • patch -p1 < mediawiki-1.33.3.patch
  6. Check the Special:Version on all ScoutWiki's and you should see the new version number in place.

Major release

  1. Go to the directory with web files
    • cd /srv/www/scoutwiki/
  2. backup the database
    • (to be added)
  3. Download the release file and untar it.
  4. Rename the new installation directory
    • mv -v mediawiki-1.34.0 htdocs-1.34
  5. Change or add some subdirectories and copy some files from the old to the new installation directory
    • cd htdocs-1.34
    • cp -vr ../htdocs-1.33/skins/common skins
    • cp -vr ../htdocs-1.33/skins/scoutwiki skins
    • mv extensions extensions.old
    • ln -s ../extensions extensions
    • ln -s ../sites sites
    • cp -v ../htdocs-1.33/.[^.]* ./
    • cp -v ../htdocs-1.33/LocalSettings.php ./
    • cp -r ../htdocs-1.33/srv ./
    • cp -v ../htdocs-1.33/*.sh ./
    • cp -v ../htdocs-1.33/composer ./
  6. Run composer on the new installation directory
    • ./composer require "mediawiki/bootstrap:~1.0"
    • ./composer update --no-dev
  7. Link the MediaWiki web root to the new installation directory
    • rm -i ../htdocs; ln -s ../htdocs-1.34 ../htdocs
  8. Check the ScoutWiki's, they most likely give some database error, not a blank screen or "can't find LocalSettings.php"
  9. Run the update script for each ScoutWiki. Going from small to big.
    • ./update.sh xx, xx is the language code, include asso and media
    • Check the ScoutWiki, it should work again.
  10. Update the extensions

Extensions

A list of all the mediawiki_extensions on the ScoutWiki's including ES and HU.

Git maintained extensions

To update the extensions run ./update.sh in /srv/www/scoutwiki/extensions/

Most extensions follow the "Release" branch when available otherwise the "Master" branch.

git checkout REL1_33

Composer maintained extensions

Run composer in /srv/www/scoutwiki/composer only use ./composer.sh instead of php composer.phar. So to update the extensions that are maintained with composer run ./composer.sh update

Other extensions

Customizations

Non-standard language/other side bar links

There may be a time when you want your interwiki links to appear in the siderbar, instead of in-text. To achieve this, simply add the interwiki prefix and the name of the site to /languages/data/Names.php, in the same format as the languages already there:

'iw_prefix' => 'Description of language/site',

for example:

'scout-o-wiki' => 'scout-o-wiki',

Make sure the last line has no comma, and the second last line has one, and make sure your interwiki prefix is not not duplicating an existing language!