I’ve been using PHP for yonks for backend stuff for UIs and when I noticed Ruby I also noticed it was nowhere near as easy to use from Apache as PHP. Until now that is. Using Phusion Passenger, you can set up script handlers for UIs using Ruby: (more…)
It’s so invigorating, working in two languages at once. Ruby for the export and PHP for the import. It’s like dooking your brain in ice cold water every 5 mins. Very stimulating I must say. And indeed, it has resulted in the release of Oddbod 0.8.0
I’ve taken stock and decided to release the code as the next step is going to be a big one, files. In the meantime I’ve put the electrodes on Oddbod’s head and tagged it up in our svn. The 0.8.0 release has the following migration functionality, to get you from Elgg 0.9 to 1.5:
users and their icons, user profiles, communities, community profiles, community memberships, friends, blog posts with comments, community blog posts with comments. All posts and comments have their original published dates with the comments having the correct ownership and permissions.
Oddbod also disables outgoing email notifications, as this can cause confusion in your user base when the friend networks are migrated. Users would otherwise get emails saying they have new friends, which they already know, as the friend network is coming hot off the press from 0.9. (more…)
I’ve now finished the first stage of the Elgg 0.9 to 1.5 migration, taking the users and their icons across in an ODD file that I generated from the 0.9 database with some Ruby scripts. I then finished off the 1.5 plugin that consumes ODD files and imported the users file. Worked a treat. The plugin is called Oddbod and I’ll extend it bit by bit as I progress from layer to layer in the 0.9 data model. Once I get to migrating communities, I’ll be using the ODDbod profile, which is an extension to ODD that I’m working on to define community entities and relationships. When you’re working with XML it’s always a good idea to have an XML Schema, so I knocked one up for ODD and the ODDbod profile as well as a maven pom and some Java unit tests. This gives Java developers easy access to ODD documents. You can download ODDBeans from my githib site.
I’ve been making progress with Oddbod, to migrate Elgg 0.9 to 1.5 but have come up against a bit of a blocker. REXML has a bug in its printing subsystem. I managed to uncover it when adding profile metadata to an ODD document for the profilephoto_filename, which is a very long string of characters. When REXML sees this string, it tries to split it on the last space after its internal limit of 76. But file paths don’t have spaces normally, so it barfs on the equivalent of a NullPointerException. There doesn’t seem to be a way to specify the width when printing. There is a crap workaround of adding the text as CDATA but there’s no way I’m doing that as I have to parse these ODD docs using PHP in a 1.5 plugin, which I’ve yet to write and I want to keep it as simple as possible. Luckily I can get round it by not specifying the full path, just the start from the ELGG data dir. The bug is documented here. Can’t really complain though, as a) there’s a workaround and b) REXML is superb.
With the upcoming release of Elgg 1.5, there’s been talk of the migration plugin, or rather its absence, after it was scheduled for release with 1.5. That means there’s no easy way to get out of what seems to be a deprecated 0.9 Elgg product. A bit frustrating when you can peek over the wall and see all that shiny new API and architecture but there doesn’t seem to be a way to get over the wall. So I decided to bite the bullet and delve into the murky world of migration, Elgg 0.9 style.
The first problem I found was that 1.5 doesn’t support the concept of communities and considering this is basis of 0.9, that’s a pretty big problem. In more ways than one, 1.x is a completely different product from 0.9. It’s not too bad though, as 1.5 seems to use groups as communities. It’s just as weird in 0.9 though as it uses users as communities. In the best traditions of Spike Milligan and The Bed Sitting Room, users in Elgg have transmogrified from humans into buildings! (more…)
Just some reading lists I’ve picked up and must work my way through:
10 Papers Every Programmer Should Read
10 Papers Every Software Architect Should Read