Restore Course User Data/Grades Missing

Restore Course User Data/Grades Missing

by William Voyek -
Number of replies: 13

I have performed a backup of a course on a Moodle 2.3.5 installation and am attempting to restore it to a different installation of Moodle 2.3.5. During the backup I have used the default selections:

Backup settings

as well as clicking on Select All for both columns on the schema page. During the restore I selected "New Course" as the destination and again used the default settings:

Restore Settings

When going into the restored course there appears to be no user data. Enrolled users is empty, grade history is empty, assignments show zero submissions. However all forum posts are retained and associated with the correct user. Am I doing something wrong? Where is my data? 

Unfortunately we deleted the course from the source site after the backup file was downloaded. We do still have the mbz file. It is critical that we are able to restore our data.

Please help.

Average of ratings: -
In reply to William Voyek

Re: Restore Course User Data/Grades Missing

by Mark Pearson -

It sounds as though the data didn't get backed up in the first place. To investigate further you can rename .mbz to .zip and then unzip the backup file. Poke around in the moodle.xml file and see whether you can find any evidence of recorded grades. Also check for uploaded files. You should be able to satisfy yourself that either the data is present in the course backup or it is not. If the data is present then the restore process is malfunctioning (unlikely), if not then read ahead ...

If none of this works I'd suggest asking the system manager (perhaps yourself) for a copy of the database dump made prior to the deletion of the vital course. Then in a sandbox system (I've used MAMP on a Mac for this purpose) create a temporary moodle using a copy of the production code and the database with the vital course. You may not need the moodledata at all. This will have the vital course, enrollments and grades (depending upon the date/time that the database dump was executed) and you can redo the course backup from here. I've used this technique in an emergency to restore a course I accidently deleted.

Hope this helps.

In reply to Mark Pearson

Re: Restore Course User Data/Grades Missing

by William Voyek -

I am the sysadmin. The mbz file does contain the user data. I have verified by examining the main gradebook.xml file in addition to the individual activities/assign_xxx/grades.xml files. So, the backup at least appears to have completed successfully.

In fact if I do a backup of the restored course (where the gradebook appears empty), download the mbz, extract it, and examine the gradebook.xml and grades.xml files all of the data is there as well.

So why isn't the data visible when browsing the course?

Also, it isn't just that we need the data (as I have a very good backup strategy so recovery of the data is never in question) it's that we need to be able restore the course from the mbz backup file on a new installation. We need to be able to move completed courses from our production Moodle installation to our archive Moodle installation otherwise the production system becomes very cluttered with old courses.

Any other suggestions? I keep feeling like I'm just missing some setting or option. Being that all of the data is there on the archive server (I also verified it's existence in the db tables) there should be some way to make it appear in the web interface.

In reply to William Voyek

Re: Restore Course User Data/Grades Missing

by Emma Richardson -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers

Could it be a date or enrollment issue?  Were the students maybe unenrolled at the end of the semester?  If you reenrol the students in the course, do the grades show up?

In reply to Emma Richardson

Re: Restore Course User Data/Grades Missing

by William Voyek -

Ok we have started trying to do this with a new course without deleting it from the production server. Same results so far. No user data.

 

Regarding the enrollment query:  here is a partial screen cap of the enrollment page of the course on the production site:

enrollment

as you can see the students appear to still be enrolled but still when restoring the course there are no students (or instructors) enrolled. (I'm not sure if this matters but we use External Database as the enrollment method for all of our courses.)

(to pre-empt any questions about the "Instructor" role: Yes it is a custom role. Yes it exists on both sites. Permissions are identical and both sites even share the same roleid.)

After verifying that there are no students enrolled in the course I manually enrolled the Instructor and all Students in the course, went into the Gradebook and all of the grades appeared. It is good that I can now see the data however we run hundreds of courses with thousands of students and we cannot possibly go through this process for each course.

In reply to William Voyek

Re: Restore Course User Data/Grades Missing

by Lawrence N -

Which version of Moodle are you running?

There was a bug that user roles and enrolments were not successfully restored if the enrolments were using database enrolment. Only restored if they were manual or self enrolled

We experienced that ourselves so i wrote an external script to change them to manual instead for those enrolled via db method

In reply to Lawrence N

Re: Restore Course User Data/Grades Missing

by William Voyek -

Moodle version:  2012062505

Moodle release:  2.3.5 (Build: 20130311)

 

Do you have the bug ID? Has it been fixed? If so, in what version/release?

In reply to William Voyek

Re: Restore Course User Data/Grades Missing

by Lawrence N -

You would need at least 2.4.x+

https://tracker.moodle.org/browse/MDL-35071

 

In reply to Lawrence N

Re: Restore Course User Data/Grades Missing

by William Voyek -

Thank you so much for your help, Lawrence.

I really wish that the developers (since they decided not to fix 2.3 [even though it was the current release at the time]) would have at least included a patch for 2.3 that warned users of this issue when doing a backup of a course with the database enrollment plugin activated.

I think another poster may be having the same issue. I think I will post a link to this thread for him.

In reply to William Voyek

Re: Restore Course User Data/Grades Missing

by Lawrence N -

Not a problem William.

That was one of the key reasons why we're going to upgrade to the latest version. We are on 2.2.4+ (build 07162012) and asked management that even though we are going to upgrade to at least 2.5.1+, would they still want me to go and put into production, my workaround for now? They said yes .... LOL

We plan to migrate to production 2.5.1+ sometime in October (we hope)

In reply to Lawrence N

Re: Restore Course User Data/Grades Missing

by William Voyek -

I wanted to say thanks again. This did work. We upgraded our archive site to 2.4.5, restored the course (we did need to select the option to change the enrollments to manual) and all of the user data was there.

In reply to William Voyek

Re: Restore Course User Data/Grades Missing

by Lawrence N -

That is great... we are about to upgrade to the latest 2.5.1+ weekly build ... more testing and maybe some more cleanup.

Also will change our database to use MariaDB instead.

In reply to William Voyek

Re: Restore Course User Data/Grades Missing

by Jinxing Chen -

Hi, William

Where is the option to change the enrollments to manual during the restore process?

In reply to William Voyek

Re: Restore Course User Data/Grades Missing

by Lawrence N -

Have another idea for you William.

Install a base 2.5 or 2.4 on another machine.

Backup your 2.3.x course and restore it to the base 2.4 or 2.5 moodle

see if your enrolments are there... if they are, then you can be confident to upgrade with a reasonable amount of certainty that it would work.

http://qa.moodle.net/login/index.php