Backup / restore from 1.9.3 -> 1.9.19; no user data

Backup / restore from 1.9.3 -> 1.9.19; no user data

by Margaret Richards -
Number of replies: 7

Searching for this issue all I can find are the problems about losing user data from 1.9 --> 2.x so appologies if this is covered extensively elsewhere.


My installation of 1.9.3 is all buggy so I've installed 1.9.19 separately and am trying to backup my course (with 5 years of users/data) and restore it into the new installation. I had backup problems for a while (crappy, slow webhost) that are now resolved but I want to make sure my course backup works before upgrading the existing installation, hence doing the backup/restore in a new installation of Moodle.

My problem is that when I restore the course, no user data is included. I've double checked all the obvious - that user data is included, the checks are checked, etc. When backing up, I select to include everything - all (not just course) users, logs, grade histories, etc. The only error message I see in the backup transcript is "Notice: Undefined property: stdClass::$intro in /home/povert6/public_html/moodle/mod/certificate/backuplib.php on line 47" but that shouldn't have anything to do with getting user data out.

When I restore the course in the new installation, I get a number of errors/ warnings (these are not all of them):

 Warning: Attempt to assign property of non-object in /home/povert6/public_html/pattraining/lib/dmllib.php on line 1477


Notice: Trying to get property of non-object in /home/povert6/public_html/pattraining/mod/forum/restorelib.php on line 1005

Notice: Undefined property: stdClass::$restore in /home/povert6/public_html/pattraining/backup/restorelib.php on line 7757

Notice: Undefined index: FORMAT in /home/povert6/public_html/pattraining/mod/data/restorelib.php on line 449

Notice: Undefined variable: restore in /home/povert6/public_html/pattraining/mod/data/restorelib.php on line 454

Notice: Trying to get property of non-object in /home/povert6/public_html/pattraining/mod/data/restorelib.php on line 454

Notice: Undefined index: ASEARCHTEMPLATE in /home/povert6/public_html/pattraining/mod/data/restorelib.php on line 88

Questions:

  • Is there a particular error message I should be looking for that would indicate the usre data isn't being restored correctly?
  • Is there a way to check that my backup file does in fact include the user data?
  • Is there some known, general solution to this problem?


I am the only admin for this course but I'm only pretend computer savvy. Thanks!

Average of ratings: -
In reply to Margaret Richards

Re: Backup / restore from 1.9.3 -> 1.9.19; no user data

by Mary Cooch -
Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Testers Picture of Translators

I only pretend to be computer savvy too - I smiled at your commentsmile While waiting for someone who IS computer savvy to come along - do you have all the same contributed modules in your new Moodle as in your old Moodle? I noticed in one of your error messages it refers to the certificate module which you must have had in 1.9.3 but did you also install it in 1.9.19?

In reply to Mary Cooch

Re: Backup / restore from 1.9.3 -> 1.9.19; no user data

by Margaret Richards -

That's a good point, Mary.  I will install those modules now but I'm guessing that won't fix the whole probelm.

Thanks a lot!

In reply to Margaret Richards

Re: Backup / restore from 1.9.3 -> 1.9.19; no user data

by Margaret Richards -
I'm still looking for help on this if anyone is out there!
In reply to Margaret Richards

Re: Backup / restore from 1.9.3 -> 1.9.19; no user data

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
Hi

One possibility is your backups are corrupted, either due to the lack of server ressources or the Certificate module broke something.

You can check the integrity of your backups in two ways: a) inspecting them as discussed in "Re: Backup of courses fail in courses with .zip files" https://moodle.org/mod/forum/discuss.php?d=209990 or b) uploading them to another Moodle 1.9.19 which is known to be working.

BTW, have you installed and tested the Certificate module in the new Moodle?
In reply to Visvanath Ratnaweera

Re: Backup / restore from 1.9.3 -> 1.9.19; no user data

by Margaret Richards -

So I actually deleted the certificate module from my current course since I'm not using it anymore and also installed the Book module into my new moodle since that is included in my current course.

My user data still isn't showing up. I am getting the same error messages as before plus I noticed at the end, there are a large number of error messages relating to my gradebook (see below for sample).

Is there some way to fix any corruption in my gradebook since maybe this is the problem??

Could not insert object into db
  • line 292 of lib/grade/grade_object.php: call to debugging()
  • line 724 of lib/grade/grade_grade.php: call to grade_object->insert()
  • line 2355 of backup/restorelib.php: call to grade_grade->insert()
  • line 8918 of backup/restorelib.php: call to restore_create_gradebook()
  • line 66 of backup/restore_execute.html: call to restore_execute()
  • line 174 of backup/restore.php: call to include_once()
Duplicate entry '0-83' for key 'mdl_gradgrad_useite_uix'

