I am wondering if anyone has written a script to help migrate an existing database of articles from phpSlash to drupal. Writing one shouldn't be too hard, but I wanted to avoid duplicating the effort.

I will also write a script so that old article references like http://weblog.flora.ca/article.php3?story_id=653 would become http://www.flora.ca/node/view/653

I am also wondering if anyone has thought of doing work on the search system. I find the search tool on phpSlash to be better than the one on Drupal, and suspect upgrading the search system shouldn't be that hard (search queries based on specific subsets of the taxonomy, allow for a 'more' button when there are a large number of matches, etc).

Comments

killes@www.drop.org’s picture

1) I haven't heard about such a migration script.

2) Work on the search system is needed. Any effort on your part would be appreciated.

Russell McOrmond’s picture

I haven't had the time yet to work on any of this. I'm spending most of my time involved in the content on the sites rather than the software used. I am wanting to simplify my maintenance so will likely write the phpSlash migration scripts soon...


Russell McOrmond, Internet Consultant: FLORA Community Consulting

Drupal used at http://digital-copyright.ca/

Jens-1’s picture

I would *love* such a conversion script! Do you need any help? Free pizza? ;-)

tatonca’s picture

... but I had thought about the usefulness of a generic conversion module after coming across the import.module. Having worked in Palm Programming for a few years now, there are a myriad of tools for converting databases from one form to another, for the purposes of getting them to your Palm Pilot. Most of those work similarly, essentially creating a dynamic field mapping scheme, plus a way to deal with the stuff that doesn't fit. It basically presents the original DB schema a field at a time and allows you to specify what destination field it should map to in a new table, often using a wizard interface.

It would seem that something along these lines would make your module useful not just for phpSplash but for any other CMS out there with the same DB backend software...

Jens-1’s picture

Hello,

On IRC I was told to use the devel/generate-content.php module as a starting point if I wanted to write my own script to import old articles from PHPslash.

Just thought I'd post this here for others to find. :-)
If I write my own or find anything else, I'll post it here too.

Jens

Jens-1’s picture

Here is the first version of my script:
http://www.jensbenecke.de/apps/import_phpslash.phps

Here is a command line based Perl script (not written by me) that does almost the same, but cannot preserve any existing Drupal data and is written in Perl instead of PHP:
http://cvs.drupal.org/viewcvs/drupal/contributions/tricks/slash2drupal/

Jens-1’s picture

See parent post :-)

script: http://www.jensbenecke.de/apps/import_phpslash.phps

Implemented:
- comment threading (stolen from comment.module)
- updating of sequences table (so adding later comments/stories works)
- optionally (!) clearing the DB before inserting PHPslash tables

Still missing:
- transfer of user accounts
- redirection from PHPslash "article.php3?story_id=XX" to Drupal style "node/XX" - this is not trivial since the node IDs are not the same. If implemented in mod_rewrite, this would require a seperate rewrite rule for every story that has been posted. Or a redirection table (RewriteMap in Apache's mod_rewrite) can be used.

Jens

Disoculated’s picture

Jens,

Just responded to your mail, sorry for the delay.

Transfer of accounts and matching accounts to stories should be easy to accomplish if you take the next value in sequences and add it to all uid's (similarly with discussion/nid's). If you consistenly do that, you can just slap it all in and preserve the links between users, stories, etc. I was thinking about doing that in my script, but really I was writing it for my own migration, which didn't need any data preserved on drupal. It only ended up in CVS because killes asked me to send it to him.

Again, kudos on preserving the comment threading. I ended up kind of fudging it (figuring out the thread depth from slash is really a pain in the arse).

BTW- I'm not to familiar with phpSlash, everything I did was with actual perl Slashcode. I understand the versions on what's current in slashcode and phpslash are very different, so if there's inconsistencies there I have no idea what they are.

-Rob

TomChiverton’s picture

Still works a treat, another SlashCode abomination converted to Drupal (4.5) :-)

Thanks for all your work, only issue was some Slash journal and stories had null in discussion, but I just updated them to id/stoid+999 and it then ran fine.