In case anyone else wishes to follow this saga, an update on how it was successfully achieved.
Step 1 - create a new Serendipity blog to receive the old simplePHPblog entries
Step 2 - create all the users and categories to be used for the new blog entries, and a dummy single entry in each category by each author to gain the detals necessary for the conversion, below.
Step 3 - using mysqldump, create a complete export of the new blog MySQL database
Step 4 - using the simplePHPblog PHP source code gather just the few functions needed to traverse all the year/month directories reading every blog entry into memory
Step 5 - add to those few PHP functions two newly written PHP functions:
a) entry_convert_to_s9y() - to convert every simplePHPblog blog entry into a suitably formatted S9Y MySQL "INSERT" statement and
b) category_convert_to_s9y() - to create a suitably formatted MySQL "INSERT" statement for the entries associated S9Y category
The resultant (single) PHP file thus reads all the simplePHPblog entries (in my case all 2574 entries spanning the years 2007 to 2013) and writes out two new MySQL files, one containing a MySQL "INSERT" statement for the blog entry, ie this:
Code: Select all
INSERT INTO `serendipity_entries` (`id`,`title`, `timestamp`, `body`, `comments`,`trackbacks`,`extended`,`exflag`,`author`,`authorid`,`isdraft`,`allow_comments`,`last_modified`,`moderate_comments`) VALUES( $id, $title, ...etc...
and the associated category MySQL INSTERT statement, ie like this:
Code: Select all
INSERT INTO `serendipity_entrycat` (`entryid`, `categoryid`) VALUES( $entry, $cid );
Step 6 - Running the conversion PHP file as a command-line utility creates the files containing all the entries with an associated category entry too.
Step 7 - manually edit the MySQL export file (created in step 3, above) replacing the two tables
serendipity_entries and
serendipity_entrycat with the contents of the two files from step 6.
Step 8 - re-import the MySQL file fro step 7, and confirm everything is consistent and working
Step 9 - congratulations now enjoy using the blog complete with all the old entries from 2007-2013 too.
So, many thanks for the hints, it forced me to actually read the code used by both the SimplePHPblog software and the various Serendipity importer options provided - and work out the above sequence, which was entirely successful and not too painful at all.
Finally,
thanks for the Serendipity Blog software - wish I'd known about it years ago!
Attached for what it's worth, is the complete, single PHP file I used for the conversion - don't be too critical of the code - it was and will remain a one-off hack!
