Page MenuHomePhabricator

Change the ID of an existing custom namespace
Closed, DuplicatePublicFeature


Feature summary:

I would like to be able to run a script to change the numeric ID of an existing custom namespace. For example, if I have

define( "CUSTOM_NS_FOO", 100 );
define( "CUSTOM_NS_FOO_TALK", 101 );
$wgExtraNamespaces = array(
    CUSTOM_NS_FOO => "Foo",
    CUSTOM_NS_FOO_TALK => "Foo_talk",

I would like to be able to change the IDs of Foo and Foo_talk to 3000 and 3001, respectively, and easily update all affected pages and any relevant links.

Use case(s):

I have several pairs of custom namespaces (similar to the above) used across several wikis, though not every wiki uses all of the custom namespaces. I need to reconfigure my wikis to use a wiki family design, but in my existing custom namespaces there are some conflicting IDs across the wikis. For example, one wiki uses 102 and 103, but those are used by the Semantic MediaWiki Property and Property_talk namespaces in the other SMW-enabled wikis. As such, I'd want to leave alone the SMW namespaces and move the existing custom ones to the appropriate range.

I did look at the namespaceDupes.php maintenance script but it does not appear to allow for a source namespace other than Main.


As explained in the above use case, this feature would be helpful if a site's existing custom namespace suddenly conflicted with a namespace that is used by a desired extension. It would also be useful for sites that simply want to fix "historical mistakes" and follow the best practice of using the namespace ID range of 3000-4999 as specified in the extension default namespaces page.