Xblocks - Mass migration

Dear OpenEDX community,

We are currently migrating a platform from OpenEDX Lilac legacy to OpenEDX Palm Tutor installation.

On our way, we encountered weird integrations, such as JS Scripts hard coded in HTML blocks and would like to migrate those to more centralized and formal Xblocks modules.

This means each of thoses individual hard coded scripts would have their own Xblock, for ease of use and maintenance.

We achieved this and are now looking forward to migrate all raw html modules to our new build Xblocks.

Do you have any hints / ideas on how to properly do such a task, is there any pre existing piece of code / software on Edx project that is meant for this purpose ?

Best regards,
François

On a course-by-course basis, you can export the course to a file, extract it, then use a script to rename the files and update the XML as needed. But if you have more than a few courses, that’s not really going to scale.

You’ll basically have to write a custom script that uses the python “modulestore” API to find, delete, and re-create the XBlocks in question.

Hello Braden,

Thank you for your response. It was helpful and confirms my previous day’s research on the topic.

Can you confirm that this technical documentation is suitable for experimentation?
https://openedx.atlassian.net/wiki/spaces/PLAT/pages/32309344/Modulestores

Best regards,
François