I have been using ))PhpNuke(( for my website for two years now, but I would like to move on to Tiki. To help others I'll describe this process for my own website.
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.
The first step is to convert PhpNuke's stories to articles. These are similar structured in both CMS tools, so this shouldn't be extremely hard. Let's have a look at the table structures first.
mysql> describe nuke_stories ;
Field | Type | Null | Key | Default | Extra | |
sid | int(11) | PRI | NULL | auto_increment | ||
catid | int(11) | MUL | 0 | |||
aid | varchar(30) | |||||
title | varchar(80) | YES | NULL | |||
time | datetime | YES | NULL | |||
hometext | text | YES | NULL | |||
bodytext | text | |||||
comments | int(11) | YES | 0 | |||
counter | mediumint(8) unsigned | YES | NULL | |||
topic | int(3) | 1 | ||||
informant | varchar(20) | |||||
notes | text | |||||
ihome | int(1) | 0 | ||||
alanguage | varchar(30) | |||||
acomm | int(1) | 0 | ||||
haspoll | int(1) | 0 | ||||
pollID | int(10) | 0 | ||||
score | int(10) | 0 | ||||
ratings | int(10) | 0 |
19 rows in set (0.00 sec)
mysql> describe tiki_articles ;
Field | Type | Null | Key | Default | Extra | |
articleId | int(8) | PRI | NULL | auto_increment | ||
title | varchar(80) | YES | MUL | NULL | ||
authorName | varchar(60) | YES | NULL | |||
topicId | int(14) | YES | NULL | |||
topicName | varchar(40) | YES | NULL | |||
size | int(12) | YES | NULL | |||
useImage | char(1) | YES | NULL | |||
image_name | varchar(80) | YES | NULL | |||
image_type | varchar(80) | YES | NULL | |||
image_size | int(14) | YES | NULL | |||
image_x | int(4) | YES | NULL | |||
image_y | int(4) | YES | NULL | |||
image_data | longblob | YES | NULL | |||
publishDate | int(14) | YES | NULL | |||
created | int(14) | YES | NULL | |||
heading | text | YES | MUL | NULL | ||
body | text | YES | MUL | NULL | ||
hash | varchar(32) | YES | NULL | |||
author | varchar(200) | YES | NULL | |||
reads | int(14) | YES | MUL | NULL | ||
votes | int(8) | YES | NULL | |||
points | int(14) | YES | NULL | |||
type | varchar(50) | YES | NULL | |||
rating | decimal(3,2) | YES | NULL | |||
isfloat | char(1) | YES | NULL |
25 rows in set (0.00 sec)
The easiest way to convert between two different databases is to write a small script. I used PHP for this. As stated above it is important to keep the articleId and sid the same. These are unique keys. When experimenting with this script, it can be useful to remove all articles in Tiki sometimes. Syntax for that is:
This is a very preliminary version! It gives an indication of how the script will look like, it's far from usable.
The script:
<?php
error_reporting (E_ALL);
Function Transfer () { global $id, $authorName, $title, $hometext, $bodytext;
mysql_connect("localhost","root","");
$database="tiki";
@mysql_select_db($database) or die( "Unable to select database");
$query = "insert into tiki_articles set title='$title', authorName='$authorName', created='1060680360', type = 0, heading= '$hometext', body= '$bodytext', hash= '', publishDate = '1061317680' ";
$result=mysql_query($query) or die ("Query error: " . mysql_error());;
echo "Result: $result <br />";
}
echo "<html><head><title>Conversion</title></head><body>Conversion...";
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 limit 0,5";
$result=mysql_query($query);
$num=mysql_numrows($result);
echo "Number of rows: $num<br /><br />";
$i=0;
while ($i < $num):
$authorName=mysql_result($result,$i,"aid");
$title=mysql_result($result,$i,"title");
$hometext=mysql_escape_string(mysql_result($result,$i,"hometext"));
$bodytext=mysql_result($result,$i,"bodytext");
$id=mysql_result($result,$i,"id");
echo "$id $title, ";
Transfer ();
$i++;
endwhile;
?>
1) |
15 Aug 2024 14:00 GMT-0000
Tiki Roundtable Meeting |
2) |
19 Sep 2024 14:00 GMT-0000
Tiki Roundtable Meeting |
3) |
Tiki birthday |
4) |
17 Oct 2024 14:00 GMT-0000
Tiki Roundtable Meeting |
5) |
21 Nov 2024 14:00 GMT-0000
Tiki Roundtable Meeting |
6) |
19 Dec 2024 14:00 GMT-0000
Tiki Roundtable Meeting |