PhpWiki to Mediawiki converter in php or perl?

Discussion in 'Perl Misc' started by news reader, Apr 16, 2006.

  1. news reader

    news reader Guest


    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:

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

    - 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


    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.
    news reader, Apr 16, 2006
    1. Advertisements

  2. news reader

    Reini Urban Guest

    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.
    Reini Urban, Apr 16, 2006
    1. Advertisements

  3. news reader

    news reader Guest

    Hi Reini,

    Thanks for your reply in explaining how to convert from PhpWiki to

    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;
    Content-Transfer-Encoding: quoted-printable

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

    yhamkls and bye

    news reader, Apr 17, 2006
    1. Advertisements

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 (here). After that, you can post your question and our members will help you out.