Summary: Convert UseMod pages to PmWiki
Status: Experimental
Maintainer: Pm
Discussion: ConvertUseMod-Talk
Categories: WikiConversion

Questions answered by this recipe

  • Is there an automated way to convert my UseMod pages to PmWiki?


The usemod.phpΔ script is a preliminary implementation of an automated routine for converting pages from an existing UseMod installation into PmWiki. The script reads pages directly from a UseMod page/ directory and attempts to convert UseMod markups into their PmWiki equivalents (although some work is probably still needed here).

Note: This is still somewhat preliminary and could use improvements to make the conversion more complete. Report difficulties to the pmwiki-users mailing list or to pmichaud [snail] pobox [period] com.

To use this script, try the following:

Step 0: It's always a good idea to have a clean backup of your existing UseMod and/or PmWiki installations before attempting this.

Step 1: Make sure you have a working PmWiki 2.0 installation.

Step 2: Download the usemod.phpΔ script and place it in the PmWiki 2.0's cookbook/ directory.

Step 3: Add the following lines to PmWiki's local/config.php file, replacing "/path/to/usemod/page" with the location of your UseMod installation's page/ directory (containing the various page files).

    UseModPageDir("/filesystem/path/to/usemod/page", "UseMod");

The second argument to the UseModPageDir() function above is the name of the PmWiki WikiGroup in which the UseMod pages should be placed (UseMod doesn't support WikiGroups).

Step 4: After making the above change, all of your UseMod pages should appear within the UseMod wiki group of your PmWiki installation (or whatever group you specified above). You can safely experiment with editing and browsing pages in the PmWiki site without affecting your UseMod installation.

Step 5: If you wish, you can perform local customizations on the PmWiki 2 site to get it to look more like your UseMod pages -- this includes changing skins or adding other features.

Step 6: If you're comfortable with the automated conversion and want to go ahead and convert all of the UseMod pages into the PmWiki database, change the UseModPageDir(...) call in local/config.php above to be ConvertUseModPageDir(...) instead, as in:

    ConvertUseModPageDir("/filesystem/path/to/usemod/page", "UseMod");

Running the PmWiki script will then bring up some forms to allow you to bulk migrate some or all of the UseMod pages to PmWiki 2.0. After you've converted the pages, you can then just eliminate the above two lines from your configuration and the PmWiki site will then be running standalone.


  • PageName/SubPage is converted to PageName-SubPage.
  • The converter currently understands UseMod subpage links like (/SubPage) but doesn't understand links from one subpage to another, or links from a page to another page's subpage. If anyone needs this capability, contact pmichaud [snail] pobox [period] com and we'll see about adding it.
  • The script probably doesn't recognize all of UseMod's markup formatting sequences -- I had trouble finding a comprehensive list. If a markup you need is missing, contact pmichaud [snail] pobox [period] com to see about having it added.


  • Pm, original version (2005-02-03)


See discussion at ConvertUseMod-Talk