|
|
(7 intermediate revisions by the same user not shown) |
Line 1: |
Line 1: |
| {{DISPLAYTITLE:extensions/ContentTransfer/maintenance/executeTransfer.php}}
| |
| [[Setup:Installation_Guide/Advanced/Maintenance_scripts|{{Icon|bi bi-arrow-right-circle|||}} all maintenance scripts]] | | [[Setup:Installation_Guide/Advanced/Maintenance_scripts|{{Icon|bi bi-arrow-right-circle|||}} all maintenance scripts]] |
| == Reference ==
| |
| BlueSpice Extension: [[Reference:ContentTransfer|ContentTransfer]]
| |
|
| |
|
| == Usage == | | {{Textbox|boxtype=warning|header=Currently not available for BlueSpice 5!|text=This extension is no longer bundled. A replacement script is in planning.|icon=yes}} |
|
| |
| There are three ways to specify pages which pages to transfer:
| |
|
| |
|
| * <code>'''--category'''</code>: This option lets you transfer based on category:<syntaxhighlight lang="php">
| | ==Extension== |
| php extensions/ContentTransfer/maintenance/executeTransfer.php --category=GlobalPage --targets=Target1,Target2,Target3
| | BlueSpice Extension: [[Reference:BlueSpiceUEModuleBookPDF|BlueSpiceUEModuleBookPDF]] |
| </syntaxhighlight>
| |
| * <code>'''--namespace'''</code>: This option lets you transfer based on namespace ID:<syntaxhighlight lang="php">
| |
| php extensions/ContentTransfer/maintenance/executeTransfer.php --namespace=10 --targets=Target1,Target2,Target3
| |
| </syntaxhighlight>
| |
| * <code>'''--pages'''</code> This option lets you explicitly specify which pages to transfer:<syntaxhighlight lang="php">
| |
| php extensions/ContentTransfer/maintenance/executeTransfer.php --pages=Page1,Demo:Page2,Page3 --targets=Target1,Target2,Target3
| |
| </syntaxhighlight>
| |
|
| |
|
| == Configuration == | | ==Usage == |
| The maintenance script can consume a JSON file with the necessary configuration. A sample JSON file is located at this path: <code>extensions/ContentTransfer/docs/transfer-config.json.example</code>. This file can be used to create a JSON configuration file somewhere, so that it is not necessary to type all options in the CLI each time.
| | This script allows to export the wiki pages '''from all content namespaces''' to PDF. |
|
| |
|
| For that, <code>--json-config</code> can be used. There can be a specified path to the file with the JSON configuration.
| |
|
| |
|
| If you need to create your own JSON configuration file, copy the sample JSON file somewhere and edit it to set the necessary configuration.
| | To run the script, execute:<syntaxhighlight lang="text"> |
| | php {MW_ROOT}/extensions/BlueSpiceUEModuleBookPDF/maintenance/dumpPDF.php --file=<localpath> --limit=200 --mail=admin@mymail.com |
| | </syntaxhighlight> |
| | ==Options== |
|
| |
|
| For example, you have the file <code>/home/some_user/config/transfer-config.json</code>. Then it can be used like that:
| | *<code>--file:</code> Defines the output path and the base filename. <br />This name will be appended with the namespace number and — if <code>--limit</code> is set — with the split group. ''Example:'' <code>--file=/tmp/test.pdf</code> will result in <code>/tmp/test_0.pdf</code> or <code>/tmp/test_0_ABC.pdf.</code> |
| <code>php extensions/ContentTransfer/maintenance/executeTransfer.php --json-config=/home/some_user/config/transfer-config.json</code>
| | *<code>--limit:</code> Sets a limit for wikipages in a namespace included in one pdf. If the limit is exceeded, the namspace will be split into pdfs depending on the first character of the page name. If the parameter <code>--limit</code> is not set, all pages of a namespace will be exported to one pdf file. |
| You can specify either an absolute file path from the root or a relative path from the present working directory.
| | *<code>--verbose</code>: Runs the script in verbose mode. |
| | *<code>--mail:</code> E-mail address for a notification email. |
|
| |
|
|
| |
|
| '''Note!'''
| |
|
| |
|
| It is also possible to use a JSON file and additionally pass options from the CLI. In that case, the options from CLI will have greater priority and '''will override''' the same options from JSON file.
| |
|
| |
|
| Example:
| |
| <code>php extensions/ContentTransfer/maintenance/executeTransfer.php --json-config=/home/some_user/config/transfer-config.json --pages=Page1,Demo:Page2,Page3 --targets=Target1,Target2,Target3</code>
| |
| Here, the script will read the configuration from the specified JSON file , but the '''“pages”''' and '''“targets”''' options '''will be overridden''' from the CLI (if they are presented in JSON). The same is true for the other options.
| |
|
| |
|
| == Options ==
| |
|
| |
|
| * <code>--user</code>: The context user of the "sending" wiki who will be used to transfer wiki pages. This is just about recording the transfer in the DB. Default: '''“MediaWiki default”'''
| |
| * <code>--only-modified</code>: If the page should be transferred only if it was modified since the last transfer. '''It's just a flag, it can be passed or not.'''
| |
| * <code>--modified-since</code>:Transfer the page only if it was modified since the specified date. The date must be specified in the format '''"DD.MM.YYYY"'''. Default: '''“”'''
| |
| * <code>--include-related</code>:If all related wiki pages should also be transferred (templates, files, links, and so on, which are used on the page to be transferred. '''It's just a flag, it can be passed or not.'''
| |
| * <code>--force</code>:Transfer the page even if it is protected on the receiving wiki. '''It's just a flag, it can be passed or not.'''
| |
|
| |
|
| Also there is a <code>--dry</code> option (it's a flag too), which may be useful if a user just wants to take a look at transferring titles, but without actual changes in “receiving” wikis.
| | You can see the list of possible options with descriptions by using the following command:<syntaxhighlight lang="text"> |
| | | php {MW_ROOT}/extensions/BlueSpiceUEModuleBookPDF/maintenance/dumpPDF.php --help |
| You can see a complete list of possible options with descriptions by the following command: | | </syntaxhighlight> |
| <code>php extensions/ContentTransfer/maintenance/executeTransfer.php --help</code>
| |
| | |
| | |
| If there is a need to set a specific user for creating pages in the target wiki , it can be done that way:
| |
| <code>php extensions/ContentTransfer/maintenance/executeTransfer.php ... --targets=Target1=User1,Target2=User2,Target3...</code>
| |
all maintenance scripts
This extension is no longer bundled. A replacement script is in planning.
Extension
BlueSpice Extension: BlueSpiceUEModuleBookPDF
Usage
This script allows to export the wiki pages from all content namespaces to PDF.
To run the script, execute:
php {MW_ROOT}/extensions/BlueSpiceUEModuleBookPDF/maintenance/dumpPDF.php --file=<localpath> --limit=200 --mail=admin@mymail.com
Options
--file:
Defines the output path and the base filename.
This name will be appended with the namespace number and — if --limit
is set — with the split group. Example: --file=/tmp/test.pdf
will result in /tmp/test_0.pdf
or /tmp/test_0_ABC.pdf.
--limit:
Sets a limit for wikipages in a namespace included in one pdf. If the limit is exceeded, the namspace will be split into pdfs depending on the first character of the page name. If the parameter --limit
is not set, all pages of a namespace will be exported to one pdf file.
--verbose
: Runs the script in verbose mode.
--mail:
E-mail address for a notification email.
You can see the list of possible options with descriptions by using the following command:
php {MW_ROOT}/extensions/BlueSpiceUEModuleBookPDF/maintenance/dumpPDF.php --help