Oddbod reaches 0.8.0
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.
If you want to give Oddbod a trip out of the lab, you’ll need an svn client and feed it the following command:
svn checkout https://source.uhi.ac.uk/svn/oddbod/tags/REL-0.8.0 oddbod
The above will get you a directory called oddbod, with import and export directories within. Read export/README for instructions on how to get your data out of 0.9. That will give you a load of ODD XML files, in export/oddfiles. Just transfer those ODDies to your 1.5 server, drop import/oddbod into your mod directory, enable, add to your dashboard and feed it the ODDies one by one.
Oddbod likes onions, which is why the data is layered onto 1.5. It’s more manageable, building up each layer, one on top of the other and you can test at each stage to see if Oddbod is behaving. I’ve tested it between 0.9.2 and 1.5 and it works ok for me. If you fancy jolting the volts into Oddbod, flick that switch and drop me a line if there’s any problems.

Why is it called Oddbod you might ask? Well, the data migration is based on ODD files and when I initially started on it, I wasn’t sure whether it was possible, so it was a big experiment in taking live objects from one place to another, which is what Oddbod, the hairy round the edges character from Carry on Screaming, excelled at!
The next stage is to migrate the files from 0.9 but that’s going to be tricky as folders have been removed from 1.5.
In the meantime, give Oddbod a go, he might be able to get you out of 0.9
Ruby backend via Apache : Passenger + Rack »
Comments
Comment from Martk Pearson
Time: 23/3/2009, 6:47 pm
Bloody brilliant boyo! Just what I’ve been waiting for. Have got a growing site on 0.92 (see Website URL) and now I can start moving the data over to test out 1.5. I do have a residual concern about the blogging capabilities of v1.5, since the blog is what my teaching faculty find really exciting about Elgg 0.92.
“Oddbod likes onions, which is why the data is layered onto 1.5. It’s more manageable, building up each layer, one on top of the other and you can test at each stage to see if Oddbod is behaving. I’ve tested it between 0.9.2 and 1.5 and it works ok for me. If you fancy jolting the volts into Oddbod, flick that switch and drop me a line if there’s any problems.”
I do like this approach. It means that if you’re careful and do backups between each stage you can always roll back and cock-ups. Talking of cock-ups Wales really screwed up this year, eh?
Anyhow, I will try this out in the next week or so, and thanks for the work on this.
Comment from Alistair
Time: 24/3/2009, 8:38 am
@David
Don’t really have time to look at the other plugin. My priority is getting us a migration path out of 0.9 and thinking about getting folders back. Perhaps the key Elgg developer could concentrate on that?
@Martk
hope it’s useful for you. Note that it logs in /tmp/oddbod-log. You can change that in utils.php::oddlog()
Comment from Justin Richer
Time: 26/3/2009, 4:56 pm
This is great. I’ve tested it out on my dev site and will be using it to move over our larger site later this month. We’re also very interested in expanding this to work with things like files and other artifacts from the old system into the new. Have you put any thought into that yet?
Comment from Alistair
Time: 26/3/2009, 9:17 pm
I’m planning to migrate files next week. As there are no folders in 1.5 I think friend collections and tags will have to be used instead. In the first instance I’ll just migrate files not in folders along with the correct permissions. Comment wall posts can be migrated as message board posts. Another thing is modifying blog contents as links to files, youtube markup etc won’t work in 1.5 so will need to be munged on the way across.
Comment from Justin Richer
Time: 1/4/2009, 7:11 pm
Not sure if this is the best place for sending you fixes, but here’s a change to odduser.php that’ll do the proper icon resizing of profile icons on import:
if ($icon_data != “”) {
$filehandler = new ElggFile();
$filehandler->owner_guid = $user->getGUID();
$filehandler->setFilename(“profile/” . $user->username . “master.jpg”);
$filehandler->open(“write”);
$filehandler->write($icon_data);
$filename = $filehandler->getFilenameOnFilestore();
$topbar = get_resized_image_from_existing_file($filename,16,16, true);
$tiny = get_resized_image_from_existing_file($filename,25,25, true);
$small = get_resized_image_from_existing_file($filename,40,40, true);
$medium = get_resized_image_from_existing_file($filename,100,100, true);
$large = get_resized_image_from_existing_file($filename,200,200);
$filehandler->setFilename(“profile/” . $user->username . “large.jpg”);
$filehandler->open(“write”);
$filehandler->write($large);
$filehandler->close();
$filehandler->setFilename(“profile/” . $user->username . “medium.jpg”);
$filehandler->open(“write”);
$filehandler->write($medium);
$filehandler->close();
$filehandler->setFilename(“profile/” . $user->username . “small.jpg”);
$filehandler->open(“write”);
$filehandler->write($small);
$filehandler->close();
$filehandler->setFilename(“profile/” . $user->username . “tiny.jpg”);
$filehandler->open(“write”);
$filehandler->write($tiny);
$filehandler->close();
$filehandler->setFilename(“profile/” . $user->username . “topbar.jpg”);
$filehandler->open(“write”);
$filehandler->write($topbar);
$filehandler->close();
$user->icontime = time();
…
Comment from Alistair
Time: 2/4/2009, 8:34 am
thanks Justin! I’ve just implemented the files export/import so I’ll add this mod to it too. Much appreciated.
Comment from Justin Richer
Time: 2/4/2009, 1:00 pm
That’s great to hear! Also, it seems I missed a $filehandler->close() up top, right after the $filename variable gets set. Doesn’t seem to do any harm, but better to stick to the API as intended.
Comment from Luis
Time: 30/6/2009, 4:57 am
Hello, thanks for help, and make this solutions to migrated elgg.
I tried use you Oddbod, but I have this errors:
hobbysoft:/var/www/web/oddbod-0.9.0/export# ruby oddbod.rb users oddfiles/09_users.xml
connecting…
loading users…
loading communities…
/var/www/web/oddbod-0.9.0/export/community/communityfactory.rb:50:in `block in load_communities’: undefined method `[]‘ for nil:NilClass (NoMethodError)
from /var/www/web/oddbod-0.9.0/export/community/communityfactory.rb:27:in `each’
from /var/www/web/oddbod-0.9.0/export/community/communityfactory.rb:27:in `load_communities’
from oddbod.rb:53:in `’
hobbysoft:~# ruby -v
ruby 1.9.1p0 (2009-01-30 revision 21907) [i686-linux]
hobbysoft:~# gem -v
1.3.1
I use debian etch. Thanks…
Comment from David Delgado
Time: 23/3/2009, 2:17 pm
There is another Elgg plugin to do the same at http://community.elgg.org/pg/plugins/dramirez/read/40402/migration-tool-10 , made by one of the key Elgg developers: Diego Ramírez. Could you take a look at it and see if we could make some magic mix to get the best results? Thanks a lot in advance.