In a brief bout of uncharacteristic gratitude, I’d like to thank the developers of both OpenACS and Joomla for choosing to use standard tools in the place where it matters most: the backend database.
As I mentioned a couple of weeks ago, I’m migrating Virtualmin.com off of OpenACS, due to a number of limitations and bugs in the platform. After some consideration, research, and tinkering, it appears that Joomla is the best suited for what we’re doing with our site. It has good forums, a good FAQ manager, a decent bug tracker, and a good ecommerce package. All of them, except the bug tracker, look strikingly similar to the OpenACS applications they’ll be replacing…which is an odd, but nice, coincidence.
But, the problem is that Virtualmin.com has been running for about a year on OpenACS. We’ve got a lot of data. Several thousand registered users, hundreds of forum posts, hundreds of bugs, and hundreds of products sold in the shopping cart. We also had a custom software license manager written for OpenACS, which keeps up with the begin and end date of our customers licenses, which has those hundreds of product sales information in its tables.
So, I’ve got to migrate that data. Luckily, OpenACS uses PostgreSQL and Joomla uses MySQL. Both are standard, popular, databases that can be accessed using just about any language. So, I’ve chosen to take this opportunity to learn a little PHP, and write some migration tools to automate the move.
The first result is a quick and dirty FAQ migration script that moves OpenACS FAQ entries over to a Joomla EasyFAQ. It doesn’t handle category creation, since that’s stored in a different table from EasyFAQ, and I didn’t want to learn how categories were created in Joomla, so you have to pre-create all of the categories and then fill in an associative array with the category numbers with OpenACS faq_id in the fields and Joomla catid in the values. Otherwise, it’s quite simple, and seems to work perfectly. Even the markup works after migration! I’ve posted the script since someone else out there might be making the same, or similar, move between two CMS systems or just two different databases and might find this a reasonable starting point. It’s not pretty, at all…it is my first PHP script, after all.
It took all of an afternoon, but I expect when I start working on the other datasets, like users and forums and bugs, it’ll go much faster (most of the time was spent figuring out why my various mysql_insert function attempts weren’t working…I ended up giving up on a generic function and just wrote the query out manually, since my PHP skills just aren’t up to the task of writing a generic insert function capable of handling arrays, yet).
Anyway, the reason I mentioned all of this is because I’ve tried to migrate data out of the Zope/Plone ZODB before…and I wouldn’t wish that task on anyone. Thanks to all those folks out their who understand that, sometimes, it’s OK to not reinvent every single wheel.
Here’s the script: faq-mover.php.gz

Post a Comment