PhpNuke conversion | |
|
Introduction | |
Update: I have decided NOT to use Tikiwiki for my own website. This has nothing to do with Tikiwiki, it's just that I prefer to use a Java based tool (I'll use MMBase, a professional open source CMS).
I hope that if someone ever wants to migrate from PhpNuke to Tikiwiki, this page will give a starting point.
|
Assumptions | |
This document describes the conversion from PhpNuke 6.0. It does not attempt to be a step-by-step conversion manual but I hope it will make conversions easier. Note: this type of conversions is not trivial. |
Goals | |
I would like to convert the PhpNuke stories to Tikiwiki articles. This includes the topics and comments. I want to do a one-time conversion. It would also be possible to re-use the PhpNuke code and database tables for stories, and integrate them into the Tiki program structure, but then what would be the point of conversion? |
Stories to Articles | |
|
PhpNuke stories | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
19 rows in set (0.00 sec) |
Tiki articles | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
25 rows in set (0.00 sec) |
Observations | |
|
Conversion | |
Removing Tiki articles:
delete from tiki_articles ;
|
Date datatype | |
The conversion from the PhpNuke date format (a textual representation, yyyy-mm-dd hh:mm) to the timestamps used by Wiki can be done using mktime(). PhpNuke doesn't make a difference between publish- and creation date (although programmed articles are supported). Therefore the script will consider the publish- and creation date to be the same. |
Bodytext and heading contents | |
An important difference in the rendering of PhpNuke and Tiki is the treatment of linebreaks. PhpNuke stores the contents of a story as HTML in the database. In Tikiwiki the contents of an article is stored as text; when rendering an article linebreaks will be converted to tags. The obviously makes more sense when taking into account different outputs (that do not recognize HTML tags), but it requires a text conversion in this script.
|
Scripts | |
This is a very preliminary version! It gives an indication of how the script will look like, it's far from usable. It converts only the 5 first articles. The script: error_reporting (E_ALL);
mysql_connect("localhost","root",""); $database="tiki";
$publishTimeStamp = strtotime("$time");
$result=mysql_query($query) or die ("Query error: " . mysql_error());;
mysql_connect("localhost","root",""); $database="nuke"; @mysql_select_db("$database") or die( "Unable to select database nuke"); $table="nuke_stories"; $query="select * from $table order by time desc"; $result=mysql_query($query);
"; $i=0;
$authorName=mysql_result($result,$i,"aid");
$i++;
?>
|