Jump to content

Manual:namespaceDupes.php

From mediawiki.org

namespaceDupes.php is a maintenance script located in the maintenance directory that can be used to clean up inaccessible titles after adding a namespace (or interwiki prefix).

Usage

[edit]

Go to the wiki's directory and run :

$ ./maintenance/run namespaceDupes

This will show you what titles need updating, and which can be fixed automatically (because their destination titles do not exist). It won't actually change anything. To fix the titles, first run

$ ./maintenance/run namespaceDupes --fix

to fix the non-clashing ones, and then run

$ ./maintenance/run namespaceDupes --add-suffix='_(old)'

to add _(old) to each title that clashes. Alternatively you could add a prefix instead. The suffix or prefix you use is of course up to you.

Note that these changes to the titles are not considered page moves and so no log entries are created.

Option/Parameter Description
--fix Attempt to automatically fix errors. You must pass this option for the script to actually perform any change to the database. Otherwise, it will just print what would be done. The change instruction is a second option (e.g. --add-prefix).
--merge Instead of renaming conflicts, do a history merge with the correct title (in case a page with the valid title already exists). This option will refuse to work if the last revision of the inaccessible page is newer than the existing page where it would be merged, because it would require to refresh the search index, recent changes review, etc.
--add-suffix=‎<text> Dupes will be renamed with correct namespace with ‎<text> appended after the article name
--add-prefix=‎<text> Dupes will be renamed with correct namespace with ‎<text> prepended before the article name
--source-pseudo-namespace=‎<namespace name> Move all pages with the given source prefix (with an implied colon following it). If --dest-namespace is not specified, the colon will be replaced with a hyphen.
--dest-namespace=‎<namespace number> In combination with --source-pseudo-namespace, specify the namespace ID of the destination.
--move-talk If this is specified, pages in the Talk namespace that begin with a conflicting prefix will be renamed, for example Talk:File:Foo -> File_Talk:Foo

See also

[edit]