Extension:DataDump

From MediaWiki.org
Jump to navigation Jump to search

Other languages:
MediaWiki extensions manual
OOjs UI icon advanced.svg
DataDump
Release status: beta
Implementation Database , Special page
Description Provides the Special page to generate/delete/download dumps
Author(s) Paladoxtalk
Maintainer(s) Miraheze
Latest version continuous updates
MediaWiki 1.31+
PHP 7.0+
Database changes Yes
License GNU General Public License 3.0 or later
Download
  • $wgDataDump
  • view-dump
  • view-image-dump
  • generate-dump
  • delete-dump
Translate the DataDump extension if it is available at translatewiki.net
Check usage and version matrix.

The DataDump extension provides means for users to generate, delete or download their dump without the involvement of sysadmins.

For reporting an issue or a bug, please use Miraheze Phabricator.

Installation

  • Download and place the file(s) in a directory called DataDump in your extensions/ folder.
  • Add the following code at the bottom of your LocalSettings.php:
    wfLoadExtension( 'DataDump' );
    
  • Run the update script which will automatically create the necessary database tables that this extension needs.
  • Configure as required.
  • Yes Done – Navigate to Special:Version on your wiki to verify that the extension is successfully installed.

Configuration

parameter default comment
$wgDataDump [] This config defines how dumps are generated and which types of dumps there are.

Example

This is an example on how to setup the configuration. You can tailor it to your specific needs:

$wgDataDumpDirectory = "<path>${wgDBname}/";

$wgDataDump = [
    'xml' => [
        'file_ending' => '.xml.gz',
        'generate' => [
            'type' => 'mwscript',
            'script' => "$IP/maintenance/dumpBackup.php",
            'options' => [
                '--full',
                '--output',
                "gzip:${wgDataDumpDirectory}" . '${filename}',
            ],
        ],
        'limit' => 1,
        'permissions' => [
            'view' => 'view-dump',
            'generate' => 'generate-dump',
            'delete' => 'delete-dump',
        ],
    ],
    'image' => [
        'file_ending' => '.zip',
        'generate' => [
            'type' => 'script',
            'script' => '/usr/bin/zip',
            'options' => [
                '-r',
                '<path>${filename}',
                "<path>${wgDBname}/"
            ],
        ],
        'limit' => 1,
        'permissions' => [
            'view' => 'view-dump',
            'generate' => 'view-image-dump',
            'delete' => 'delete-dump',
        ],
    ],
];

$wgAvailableRights[] = 'view-dump';
$wgAvailableRights[] = 'view-image-dump';
$wgAvailableRights[] = 'generate-dump';
$wgAvailableRights[] = 'delete-dump';

Note that ${filename} is replaced internally in the extension so make sure that it is always in a single string not in a double string.

The limit parameter specifies how many dumps can be generated for that wiki.

See also