This plugin has two parts. A set of export scripts that export 0.9 data as ODD files and a 1.5 plugin that imports them. 0.9.0 supports migrating:
Read export/README for how to export the 0.9 database as ODD files. Copy import/oddbod to your /mod folder in 1.5 and feed it each ODD file in turn.
more info at:
View Codebrane's plugins
info@elgg.org
Security issues should be reported to security@elgg.org!
©2014 the Elgg Foundation
Elgg is a registered trademark of Thematic Networks.
Cover image by Raül Utrera is used under Creative Commons license.
Icons by Flaticon and FontAwesome.
0.9.0 supports migrating files. I haven't used the folder structure from Elgg 0.9 as 1.5 doesn't support folders, so the file hierarchy is flattened to 1.5. Ownership/permissions are preserved. As files are exported/imported as ODD files, they can get too big to process, so the file export creates multiple ODDs in the specified directory.
To export files from 0.9.x:
cd export
ruby oddbod.rb files oddfiles/files
To import files to 1.5:
copy oddfiles/files to your 1.5 server
point the oddbod plugin at the oddfiles/files directory
If you get a blank page when importing, go back to export and change the line in generators/filebod.rb:
if (bod_count > 20)
change it to something less than 20!
I can export (and I exported from Elgg0.9) but when i tried to Import with Oddbod mod (Elgg1.5), it redirect to "/elgg/action/oddbod/import", yes, a blank page.
What should i try? Thanks!
In that case, reduce the number of files exported in an ODD file:
cd export/generators
open filebod.rb in a text editor
change line 21 from:
if (bod_count > 20)
to
if (bod_count > 10)
and run the files export again to get smaller ODD files. You can test with just 10 exported files (quicker than exporting all files) by changing the SQL:
cd export
open db.rb in a text editor
change line 15 from:
@db.query(query)
to:
@db.query(query + " limit 10")
you can then test to see if 10 is ok in one ODD file. If not, change to something less in filebod.rb and export again. I'm sure there's a better way round it but I haven't got the time to research it more at the mo.
Thanks for answering.. I did what you told me:
/tools/export# ruby oddbod.rb users 10try.xml
connecting...
loading users...
loading communities...
processing users...
entity : news
entity : oscardmartin
entity : pepe
entity : jlfernandez
entity : alumno
entity : tracor
entity : larana
entity : iirurozqui
entity : aalonso
entity : ljartigas
metadata : news
metadata : oscardmartin
metadata : pepe
metadata : jlfernandez
metadata : alumno
metadata : tracor
metadata : larana
metadata : iirurozqui
metadata : aalonso
metadata : ljartigas
writing file : 10try.xml
processed 10 users
But when I entered the file path and import.. nothing happ! that blank screen again. :(
Do you have any idea to share? I don't know what more could be.
I don't know if this matters but when I press ok to import the file it sends me to the URL: "/elgg/action/oddbod/import" but i don't even have the action folder. Is actions and there is no oddbod folder inside. This is so confusing.
I tried to change the URL from action to actions in "mod/oddbod/views/default/widgets/oddbod/view.php" but it dowsn't work, there is nothing about oddbod in this folder. I tried to copy the files there too but an error appears:
Sounds like a .htaccess error :S
Halp!!
That's how Elgg works. The action is in the actions folder in the plugin. Is your 1.5 on a different server from your 0.9? Did you copy 10try.xml to the 1.5 server? What's in your /tmp/oddbod-log file?
Note that the plugin only supports unix so if you're running on windows you'll need to make some changes to paths.
The blank page prolly means it can't find 10try.xml - have a look in /tmp/oddbod-log - no changes are needed to anything in the plugin if you're running on unix.
Thanks for answer dude,
I have my old Elgg and the new one in the same server, just different folders. I have copy the 10try.xml to the new 1.5 elgg folder and tried to run with the oddbod plugin but it doesn't work.
I guess it doesn't find the file too, that's why I made a copy of 10try.xml inside the 1.5 elgg folder "tracor.es/campus/elgg" assuming this is the root for search the files, and I tried to just type the name of the file. It doesn't work either.
:_(
I forgot!
I don't have any log folder or file. Gotta check it out.
Ok, I fixed it.
Just needed to change some PATHS in ELGG conf.
Thanks for all :)
Export part of migration tool just crashed out on me:
writing file : oddfiles/09_users.xml
/usr/local/lib/ruby/1.9.1/rexml/text.rb:375: [BUG] Segmentation fault
ruby 1.9.1p0 (2009-01-30 revision 21907) [i686-linux]
As suggested I filed a ruby bug report 1364 at redmine.ruby-lang.org
Is this is REXML issue mentioned in the README file even though I was using 1.9.1p0
File oddfiles/09_users.xml had reached 6.2M before the crash happened.
@SysKNoT - excellent! does that mean you can export/import users ok? Forgot to say, you need to give it the full path on the server to the file!
@Kevin - I ran the exports on a Mac. text.rb:375 for me equates to:
copy = copy.gsub(entity.value, "&#{entity.name};" )
wonder if there's something in the user info that's causing it. You could watch the output and see what user was the last processed before the barf and check the info in the db. I'm sure there are edge cases I don't know about as it all works ok from my 0.9.2 db. You could put some puts commands in generators/userbod.rb to see what user causes the problem. What' happened is it's exported the users from the db ok but barfed when trying to create the ODD file. 6.2M is nothing on the export side, that'll work fine. My 09_files.xml is 1.8G!
It's not the REXML issue mentioned - that's to do with splitting textnode data when saving to file. Looks like it might be data on the user causing an entity problem.
@Codebrane - Yep it works, Thanks for all.
BTW I want to add something about this plugin. When I imported all the users and his Blogs/data i need to re-activate all the users again. They imported deactivated. Are there some know way to activate all users in my BD?
Perhaps it has something to do with the email verification plugin? If you disable that first, then do the user import, they should be imported as active.
Ok, I'll try again with verification disabled.
Why the oddbod exporter only export 138 entries? I know one of my tables have more t han 138 rows... well, whatever..
I tried to re-import again with uservalidationbyemail deactivated but it doesn't work. The old accounts still need the user-email activation. Any ideas?
I export 1400+ users. You must only have 138 users. 0.9 users table doesn't just contain users. It contains communities too. Communities in 0.9 are just users with a user_type = community, so the user export doesn't export them. They get exported by the community export.
If you've already imported them, the user import won't re-import them, it'll just update them. You'll have to delete them. It's a good idea to import on a test db first. They'll still be in the db from the first import but marked as being required to validate via email. Clean out your db and re-import.
Ok, As I though I should clean my bd before re-import again... I'll check and try it again!
Ok, I started again with a new elgg installation with clean db. I deactivated the uservalidationbyemail plugin and then import.
Nothing happend. The users are still unactivated. When I tried to log-in with an imported account it still ask me for email link verification...
How can I ativate users manually? Wich table, option, plugin, mod, block, whatever! I need to activate them! @_@
they must still be in the system. Elgg itself must be doing it as I use register_user() to create the users, so your original import must still be there. Is it a clean elgg and clean database?
I used a clean elgg1.5 and database. I started from 0. Create the elgg community first, export entries from my old elgg0.9 community and then use the oddbod to import into the new one with the uservalidationbyemail deactivated. They are still unactive. What can I do?
Can I activate users manually? <---- I'd rather this one.
Not sure how you activate them manually - best to ask on the 1.5 forum. No idea why they're not activated by default. Mine are all activated when they're created.
Many of the imported accounts just don't say anything on login, it just send back to the login form. No error, no warnings, nothing, just doesn't work x_x
doh! I completely forgot - I designed it for use here, where we use LDAP, so the password doesn't matter. The importer generates a random string of letters and numbers for the password. I'll see if the password hashing is the same between 0.9 and 1.5 and update the exporter to export the hashed password from 0.9 and import it into 1.5. Sorry about that!