WikiMatrix
  • Forum
  •  » MediaWiki
  •  » p2m 0.4.1 Beta - PHPWiki to MediaWiki Converter

#1 2006-07-20 23:24:21

Sektor9
Member
Registered: 2006-07-20
Posts: 1

p2m 0.4.1 Beta - PHPWiki to MediaWiki Converter

Source: http://sektor9.planetpeer.de/index.php/topic,739.0.html

Download: http://sektor9.planetpeer.de/index.php? … ;attach=28

0. What you need to know

    * p2m is freeware
    * p2m is in an early stage of development so errors may occur Wink


1. Introduction

p2m is a text converter for Wiki content which has been formatted with PHPWiki syntax. It translates the most important Wiki tags from PHPWiki to MediaWiki syntax. I have written p2m since I had to migrate a PHPWiki to a MediaWiki and I did not find a suitable converter.

PHPWiki2MediaWiki is a command line tool written in C#. It does not have a neat GUI nor is it intended as a full-blown converter. With p2m I was able to convert about 80%
of my Wiki content which is not too bad, I guess Cool It does a good job, but I have to mention that is absolutely necessary to verify the converted content since p2m does not convert everything automatically!

2. What can p2m do for you?

A bigger part of the Wiki syntax is converted automatically, although there are naturally some limitions. Please find below a description what p2m can automatically convert and what has to be done manually:

2.1 What will be converted?

- Header (Level 1, 2, 3)
- White spaces at the beginning of a paragraph
- External links are converted to MediaWiki syntax (Example: [Help is available here | http://www.gethelphere.com] -> [http://www.gethelphere.com Help is available here])

2.2 What will not be converted?

- Internal links like Clickhere
- Special formatting tags like tables have to adjusted manually

3. Usage

As I already mentioned above p2m is a command line tool without a GUI. To convert content the following procedure is necessary:

- Copy & paste text with PHPWiki syntax in a text file and save it
- Start p2m at least the name of the input file. If you omit the second parameter an output will be created automatically with a .mediawiki extension

Example: You want to convert a file named mutefaq.txt so you have to invoke p2m as follows

p2m mutefaq.txt


p2m mutefaq.txt

In case the p2m parser should encounter an error during the translation process an exception is thrown and the conversion stops immediately. Further information is provided then, for instance the line number which caused the exception. To solve such issues you should

1) copy the appropriate line from the original file and save it in a temporary text file which holds all copied lines

2) delete the appropriate line from the original file

3) save the modified file

4) start p2m again

5) repeat steps 1-4 if necessary

6) open up the converted file and copy & paste the copied lines from step 1 to the relevant coordinates

7) save your converted file and your are done

After a successfull conversion some stats are generated:

Code:

Processing line 168
Processing line 169
Processing line 170
Processing line 171

Statistics:
Converted headers, 3rd order: 0
Converted headers, 2nd order: 0
Converted headers, 1st order: 0
Removed white chars         : 0
Converted external links    : 8


Gratulations! If you reached this point you can simply copy and paste the content from mutefaq.mediawiki to your MediaWiki.

4. Requirements

p2m requires Microsoft .NET 2.0 Framework. It has been developed and tested under Windows XP without any issues. I plan to compile a Linux release also which requires Mono.

Offline

 
  • Forum
  •  » MediaWiki
  •  » p2m 0.4.1 Beta - PHPWiki to MediaWiki Converter

You are not logged in.


Board footer

Forum powered by PunBB (© 2002–2005 Rickard Andersson)