Claroline to Chamilo migration script
This is a reserved space for anyone wanting to collaborate on a script to migrate from Claroline (NOT Claroline Connect) to Chamilo LMS 1.10.
We believe that users should be free to migrate from one system to another so they have freedom of choice for their LMS, even if they started with one that doesn't suit their needs, so providing a migration script is just a matter of giving people a choice. If other systems want to make migration scripts from Chamilo to theirs, they're free to do it. The system is open so there's no hidden stuff.
Migrating from one system to another is always a complex thing. Systems have their own inner logic, and the database structure usually links different resources in a way that makes both getting and recreating the information complex. However, following a few basic principles, the complexity might be reduced considerably.
Principle 1: Use native functions¶
When restoring the data on Chamilo LMS, use the native Chamilo LMS functions and methods. For example, to create a user, do not try to insert the user directly into the database. Instead, use the UserManager::create_user() method so that Chamilo LMS handles all the complexity.
Obviously, if the other system is developed using PHP and is open source, you might even be able to use the native functions from the original system to get the information into a nice array in the first place.
For example, in Claroline, you can get a user with the user_get_properties() function in main/inc/lib/user.lib.php. However, as you might see looking at the function itself, the only thing it does is a "select * from user" (table), so you can skip it if you want. Other functions might still prove much more relevant (it's all relative to the complexity of getting data another way).
Principle 2: Use a standard, clean transfer format¶
If both systems use PHP, then you can probably build a big array, serialize it (with serialize() / unserialize()) into a file and get going.
If that's not the case, then prefer a modern standard format like JSON, for example, so it is minimally readable even without any script to open it.
Principle 3: Work gradually¶The best way to migrate things is probably to think about what's essential. In a migration from LMS to LMS, you will probably want to migrate things in an order similar to this:
- Configuration settings
- Sessions (if that notion exists in the other system)
- Link between users, courses and sessions
- Course content
- User results
Getting further into that list should allow for you to consider whether to continue writing the script or to proceed manually for the rest of it.
To get started, I've created a basic script in tests/migrations/claroline/1.11.10/ in the Chamilo development branch. This should let us get started.
This does not have to be finished before 1.10.0, so I'm setting it for 2.0 as a goal.
Updated by Yannick Warnier over 3 years ago
I will only be able to work on user pictures, passwords and migrating courses a bit later.