Loading...
 

ConversionFromTWiki

Name

twiki2tiki.php - Migrate a TWiki web collection into TikiWiki.

Synopsis

twiki2tiki.php may be a helpful start for automating the process of converting your TWiki web into Tikiwiki pages. I wrote it to do the job on my particular installation (php-4.4.0 and MySql-3.23.59). Although I expect the code to be reasonably portable, I make no guarantees. Expect to get your hands dirty.

The program relies heavily on PHP MySQL functions and Perl-Compatible Regular Expression Functions. You'll need to have those extensions installed and be using a MySQL database then for this to work.

Features

The script is written so you should be able to run it as many times as you want and data that's already existing in the Tiki database will just get updated with your TWiki pages. This can be useful for debugging the conversion process since you don't need to empty your tiki_pages each time you want to run the program. Also, in theory, you can maintain an active TWiki installation and use this script to continuously update the Tikiwiki with it (although, any modifications you make in a Tikiwiki page will get blown away with the TWiki content each time you run the code).

Handled Conversion Rules:

  • Headings
  • Bullet Lists
  • Enumerated Lists
  • %HOMETOPIC% and %WEB% variable translation
  • Bold, Italic and Bold/Italic types
  • Preformatted text
  • Attached file syntax
  • Attached image syntax
  • Tables (though vertical span of cells is not possible)
  • External links
  • Wiki references


Nov. 6, 2005 v.0.2

  • Bulked up regex rules for improved matching
  • Added rules for ,
    and TWiki specific weblinks
  • Handles file attachments. Gets mime class by including the tiki lib/mime/mimelib.php for the tiki_get_mime() function.
  • Toss out unused META tags


Nov. 16, 2005 v.0.3

  • Minor bug fixes including:
    • Properly locating files that are attached to the TWiki Web homepage for copying
    • Don't transform email addresses that contain the twiki_web name into wiki links
  • Added rule to force wikiwords followed by a colon with no whitespace into a wikilink
  • Add translation rule for TWiki Math Plugin formulae


Nov. 22, 2005 v.0.4

Installation

MAKE A BACKUP OF YOUR DATABASE. I'm not kidding. I make backups when running this code on my own database... I doubt you should trust me any more then I trust myself. Also, backup your TWiki installation. The script only reads the files in there... but best be safe.

Unzip twiki2tiki.tgz into a directory you can point your browser to. I strongly suggest you secure this directory (eg. user authentication). It will soon contain a config file with your database password in clear text. (You could also dump the files in some private directory and parse it by php manually but the output won't be as pleasant).

Edit the twiki2tiki_cfg.php file. You'll basically need to change just about every line to properly configure the script for your system. The file comments will tell you what to do.

Point your browser to twiki2tiki.php. Perhaps it will work.

Known Bugs

  • I expect the regexp's aren't as robust as they could be in the conversion rules.
  • Tags that extend over more then one carriage return (ie multiple lines of bold, italic etc.) are not matched for translation
  • If you have more then one file of the same name on differing pages, the last one migrated will be the only file of that name. That is each file of the same name will replace any predecessor.

Todo

  • Come up with a srategy to handle %SEARCH directives
  • Handle migration of users?
  • Include a way to map TWiki wiki page names to different Tiki wiki page names?
  • Do something with the TOPICINFO metadata in the TWiki page.

Author

Art Davis

Files

See
 Error
The type parameter is missing
Created by: Last Modification: Monday 20 November 2023 16:43:09 GMT-0000 by admin
List Slides