A lot depends on your mediawiki installation.  I'm also in the middle
of translating a mediawiki to trac and I ran into a couple of issues.
1) The mediawiki users did their hyperlinks with extra [[ in them, and
2) The "attachments"/uploaded files for mediawiki is a different
paradigm than how Trac deals with uploaded files.

So here are some things that should get you going:

  *  The script posted above may not be the most recent version of
said script as there were changes in the mediawiki db schema that
render the link at 
http://trac.edgewall.org/attachment/wiki/TracWiki/mediawiki2trac.py
not useful to you.  Instead you may want to use the link posted here:
http://trac.edgewall.org/attachment/ticket/5241/mediawiki2trac.ph
(note the file extension is ph, you'll want to rename that to .py on
your system)
  *  Even using the script, I found that the import wasn't perfect.
If you're used to the table of contents automagically forming on your
MediaWiki, then that isn't going to happen once you migrate the wiki
using this script.  I haven't looked at any of the various
TableOfContents plugin/macros, but I don't think there's an analog to
what Mediawiki does in creating a TOC based on header lines.  So if
you need that feature, then you'll want to look at...
  *  The MediaWiki Macro at http://trac-hacks.org/wiki/MediaWikiPluginMacro.
Note that in order to usefully combine this with your script, you will
want to comment out all the replacement lines and add the following:

    wiki = "{{{\n#!mediawiki\n" + row[0][1] + "\n}}}\n"

# convert mediawiki to tracwiki
#    wiki = wiki.replace("\n***","\n   *")
#    wiki = wiki.replace("\n**", "\n  *")
#    wiki = wiki.replace("\n*",  "\n *")
#    wiki = wiki.replace("[[","wiki:")
#    wiki = wiki.replace("]]","")
#    wiki = wiki.replace("<br>","[[BR]]")
#    wiki = wiki.replace("\n:","\n ")

Note that the script requires you to know the hostname, dbname,
username, and password to your mediawiki installation, so replace that
as well.

This method had much better results.  It generated a Table of Contents
and for the most part looked reasonably sharp.  There were some issues
however on pages that may have been processing HTML or some other not-
standard flavor of wiki-ese that threw some errors.  I haven't had a
chance to look into it yet, but hopefully this helps you enough where
you can make an educated decision on what you want.  And of course if
you find something better, please post back to the list.

Best,

Vincent

On Aug 11, 11:41 am, [EMAIL PROTECTED] wrote:
> On Aug 11, 2:16 am, Rainer Sokoll <[EMAIL PROTECTED]> wrote:> is there an 
> easy way to move a mediawiki (mysql backend) to trac (sqlite
> > backend)?
>
> You could try this 
> script:http://trac.edgewall.org/attachment/wiki/TracWiki/mediawiki2trac.py


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Trac 
Users" group.
To post to this group, send email to trac-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/trac-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to