INSERT INTO mdl_grade_grades ( ITEMID, USERID, RAWGRADE, RAWGRADEMAX, RAWGRADEMIN, RAWSCALEID, USERMODIFIED, FINALGRADE, HIDDEN, LOCKED, LOCKTIME, EXPORTED, OVERRIDDEN, EXCLUDED, FEEDBACK, FEEDBACKFORMAT, INFORMATION, INFORMATIONFORMAT, TIMECREATED, TIMEMODIFIED ) VALUES ( 83, 0, 1.00000, 1.00000, 0.00000, null, 0, 1.00000, 0, 0, 0, 0, 0, 0, null, 0, null, 0, null, 1334913948 )
  • line 1570 of lib/dmllib.php: call to debugging()
  • line 291 of lib/grade/grade_object.php: call to insert_record()
  • line 724 of lib/grade/grade_grade.php: call to grade_object->insert()
  • line 2355 of backup/restorelib.php: call to grade_grade->insert()
  • line 8918 of backup/restorelib.php: call to restore_create_gradebook()
  • line 66 of backup/restore_execute.html: call to restore_execute()
  • line 174 of backup/restore.php: call to include_once()
Could not insert object into db
  • line 292 of lib/grade/grade_object.php: call to debugging()
  • line 724 of lib/grade/grade_grade.php: call to grade_object->insert()
  • line 2355 of backup/restorelib.php: call to grade_grade->insert()
  • line 8918 of backup/restorelib.php: call to restore_create_gradebook()
  • line 66 of backup/restore_execute.html: call to restore_execute()
  • line 174 of backup/restore.php: call to include_once()
Duplicate entry '0-83' for key 'mdl_gradgrad_useite_uix'

INSERT INTO mdl_grade_grades ( ITEMID, USERID, RAWGRADE, RAWGRADEMAX, RAWGRADEMIN, RAWSCALEID, USERMODIFIED, FINALGRADE, HIDDEN, LOCKED, LOCKTIME, EXPORTED, OVERRIDDEN, EXCLUDED, FEEDBACK, FEEDBACKFORMAT, INFORMATION, INFORMATIONFORMAT, TIMECREATED, TIMEMODIFIED ) VALUES ( 83, 0, 1.00000, 1.00000, 0.00000, null, 0, 1.00000, 0, 0, 0, 0, 0, 0, null, 0, null, 0, null, 1335265380 )
  • line 1570 of lib/dmllib.php: call to debugging()
  • line 291 of lib/grade/grade_object.php: call to insert_record()
  • line 724 of lib/grade/grade_grade.php: call to grade_object->insert()
  • line 2355 of backup/restorelib.php: call to grade_grade->insert()
  • line 8918 of backup/restorelib.php: call to restore_create_gradebook()
  • line 66 of backup/restore_execute.html: call to restore_execute()
  • line 174 of backup/restore.php: call to include_once()
Could not insert object into db
  • line 292 of lib/grade/grade_object.php: call to debugging()
  • line 724 of lib/grade/grade_grade.php: call to grade_object->insert()
  • line 2355 of backup/restorelib.php: call to grade_grade->insert()
  • line 8918 of backup/restorelib.php: call to restore_create_gradebook()
  • line 66 of backup/restore_execute.html: call to restore_execute()
  • line 174 of backup/restore.php: call to include_once()
Incorrect grade array index, must be user id! Grade ignored.
  • line 201 of lib/gradelib.php: call to debugging()
  • line 544 of mod/scorm/lib.php: call to grade_update()
  • line 482 of mod/scorm/lib.php: call to scorm_grade_item_update()
  • line 1154 of lib/gradelib.php: call to scorm_update_grades()
  • line 1072 of lib/gradelib.php: call to grade_update_mod_grades()
  • line 8953 of backup/restorelib.php: call to grade_grab_course_grades()
  • line 66 of backup/restore_execute.html: call to restore_execute()
  • line 174 of backup/restore.php: call to include_once()
In reply to Margaret Richards

Re: Backup / restore from 1.9.3 -> 1.9.19; no user data

by Margaret Richards -

I found this post (https://moodle.org/mod/forum/discuss.php?d=105230#p464599) which got me to look at my databases. I know nothing about databases so I'm winging it. I noticed a few things:

  • The DB names in my new install all start with mdl_ whereas my old install has the same names without the mdl_. Does this matter?
  • Comparing the grade_grades entries in the 2 different DBs, I see they have different ids for specific users (ie a guy named Samnang has ID 31 in the new database but has ID 58 in the old database; I can tell this by seeing his name in a comment on one of the graded items that match both.
  • There is data in grade_grades in my new install but there are only two people in the DB 'mdl_user' and those are the ones I've manually added.

Does any of this info lead anyone to a solution?

Average of ratings: Useful (1)
In reply to Margaret Richards

Re: Backup / restore from 1.9.3 -> 1.9.19; no user data

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
Hi

The problem is definitely not the "mdl_" table prefix. A mishap there would have given you the dreaded "Database not available" message.

The other one, two IDs for the same user, that doesn't sound good. Is that the same user or not? Read 'Moodle Restore fails with "Trying to restore user xxx from backup file will cause conflict"' https://moodle.org/mod/forum/discuss.php?d=213807.

Before starting to look into workarounds, think again why you are doing this "course-by-course migration" and not a site migration.