Extension:DataDump/zh
DataDump 发行状态: 稳定版 |
|
---|---|
实现 | 数据库 , 特殊页面 |
描述 | Provides the Special page to generate/delete/download dumps |
作者 | Paladox, Universal Omega |
维护者 | Miraheze system administrators |
最新版本 | continuous updates |
MediaWiki | >= 1.36.0 |
PHP | 7.4+ |
数据库更改 | 是 |
Composer | miraheze/data-dump |
表 | data_dump |
许可协议 | GNU通用公眾授權條款3.0或更新版本 |
下載 | |
|
|
|
|
DataDump allows users to request and generate database dumps. Other types of dumps, such as image dumps, can be configured in the extension. This allows for easy dumping without the need for system administrator intervention.
For reporting an issue or a bug, please use Miraheze Phabricator. See here for the workboard.
Installation
- 下载文件,并将其放置在您
extensions/
文件夹中的DataDump
目录内。 - 将下列代码放置在您的LocalSettings.php 的底部:
wfLoadExtension( 'DataDump' );
- 运行更新脚本,它将自动创建此扩展必须依赖的数据库表。
- Configure as required.
- 完成 – 在您的wiki上导航至Special:Version,以验证已成功安装扩展。
Configuration
parameter | default | comment |
---|---|---|
$wgDataDump
|
[]
|
This config defines how dumps are generated and which types of dumps there are. |
$wgDataDumpDirectory
|
false
|
This config defines the directory where to store the dumps. |
$wgDataDumpDisableGenerate
|
false
|
This config determines whether DataDump should be disabled or not. |
$wgDataDumpFileBackend
|
false
|
This config defines backend to use ($wgFileBackends) |
$wgDataDumpInfo
|
""
|
This config defines the information displayed atop Special:DataDump. |
$wgDataDumpLimits
|
["memory": 0, "filesize": 0, "time": 0, "walltime": 0]
|
This config defines resources allocated to running scripts. |
Permissions
DataDump provides three permissions. These allow you some granularity when it comes to configuring DataDump.
You are not restricted to only using these permissions to restrict who can download, view, or delete dumps. You can also use other permissions available on the wiki.
parameter | comment |
---|---|
generate-dump
|
Allows users to generate database dumps |
view-dump
|
Allows users to view dumps |
delete-dump
|
Allows users to delete dumps |
Example
This is an example of how to set up the configuration. You can tailor it to your specific needs:
$wgDataDumpDirectory = "/var/backups/${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',
],
],
'zip' => [
'file_ending' => '.zip',
'generate' => [
'type' => 'script',
'script' => '/usr/bin/zip',
'options' => [
'-r',
"${wgDataDumpDirectory}" . '${filename}',
"$IP/images/"
],
],
'limit' => 1,
'permissions' => [
'view' => 'view-dump',
'generate' => 'generate-dump',
'delete' => '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.
Troubleshooting
If you're experiencing issues with failed data dumps, you can look at your Job Queue 's log file.
You can search for DataDumpGenerateJob
to find an area where the Job Queue is running your dump.
PHP binary location
If your log file contains something similar: [exec] Possibly missing executable file: '/usr/bin/php'
, then you might need to set $wgPhpCli to a correct value for your environment.
You can use whereis php
to double check.
Zip Tooling
If your log file contains something similar to: [exec] Possibly missing executable file: '/usr/bin/zip'
then you need to ensure the appropriate zip tooling for your job is installed on your Host machine.
See also
此扩展在以下wiki农场/托管网站和/或软件包中提供: 這不是一份權威名單。 即使某些wiki农场/托管网站和/或软件包未在这里列出,它们也可能提供此扩展。 请检查你的wiki农场/托管网站或软件包以确认提供情况。 |
This extension is maintained by Miraheze. Some Miraheze extensions are very Miraheze-specific and you may encounter issues you don't see on Miraheze. To report a bug or request a configuration change, please do so on the Miraheze Issue Tracker and not on Wikimedia Phabricator. |
- Stable extensions/zh
- Database extensions/zh
- Special page extensions/zh
- Extensions supporting Composer/zh
- GPL licensed extensions/zh
- Extensions in GitHub version control/zh
- LoadExtensionSchemaUpdates extensions/zh
- All extensions/zh
- Extensions included in Miraheze/zh
- Extensions included in WikiForge/zh
- Extensions by Miraheze/zh