PhpWiki to Mediawiki converter in php or perl?

N

news reader

Hi,


I'm looknig for advice / inspiration / modules / libraries, that could help.
I'm a little more fluent in perl, but a php solution would also be fine.



I'm having two Wiki servers:

Server1:
- phpwiki with user authentication
- direct access to the mysql data base possible
- contains about 400 entries


Server1:
- MediaWiki (Wikipedia is Mediawiki based) with user authentification
- direct access to the mysql data base possible
- contains about 30 entries


I'd like to copy over about 350 entries from Server1 to Server2(I could
apply a filter rule or semiautomatically create a list with entries to copy

As the amount of entries is low I don't really need an optimized solution.

Entries in server 2 can be overwritten.



I wanted to have your advice:
1.) Is there already something similiar, that exists?
2.) Is there a Wikiadmin focused news group (I don't like mailing lists
and web based forums, as you have to create a noew account for most of
them or to increase your spam rate even more) ?

If not:
I know very little about the wiki internals and was thinking about a
'brute force' method, not knowing if something better exists:

The idea:
1.) get all the entries from the phpWiki via mysql ( from table "wiki" )
2.) fix naming style (my phpwiki entries contain spaces)
3.) replace the phpWiki syntax with Mediawiki syntax (I found url with
some sed rules, which are probably incomplete, but could be a goiod
starting point) and fix naming styles of interlnal links.
4.) access the Mediawiki via http, authenticate and post the new entries


My idea was to 'post' new entries though it is probaly slower than
directly populating the mysql data base as this allows to populate
Mediawiki without having to know how the internal mysql book keeping
works exactly.

thanks in advance for any ideas and bye


N


P.S. I posted to comp.lang.php and comp.lang.perl.misc but thought, that
cross posting may not be a good idea as probaly most follow ups will be
very language specific.
 
R

Reini Urban

news said:
I'd like to copy over about 350 entries from Server1 to Server2(I could
apply a filter rule or semiautomatically create a list with entries to copy

As the amount of entries is low I don't really need an optimized solution.
Entries in server 2 can be overwritten.

I wanted to have your advice:
1.) Is there already something similiar, that exists?
2.) Is there a Wikiadmin focused news group (I don't like mailing lists
and web based forums, as you have to create a noew account for most of
them or to increase your spam rate even more) ?

If not:
I know very little about the wiki internals and was thinking about a
'brute force' method, not knowing if something better exists:

The idea:
1.) get all the entries from the phpWiki via mysql ( from table "wiki" )
2.) fix naming style (my phpwiki entries contain spaces)
3.) replace the phpWiki syntax with Mediawiki syntax (I found url with
some sed rules, which are probably incomplete, but could be a goiod
starting point) and fix naming styles of interlnal links.
4.) access the Mediawiki via http, authenticate and post the new entries


My idea was to 'post' new entries though it is probaly slower than
directly populating the mysql data base as this allows to populate
Mediawiki without having to know how the internal mysql book keeping
works exactly.

thanks in advance for any ideas and bye

dump the phpwiki pages as xhtml,
convert it via the perl module HTML::WikiConverter::phpWiki
(I contributed the PhpWiki reader)
import this into mediawiki.

The real problem is, that mediawiki started with a non-wiki special
syntax, and then the flock new wiki's didn't care neither and invented
their own syntax also.
 
N

news reader

Hi Reini,


Thanks for your reply in explaining how to convert from PhpWiki to
MediaWiki:
dump the phpwiki pages as xhtml,
convert it via the perl module HTML::WikiConverter::phpWiki
(I contributed the PhpWiki reader)
import this into mediawiki.

The real problem is, that mediawiki started with a non-wiki special
syntax, and then the flock new wiki's didn't care neither and invented
their own syntax also.


I just have one problem.

I don't find the xhtml dump feature in my (probably old and well
cusxtomized (or let's say modified)) version.

Could you please elaborate further?

- What I could do is:
- spidergrab all pages with for example wget and a tiny shell script,
resulting in one file. Would this be the xhtml, that you talk about or
would that be only HTML? Additionally I see the problem, that each file
would contain the entire template text as well, which I'm of course not
interested in.
- use the zip export feature and contain the raw wiki text files with
some leading header lines like:
------------ zip entry starts here --------------
From foo@bar Mon Apr 17 10:30:12 2006
Subject: TestEntry
From: foo@bar (PhpWiki)
Date: Sat, 1 Apr 2006 06:34:51 -0500
Mime-Version: 1.0 (Produced by PhpWiki 1.2.7)
Content-Type: application/x-phpwiki;
pagename=TestEntry;
author=N123;
version=1;
flags="";
lastmodified=1143891291;
created=1143891291
Content-Transfer-Encoding: quoted-printable

wiki text with [wiki] markers here
* 1
* 2
* 3
---------------- zip entry entds here ---------------------


yhamkls and bye

N
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,997
Messages
2,570,239
Members
46,827
Latest member
DMUK_Beginner

Latest Threads

Top