Add a --prefix parameter to MediaWiki's "importDump.php" maintenance script
The popular wiki platform, MediaWiki, powers a wide range of collaborative editing projects, such as Wikipedia and Wikivoyage, as well as many internal corporate wikis and other sites.
The importDump.php
maintenance script is run from the command line to import an XML dump into the wiki. Your task is to add a --prefix
parameter to this script, so that pages can be imported as subpages of a given root page. (For example, if the dump contains pages Apple
and Banana
, I could supply the parameter --prefix Fruit/
so that the pages are imported to Fruit/Apple
and Fruit/Banana
.) The value of this parameter should be required to end in /
You may like to borrow code and/or ideas from includes/specials/SpecialImport.php
and includes/Import.php
in the mediawiki/core
Git repository. Read https://www.mediawiki.org/wiki/Gerrit for more details on submitting your code and the review process.
More details are at https://phabricator.wikimedia.org/T72272.