[Mediawiki-l] How do I rename mysite.org/warcraftwiki to mysite.org/gameswiki?

Benct Philip Jonsson bpj at melroch.se
Tue Nov 27 10:00:27 UTC 2007


Thomas Anderson skrev:
 > -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
 >
 > I created a wiki and chose to name it "warcraftwiki". How
 > do I rename it after the installation is already done? I
 > don't mean just the url. I mean, how do I rename every
 > place the name "warcraftwiki" occurs so it would say
 > "gameswiki" instead?
 >
 > The reason I want to rename it is because the wiki was
 > oriented towards Warcraft in the beginning but now is more
 > a general games wiki, not just Warcraft. So its current
 > name is inappropriate.

A tip from one newbie to another: I was in the same
predicament and choose to export *all* the pages of the
wiki, make a search-replace for the offending word with a
perl script (you could do it in a good Unicode-aware text
editor if the export file isn't too darn huge...) then
recreate the wiki with the meta namespace renamed and import
the lot again.

You will find the extensions DPL and NukeDPL most helpful,
since they allow you to export, delete and import only the
pages containing the offending word in their body or title.

<http://www.mediawiki.org/wiki/Extension:DynamicPageList>
<http://www.mediawiki.org/wiki/Extension:NukeDPL>

More specifically:

1. Make sureto go to the DPL website and read the manual on
    page selection.
2. Create a page in the main namespace which only contains
    an appropriate DPL query to list all pages with the
    offending word, 1. Copy-paste the generated list as
    plain text into your text editor and edit it to be
    appropriate for Special:Export (remove list markers and
    any empty lines).
3. Copy-paste the cleaned-up page list into export, and
    export the relevant pages to a file. Don't forget to
    export page histories as well!
4. Make a zip/rar archive of the exported file as a backup
    copy in case anything goes wrong! 1. Open the exported
    file in a text editor and replace all instances of the
    offending word. Take note of possible alternative
    spellings or misspellings (e.g. "foowiki, FooWiki, foo
    wiki, Foo Wiki, Fou Wiki") and make sure you replace all
    with the appropriate replacement ("BarWiki", eh?:-).
    Obviously case insensitive regular expression search can
    be of great assistance here, and obviously this step can
    be made with a perl script if you know how to.
5. Copy the DPL query from step 2. into NukeDPL and delete
    the relevant pages.
6. Re-import the pages from the changed file with
    Special:Import.

You still will have to rename the meta-namespace, and I'm
unaware of how that should be done. In our case we didn't
need to rename any namespace, just replace every instance
of a certain word, which luckily didn't appear in any
namespace name.

You can leave the extensions around of course. DPL is
extremely useful for overview and disambiguation pages!
(And for making lists of all pages you've created or
edited on your user page! :-)

Regards,

/Benct Philip Jonsson

 > - --
 > Regards,
 >
 > Thomas Anderson "Quidquid latine dictum sit, altum
 > sonatur"

I also had one in Latin, from Tacitus: "Solitudinem faciunt,
pacem appellant" -- appropriate anywhere a war is fought in
Real Life.



More information about the MediaWiki-l mailing list