From MediaWiki.org
Jump to: navigation, search
MediaWiki extensions manual
Crystal Clear action run.png

Release status: beta

Implementation Hook
Author(s) Jean-Lou Dupont
Latest version 1.0.0
MediaWiki 1.10, 1.11
License No license specified
Download No link
See SVN ($Id: Backup.doc.wikitext 786 2007-09-16 19:34:52Z jeanlou.dupont $)
Hooks used


Translate the Backup extension if it is available at translatewiki.net

Check usage and version matrix; code metrics

Purpose[edit | edit source]

Defines a new hook 'backup' as a service to backup extensions.

Features[edit | edit source]

  • Page
    • Creation (done)
    • Update (done)
    • Delete (done)
    • Move (done)
    • Protection (done)
  • File
    • Upload (done)
    • Re-upload (done) (same as upload)
    • Delete (done)
    • Move (not allowed - hence, nothing to implement)
  • Log (done)

Usage[edit | edit source]

This extension is meant to serve other extensions. It is not meant to be used 'standalone'.

Theory Of Operation[edit | edit source]

Page change events are trapped and the corresponding 'Recent Change Identifier' (i.e. rc_id) field is attached to a 'backup_operation' object. Trapping is done through the 'RecentChange_save' hook. The 'revision' information is the critical information: every page change is associated with a unique 'revision id'.

When a complete 'backup_operation' is ready, the event 'backup' is fired (i.e. the hook 'backup' is called).

Dependencies[edit | edit source]

Installation[edit source]

See the Mediawiki Extension table entry "download" above.[1]

LocalSettings.php[edit source]

Extension:ExtensionManager: See footnote[2]

require_once "$IP/extensions/Backup/Backup.php";
  • Since this Extensions is depending on StubManager, add the line after the StubManager include, or else your Wiki won't work.

PEAR[edit source]

PEAR is a repository of PHP software code.

pear channel-discover mediawiki.googlecode.com/svn
  • Install extension through PEAR:
pear install mediawiki/Backup
  • Add the following to LocalSettings.php[2][3]:
require 'MediaWiki/Backup/Backup.php';
  • Note that the required version of PEAR must be respected. Currently, the minimum version of PEAR usable with this channel is v1.6.2. Perform the following command to upgrade to the latest version of PEAR:
pear upgrade pear

Upgrades through PEAR[edit source]

Sometimes, it is necessary to clear PEAR's cache in order to perform upgrades.

pear clear-cache

or use the force method:

pear upgrade --force mediawiki/Backup

PEAR Web Frontend[edit source]

For easier remote package management, PEAR Frontend WEB can be installed. Installation notes can be found here. An example of the WEB frontend is available here.

RSS feed[edit source]

To keep up-to-date with this channel, use the following RSS feed__Rss2.jpg.

Notes[edit source]

Other Extensions From the same author[edit source]

Consult User Jldupont's page.

  1. The most recent release is always available through the extension's PEAR and SVN repositories. This page is not necessarily up-to-date.
  2. 2.0 2.1 2.2 Extension:ExtensionManager does not require any modification to LocalSettings.php because ExtensionManager includes the extension.
    Note that if PHP code caching is in place (e.g. APC, eAccelerator), then to successfully complete the installation a cache flush might be needed.
  3. Modifications to LocalSettings.php is only necessary if not using Extension:ExtensionManager

process deletion in the NS_IMAGE namespace.

Article.php patch[edit | edit source]

MediaWiki by default purges the 'recent changes' table for entries related to a delete article/image. This behavior introduces some rather annoying side effects to this extension. A patched copy of Article.php can be downloaded from BizzWiki's repository.

Notes[edit | edit source]

Image[edit | edit source]

Upon deletion:

  • no 'ArticleDelete' event is fired.
  • recent changes table is cleared of any related entries
  • log entry is created

Revision Identifier[edit | edit source]

Verify that the 'revision id' information is safely trapped:

  • Page
    • Creation || ArticleSave || rev_id OK
    • Update || ArticleSave || rev_id OK
    • Delete || ArticleDeleteComplete || rev_id OK
    • Move || SpecialMovepageAfterMove || rev_id OK (set to latest ID of source title)
    • Protection || ArticleProtectComplete || rev_id OK
  • Log || RecentChange_save || rev_id *NOT NEEDED*
  • File
    • Upload || FileUpload || rev_id OK
    • Delete || ImageDoDeleteBegin || rev_id OK
    • Re-upload || FileUpload || (done) (same as upload)
    • Move (OK as it is not allowed anyway)

History[edit | edit source]