I've some clues but I'm afraid this is a big and tedious task.
tables which deals with AL are mdl__course_module_locks and mdl_course _modules
Well in :
Lockid is the mdl_course_module "id" of blocker activity/res
moduleid is the "lock owner", the mdl_course_modules "id" of blocked act/res
These are the fields you need to recalculate:
in order to know which is which:
in Course modules you need the fields: "module" and "instance"
looking for "id" at table "mdl_modules" you'll see which is the kind of module
and looking to table "mdl_<kind>" the "id" field is the value of "instance". that row should contain enough data to identify your new created resorce ....
If you're willing to test a piece of VERY EXPERIMENTAL code, we at Warp Networks
are working for a customer who wants to backup&restore courses of an Activity Locking enabled moodle. We plan to release soon this patch to moodle community for versions 1.7.1+ and 1.8.1 but needs more testing.
It's a patch for backuplib.php and restorelib.php. in our tests we were able to back-up a (little) course from 1.7.1 CVS
and restore it to a 1.8.1
if you want to give it a try, feel free to send me a message, I can't attach it here due to size restrictions and because we want test it more before release it in moodle modules database.