Revision as of 08:37, 19 July 2023 by MLR (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

all maintenance scripts

Reference

BlueSpice Extension: ContentTransfer

Script location: extensions/ContentTransfer/maintenance/executeTransfer.php

Usage

There are three ways to specify pages which pages to transfer:

  • --category: This option lets you transfer based on category:
    php extensions/ContentTransfer/maintenance/executeTransfer.php --category=GlobalPage --targets=Target1,Target2,Target3
    
  • --namespace: This option lets you transfer based on namespace ID:
    php extensions/ContentTransfer/maintenance/executeTransfer.php --namespace=10 --targets=Target1,Target2,Target3
    
  • --pages This option lets you explicitly specify which pages to transfer:
    php extensions/ContentTransfer/maintenance/executeTransfer.php --pages=Page1,Demo:Page2,Page3 --targets=Target1,Target2,Target3
    

Configuration

The maintenance script can consume a JSON file with the necessary configuration. A sample JSON file is located at this path: extensions/ContentTransfer/docs/transfer-config.json.example. 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.

For that, --json-config 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.

For example, you have the file /home/some_user/config/transfer-config.json. Then it can be used like that:

php extensions/ContentTransfer/maintenance/executeTransfer.php --json-config=/home/some_user/config/transfer-config.json

You can specify either an absolute file path from the root or a relative path from the present working directory.


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:

php extensions/ContentTransfer/maintenance/executeTransfer.php --json-config=/home/some_user/config/transfer-config.json --pages=Page1,Demo:Page2,Page3 --targets=Target1,Target2,Target3

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

  • --user: 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”
  • --only-modified: 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.
  • --modified-since:Transfer the page only if it was modified since the specified date. The date must be specified in the format "DD.MM.YYYY". Default: “”
  • --include-related: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.
  • --force: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 --dry 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 a complete list of possible options with descriptions by the following command:

 php extensions/ContentTransfer/maintenance/executeTransfer.php --help


If there is a need to set a specific user for creating pages in the target wiki , it can be done that way:

php extensions/ContentTransfer/maintenance/executeTransfer.php ... --targets=Target1=User1,Target2=User2,Target3...



To submit feedback about this documentation, visit our community forum.

No categories assignedEdit

Discussions