Slashcode to Drupal conversion script

Most of you daily users probably won't care too much about this, but I figured I'd put it up on the site so that the next person trying to figure out how to migrate from Slashcode to Drupal has a place they can download the script I used from. I'll put a fake little man page here :)

Note that the code is extremely straightforward and repetitive. I was far more concerned with getting the data moved than making nice code. Perl, GetOpt::Long and DBI::MySQL are required.

Oh, and I was originally just gonna let this go public domain, but I got a request to GPL it, so I've added that to the comments.

NAME
slash2drupal.pl

SYNOPSIS
slash2drupal [OPTIONS]

DESCRIPTION
slash2drupal exports slash 2.2 users, stories, comments, and journals into a drupal 4.5 database.

NOTE! THIS SCRIPT WILL REMOVE ALL USERS, NODES, AND COMMENTS FROM THE TARGET DRUPAL DATABASE!

OPTIONS
-h Show usage
-td temporary directory used during conversion
-sh slash hostname
-dh drupal hostname
-su slash username
-du drupal username
-sp slash database password
-dp drupal database password
-sd slash database
-dd drupal database
-v verbose (optional)

Options that are not specified (aside from -h and -v) on the command line will result in the user being prompted for the correct information.

EXAMPLE
slash2drupal -sh localhost -dh localhost -su slash -du drupal -sp passwd -dp passw0rd -sd slash -dd drupal

NOTES
Only stories, journals, comments and users are currently imported. Comment nesting is only handled correctly to 2 tiers.

AUTHOR
Rob Israel (otter@scylla.org)

COPYRIGHT
Initial creation 11/5/2004 Rob Israel

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA

slash2drupal version 0.1, Copyright (C) 2004 Rob Israel
slash2drupal comes with ABSOLUTELY NO WARRANTY
This is free software, and you are welcome to redistribute it
under certain conditions;

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Any idea if this will still

Any idea if this will still work with Drupal 4.6?

Cheers....

Probably not, but it wouldn't be all that hard to modify

They've added a couple fields that you'd probably need to add stuff to, but the important stuff like checking the sequences table is still in there.

If you haven't installed drupal yet (or aren't using it yet), the simplest thing to do would be to install 4.5, run the script, and then upgrade to 4.6. Drupal upgrades are usually pretty painless.

If you've already got content in a drupal installation, it probably means making a copy of your drupal database and testing the script against that copy and making changes until it works. Not fun, but again, the script is pretty straightforward.

Also, if you're updating an existing drupal installation, there are drop table commands in the script! Nix those, and put something in to add a number high enough to miss all your existing drupal content to all the slash content id's.