Import courses from 1.8.2+ to 1.9.1 - Role mapping issue

Import courses from 1.8.2+ to 1.9.1 - Role mapping issue

by Jean-Luc Delghust -
Number of replies: 5
Hi everybody

I haven't found the answer to my question in the docs, maybe I haven't looked enough but still, I need to get this done by the end of the week so I'll just go ahead and ask the question here.

/background ON/
2 years ago, we started using Moodle in our department. The last version we used was 1.8.2+, on our own servers. Our "little" test with Moodle being quite a success, more departments at our university are starting to use Moodle, and a common Moodle platform was created on the uni servers so students wouldn't have to create a new account on our platform, but would be able to use their uni login and password.
/background OFF/

So now, I need to import all our courses from our server to the uni server. I've started importing the courses without users or user data (as the accounts will be different now). The Uni platform is 1.9.1
I proceed as follows: I backup the courses without any users or user data, I just keep the course files. Then, I transfer the backup files to a "Import" course on the new platform and restore them as new courses from there.
Something strange seems to be going on when it comes to roles: for some courses, after restore happened without a glitch, I go to "Assign Roles" to give teachers back their role in their courses, but with their Uni account (hope you're still following).

Now, that's where I see that some roles are between brackets. Those are the roles that are present in "Role Mapping" just before restoring the course.
Strangely, that didn't happen at the beginning, when I imported the first courses. In the meantime, the admin added a few question types (matching & ordering), Scheduler, Questionnaire and Dicotrad block. Except for Dicotrad, none of the modules were in use in the courses I need to transfer.

So my questions are: how do I ignore role mapping when importing a course? Or is that a bad idea?
I don't have users in the backups. Why does it ask for role mapping? And what do these brackets mean? Should I worry about them? There seem to be no "imported" overrides.
So far, the solution I've been using has been to map the original role to a new role, and then to go to the Admin page and delete those new roles, as I don't (think I) need them. Is it possible that this solution may cause trouble in the existing activities?

Am I doing something wrong here, or is there a simpler solution? (I have to transfer about 50 courses, so I'd rather make it as simple as possible, as I'll have to check the question categories and the activities afterwards)

Thanks for reading through and hope I was clear enough. Any help would be much appreciated.
Average of ratings: -
In reply to Jean-Luc Delghust

Re: Import courses from 1.8.2+ to 1.9.1 - Role mapping issue

by Jean-Luc Delghust -
OK, I think I solved my own problem:

It seems to be linked to the course settings. I noticed some of the imported courses had a limited enrolment duration. After I modified that, the brackets disappeared.
Still not very clear to me why. I tried importing a course for which I changed the enrolment duration before backing it up, and the brackets showed up again. Changing something in the enrolment options of the course settings took care of it as well.

I'll try a few things out and post more details if I can pinpoint the exact area that causes the problem.

Still wonder where those brackets come from :-s A releif nevertheless, I can go on with transferring courses
In reply to Jean-Luc Delghust

Re: Import courses from 1.8.2+ to 1.9.1 - Role mapping issue

by John Isner -
I think it is a bug. There was one bug report related to backup/restore role mapping (MDL-6909) which is now marked closed. I wonder if your case (backup without user data) was tested for that fix. The change of enrolment dates/settings is probably just masking the problem. I would file a bug report.
In reply to John Isner

Re: Import courses from 1.8.2+ to 1.9.1 - Role mapping issue

by Jean-Luc Delghust -
Thanks for your reply.

To be honest, I'm actually wondering if this may cause problems within the courses once the users are added. If it's just a display issue, I don't really care much, as it seems to disappear easily: I have now noticed that I don't even need to change a setting for the brackets to disappear. If I just go to the course settings, scroll down and click "save changes" without even changing anything, the brackets don't appear in the "Assign Roles" panel anymore.

I'm willing to file a bug report if you think it's necessary (and when I find out how to do that ^^). Do you know what problems may arise when the courses are used?
In reply to Jean-Luc Delghust

Re: Import courses from 1.8.2+ to 1.9.1 - Role mapping issue

by John Isner -
I agree with Howard (see below) that this may be related to MDL-15284. You should probably add a comment to that issue, rather than creating a new one.

It is very easy to create an issue in the tracker. Go to http://tracker.moodle.org, sign up for a new account (unfortunately it is a separate account), then click the "Create new issue" link in the header. The tracker will take you step-by-step through the issue creation. The details you supplied in your original post are very clear. You could pretty much copy and paste them.