phpmediawiki

MediaWiki mass page rename


I need to rename all pages matching a certain pattern in MediaWiki. For any page containing XXXXX, it must be renamed to YYYYY. This includes page content as well as page names. For example, the wiki URL http://wiki.example.org/TfrmXXX_Rates should be renamed to http://wiki.example.org/TfrmYYY_Rates, and any text containing XXXXX should be replaced with YYYYY.

The Replace Text extension cannot be used for this, because it can only modify page content. I also need to rename the pages, and all references to them (including interwiki links).

What I have tried is this: dump the MySQL database, replace all occurrences of XXXX to YYYY, then drop and recreate the wiki database with the modified SQL script, and finally run the maintenance/rebuildall.php script (provided by MediaWiki).

The problem is that it does not work. When I search for a keyword, MediaWiki shows some hits with related page content. But when I open the URL, it shows "no content yet". I suspect that the reason for this is that some of the data is stored in PHP serialized form, and that cannot be replaced easily with a text search/replace.

So the question is: how do I rename all references in a MediaWiki database, including content and page names?


Solution

  • I could finish the task. Here are the steps:

    I did not accept miken's answer only because it was just half of the solution.