GBPv2 Migration from 1.8 to 1.9

GBPv2 Migration from 1.8 to 1.9

by Anthony Borrow -
Number of replies: 11
Picture of Core developers Picture of Plugin developers Picture of Testers
I'm beginning this thread to discuss how we ought to move toward migrating the GBPv2 data from Moodle 1.8 to 1.9. I have started to play with some SQL queries and figured that sharing my thoughts (I would not call it progress yet) might be helpful as we work toward this. Please keep in mind that these queries are intended to only show the relationship beween the tables so that we can work out a migration plan. They are not intended to be run on a production site. My typical warning of using it in so far as it is helpful and avoiding it in so far as it is not certainly applies. With that said, I see the migration as involving 2 steps. Migrating the grade events (1.8) to grade items (1.9) and grade event grades (1.8) to grade grades. What may complicate things or what I am least clear on at this point is moving from grade category (1.8) to grade categories (1.9). For now, I am ignoring the issue of categories.

To move the grade events to grade items I am thinking of doing something like:

INSERT INTO mdl_grade_items (courseid, categoryid, itemname, itemtype, iteminfo, idnumber, grademax, grademin, timecreated, timemodified)
SELECT gi.courseid as courseid, gi.category as categoryid, ge.name as itemname, 'manual' as itemtype, ge.description as iteminfo, concat ('GBP-',ge.id) as idnumber, ge.grade as grademax, 0 as grademin, ge.timemodified as timecreated, ge.timemodified as timemodified
FROM mdl_grade_item as gi, mdl_grade_events as ge
WHERE gi.courseid=ge.course AND gi.modid=0 AND gi.cminstance=ge.id;

n.b. - We need to make sure that the categoryid is correct - I have not looked to see how the data is getting mapped in the 1.8 to 1.9 upgrade.

I have used the grade event (1.8) id field concatenated with the GBP- string as the id number to easily identify the item as a GBP item and to provide a way to easily link the items (1.9) and assign the grades.

INSERT INTO mdl_grade_grades (itemid, userid, usermodified, finalgrade, timecreated, timemodified)
SELECT gi.id as itemid, geg.userid as userid, geg.teacher as usermodified, geg.grade as finalgrade, geg.timemarked as timecreated, geg.timemarked as timemodified)
FROM mdl_grade_events_grades as geg, mdl_grade_items as gi
WHERE replace(gi.idnumber,'GBP-','')=geg.event;

I have not tested these queries out yet but wanted to get some conversation and ideas out there as I know that some folks are chomping at the bit to get started. I appreciate any feedback, questions, critiques, etc. Peace - Anthony
In reply to Anthony Borrow

Re: GBPv2 Migration from 1.8 to 1.9

by Anthony Borrow -
Picture of Core developers Picture of Plugin developers Picture of Testers
I have updated my notes on an initial plan for upgrading the GBPv2 grade events to Moodle 1.9 grade items at: http://docs.moodle.org/en/Gradebookplus#Migration_from_GBPv2_to_Moodle_1.9. I am also attaching a copy of the SQL statements that I used to migrate the data on a TEST server (using a backup copy of production data). As best as I can tell, at the very least it does not totally destroy things. Currently 1.9beta is undergoing some heavy duty tuneups that have made it less than optimal for testing; however, if you would like to try these statements out and see what happens and report back on your experience I would greatly appreciate it. Peace - Anthony
In reply to Anthony Borrow

Re: GBPv2 Migration from 1.8 to 1.9

by Udi Ben-Haim -
Hi Anthony
Can I install GBPv2 on a local v1.9 server ? Is it compatible with the new gradebook - for empty DB ?
Thanks
Udi

In reply to Udi Ben-Haim

Re: GBPv2 Migration from 1.8 to 1.9

by Anthony Borrow -
Picture of Core developers Picture of Plugin developers Picture of Testers
Udi - The hope is that Moodle 1.9 makes the GBPv2 patch obsolete. You should be able to accomplish everything with Moodle 1.9 that you were able to do with GBPv2. If you need help migrating the data from Moodle 1.8 with GBPv2 to Moodle 1.9 let me know as I have some ideas as to how to make that happen although I have not been able to do any thorough testing. What feature of GBPv2 are you looking to use? Peace - Anthony
In reply to Anthony Borrow

Re: GBPv2 Migration from 1.8 to 1.9

by Udi Ben-Haim -

Anthony – Being new to Moodle I have to admit I did not use GBP.

I need functionality I did not find in grades in V1.9  and wanted to learn what existing  plug-in can offer.  But maybe the best way is to describe the problem, and ask your advice for appropriate solution:

 

I am using courses with Metacourses as described in

http://docs.moodle.org/en/Metacourses   in Scenario 4, (metacourses hold most of the course content, and used as library. Students register to the class  (not-meta course) , which includes several metacourses.

I need a gradebook  which combine grades from few courses (meta courses) into one classes (non-meta course).

Any advice – either on different way to build the library and classes, or way to create and display grades for multiple courses will be mostly appreciated.

Thanks

Udi

In reply to Udi Ben-Haim

Re: GBPv2 Migration from 1.8 to 1.9

by Anthony Borrow -
Picture of Core developers Picture of Plugin developers Picture of Testers
Udi - My apologies for the delayed response. I did not understand exactly what you were asking for and filed this away in my followup folder and so now I have a chance to followup. Could you explain to me again what it that you are trying to accomplish (assuming that you have not already figured it out on your own). Peace - Anthony
In reply to Anthony Borrow

Re: GBPv2 Migration from 1.8 to 1.9

by Sarah Quantick -

I have converted from 1.61. to 1.9 the gradebook previously was using GBPv2. All data seems to have migrated across successuful however when I click on grades the page takes a long time to load up, longer than previously and sometimes it doesn't load up at all.

I saw the information about migrating 1.8 GBPv2 to 1.9 but when I tried to run the first two queries I got errors saying that the mdl_grade_item doesn't exist and that the mdl_grade_catergory doesn't exist

Is there something else I need to do the database is rather large and we were hoping that 1.9 would speed things up for us

Sarah

In reply to Sarah Quantick

Re: GBPv2 Migration from 1.8 to 1.9

by Anthony Borrow -
Picture of Core developers Picture of Plugin developers Picture of Testers
Sarah - Did you step through the upgrades (i.e. 1.6 -> 1.8, 1.8->1.9) or did you go straight from 1.6->1.9? Peace - Anthony
In reply to Anthony Borrow

Re: GBPv2 Migration from 1.8 to 1.9

by Matt Campbell -
Anthony -

I'm doing a completely new upgrade test - it's been at least a couple of weeks since I did so, and that one went off without a hitch. Now, however, I am getting some errors and I'm concerned that it may be related to GBPv2. I've filed MDL-11909 - I don't think that my problem is in GBPv2, but in something that's changed that affects how GBPv2 is upgraded from 1.8.2 to 1.9. Would you take a look at the bug and see what you think? I'd like to see if we can get this one worked out.

Thanks,
Matt
In reply to Matt Campbell

Re: GBPv2 Migration from 1.8 to 1.9

by Anthony Borrow -
Picture of Core developers Picture of Plugin developers Picture of Testers
Matt - I just wanted to followup and make sure that MDL-11909 was resolved and working for you. Peace - Anthony