Unable to import grades

Unable to import grades

by Guillermo Madero -
Number of replies: 9

Hi,

Please help!! I'm going crazy trying to import a set of grades. I've read most documents and posts about this, and tried everything but to no avail...

My task is to move all courses/students from one site to another. The source site has Moodle 1.9.4+ (Build: 20090225), and the target site has Moodle 1.9.9+ (Build: 20100728). Just a few hours ago I finished installing and configuring Moodle at the target site, so the database was completely clean (without courses and without users, except for me as the only user).

With most courses the backup process went fine (same with the restore process); however, there were four courses in which the backup process froze, each and every time I tried (since yesterday). My solution was to make two backups for each course:

1. one in which I unmarked all the "user data" (right column from top section), and selected "no" to "user files" and "grade histories" (from the bottom section) --from what I understand, this will backup only the course material (by the way, if there is a document that explains in more detail how the different backup settings affect what is to be backed-up, I would be grateful if someone could make a  reference to it, as I still don't get the relationship between the settings at the top and bottom sections).

2. another in which I unmarked all the includes from the left column, and selected "no" to "course files" and "site files", and "yes" to "user files" and "grade histories" --I assume this will backup only user info/data/grades.

/* 1. only course data

Left column: everything On/Right column: everything Off
Users: Course
Logs: No
User Files: No
Course files: Yes
Site files: Yes
Grade histories: No

/* 2. only user data

Left column: everything Off/Right column: everything On
Users: Course
Logs: No
User Files: Yes
Course files: No
Site files: No
Grade histories: Yes

With these settings the backup processes finished succesfully (well, in a couple of them the process stopped while moving the zip file to the backup folder, but I copied them directly from moodledata/temp, as they had been completely made).

But alas! When I restored both files (the "course only" one as a new course, and the "user only" one as added to an existing course), the grades weren't there; everything else seems to be Ok, except for the grades (I haven't checked other areas, to be true, but the course structure, material, groups and participants are there).

My first attempt was to export grades to an Excel file, which I then opened and saved as a CSV file. I imported this file, taking care of mapping "from email address" to "usermail", and the respective grade entries. Didn't work. Later I opened the CSV in a text editor to save in UTF-8 and retried the import, but once again it didn't work.

My next attempt was to make a backup with everything from the top section turned off, and only selecting "yes" for "grade histories" at the bottom section:

/* only grades

Left column: everything Off/Right column: everything Off
Users: Course
Logs: No
User Files: No
Course files: No
Site files: No
Grade histories: Yes

I restored this "grades only" file, and yet, all participants appear without their grades. I checked this backup file, and the grades are there, in an XML file (it is the only file in the zip; there are folders, but they are empy).

So... what can I do?? Please, help me preserve the little sanity I've still left!

Is there a a script that could insert data directly into the database? Or a special, magical plugin to solve this? Or maybe I'm missing some kind of step, procedure, configuration? I really need to solve this as soon as possible.

Thanks to all for any help you may give,

Guillermo M.

 

In reply to Guillermo Madero

Re: Unable to import grades

by Elena Ivanova -

Hi Guillermo,

I am pretty sure that it is impossible to transfer the grades via backup files, so I would just concentrate on making the .csv import working smile

You said the import did not work. What was the error message?
Once you mapped the users, have you also mapped every column?
May be you can post a screeshot of your importing preview screen, like in here?

In reply to Elena Ivanova

Re: Unable to import grades

by Guillermo Madero -

Thanks Elena,

Well the import process ended successfully, or so it said, but when I went to see the grades, none appeared, and that is why I said that the import process didn't work.

Actually, the problem is not in the import process, but in the backup process, and here is why. The next two screenshots show my original backup settings and how the process froze and ended without any message:

original backup settings

Backup process frozen 

The next two screenshots show the settings I used when I decided to divide the backup in a "course only" zip and a "user only" zip:

course only

user only

At this point, everything seemed to be fine, as both backups finished and restored successfully; however, when I went to check the grades, none of the users had any, and that's when I tried the CVS import procedure (where I mapped the email and the grade entries --I did it several times!) and the "grade-histories only" backup/restore. As I said in my first post, both the CSV and the XML (from the backup) files, had the grades in them.

And here is why I said the problem lies in the backup process. As I felt that this "vertical" (course/user) division was missing something, I decided to do a "horizontal" division, that is, for the first zip I selected both columns (activities and user data), but only for four (tasks, forums, lessons, resources) of the five sections available, and for the second zip I did the same for the remaing section (questionaires). In both cases I selected "yes" for all options (except for "registers") at the bottom section. The answer came when I saw the file sizes:

different file sizes

Frame #2 shows the zip files I got for the "vertical" division ("course only" and "user only"), and frame #1 shows the zips from the "horizontal" division. Quite a difference! But I don't understand why. Evidently, after I restored the first two zips, all participants had their grades.

My problem is that I still have one course which freezes during a "questionaries only" backup, so I'm stuck.

So why does the "vertical" procedure doesn't include whatever it has to include? Or how should I set the options in order to complete the backup procedure and have everything in the zips?

I think there should be a document that explains in more detail how the different backup settings affect what is to be backed-up and restored, though I haven't found it smile

Thanks in advance for your help.

Guillermo

 

In reply to Guillermo Madero

Re: Unable to import grades

by Bob Puffer -

I've used the following instructions many times and suggested them to others and all feedback on their success was positive:

  1. Backup the course with "Grade histories" set to "yes" (its "no by default)
  2. Restore the course with "Grade histories" set to "yes" (again, its no by default)

I note in your pix that grade histories was off on the backup and on during the restore.  I don't really know if the fact the backup is coming from 1.94 will affect your success.  The gradebook in 1.94 is SOOOO different than 1.95 you may not have usable information when you're done.

In reply to Bob Puffer

Re: Unable to import grades

by Guillermo Madero -

Hi,

Well, I think the problem here is a bit more complicated, as I already explained.

Actually, all the pics I posted are from the backup, where the problem really lies. The one where "grade histories" is set to "no" is because I was saving only the course data, whereas it was set to "yes" when saving user data.

And the jump is even bigger, as I'm migrating to 1.9.9, but that hasn't been a problem, provided the backup process ends successfully.

Cheers!

In reply to Elena Ivanova

Re: Unable to import grades

by Guillermo Madero -

I was thinking, as this turned out to be a backup problem, should I repost it in the backup/restore forum?

 

In reply to Guillermo Madero

Re: Unable to import grades

by Elena Ivanova -

Hi Guillermo,
So, you regular backup/restore process while including grade histories is failing,  and that is why you are trying to create 2 backups.
I do not think that creating two partial backups, like you do, would help to overcome the issue. (Sorry, my previous post was a little confusing, since I omitted the note about those 2 partial backups).

Thus, in my suggsetion I was actually talking about the Import tab/area in the gradebook itself.
I would just  go to Administration block > Grades link > Export just grades from the course into Excel, and then Import from .csv into the new one.

In reply to Elena Ivanova

Re: Unable to import grades

by Guillermo Madero -

Yes, I tried that, but it didn't work because the backups are missing something. Thanks! smile

In reply to Guillermo Madero

Re: Unable to import grades

by Elena Ivanova -

I am confused now smile

You dot  not need any kind of backups to Import grades via the gradebook.

In reply to Elena Ivanova

Re: Unable to import grades

by Guillermo Madero -

Now we are two, hehe :p

I need backups because I had to transfer a course/student installation from one server into a new and empty one.

Most courses backed-up (and restored) OK, except for two, and that's when my problems began smile

I tried to solve the situation in two different ways:

1. My first attempt (which I named "vertical") to split the backups seemed to work for both courses (the backup process ended OK), but "something" is missing in the zips (as shown in the image where I compare file sizes --in a previous post), so not only they don't include grades, they also don't seem to include the "information or structure" (??) that allows (after restoring them) a grade import.

I did try the CVS grade file import (setting all options as required); no error messages, finished OK, but users were still without grades.

I also tried backing up and restoring only grades, same result (eventhough the XML file in the zip has all the grades).

2. My second attempt (nicknamed "horizontal") worked fine for one of the courses (so I didn't have any grade problems), but not for the other, as the backup process freezes at some point.

As I don't have access to the first (source) server, I can't play around with php config files and such (it's a problem we have with the guy that was in charge, where we even lost the domain; fortunately we still have access to a couple of admin accounts, and that allowed me to make the backups to recover our material).

Then? I'm in a dead-end, unabled to get a complete backup with all the info/data for one particular course sad

As things turned out, that course is not that important (most students completed it and a new version is being made), but... as I'm the one in charge of servers, installations, configurations, user's passwords, etc (I'm "backstage", so to say), I definetely don't like leaving problems unresolved. You know... I belong to the class of people that need to understand precisely what's happening at every step smile

Well, I guess I'll repost only the back-up situation in the proper forum; I'll surely learn something new, as usual smile

Thank you very very much for your time and your suggestions! Sincerely,

Guillermo