The role in the backup file cannot be mapped to any of the roles that you are allowed to assign

The role in the backup file cannot be mapped to any of the roles that you are allowed to assign

by Roger Mepham -
Number of replies: 3

Hi

I am trying to split some courses into several sub-courses and keep the user enrolments and activities. So I tried backing up a course and then restoring it prior to deleting the activities and resources not required to make it smaller. However on restoring to a new course I get two duplicate error messages at step 6.Process, of "The role in the backup file cannot be mapped to any of the roles that you are allowed to assign."

There are 5 drop downs under "Restore Role Mappings" with three populated with Manager, Designer and Student and the other two None.

After clicking the Restore button the progress bar stops at 6.85% with an error "error/unknown_context_mapping" and a Continue button which when I click it drops be back to my home page.

I am logged in as admin and successfully backed up and restored a small test course with a few users in, but this issue is happening with all 5 main courses. They will restore without users but then I will lose their completion data when I add them back in.

Please can anyone shed any light?

Thanks in advance for all and any suggestions or assistance.

Roger



Average of ratings: -
In reply to Roger Mepham

Re: The role in the backup file cannot be mapped to any of the roles that you are allowed to assign

by Colin Fraser -
Picture of Documentation writers Picture of Testers

The Role "Designer" is a substitute name for a "Teacher" or a "Creator" renamed in the course? 

If so, then I suggest you create the Role in the Site Administration > Users > Permissions > Define Roles, then the Manage Roles tab, and base the Designer Role on whatever existing Role you want, Teacher or Creator. 

If the Role has been created this way, then go to the Allow Role Assignments and make sure that you have permission to allow that assignment. 

To your other problem: 

What can happen is a course gets too big and needs to be split up into sub courses. First, I suggest you might want to read these Moodle Docs on metacourses.  What I have done is to take a backup of half of the course, then another backup of a second half of the course, and thirds if required, course materials only. No user data or materials. I have restored those to different, existing courses created specifically to act as shells for those backups making these parent courses. I then take a backup of Users and data, and anything else. I restore that backup  to its own course and make the course a child course, and the other courses are metacourses. This makes backups of student enrolments and materials considerably simpler and easier for longer term storage. 

This strategy has worked well for me, and would recommend it for anyone who is working with an evolving Moodle. 

In reply to Colin Fraser

Re: The role in the backup file cannot be mapped to any of the roles that you are allowed to assign

by Roger Mepham -

Thanks for the reply and suggestions Colin, sadly though I'm not really getting any further forward.

The role of Designer was just the word Teacher renamed in the Moodle language packs and not a custom role at all. I tried reverting the language name back to defaults in the forlorn hope that some bug was causing the role issue but no luck.

I also tried removing all roles except student roles from a course to see if that helped but again I just get the same issue.

I also tried manually editing the backup file and removing any non student role assignments and restoring a new zipped version but again no joy.

As the site administrator there seems no setting to grant me to Allow Role Assignments either unfortunately.

To be honest its not the student enrolments I care about so much as their activity completions and certificate awards which is why I want to duplicate each course three times and then delete the redundant activities in each one to make them smaller and more modular. I would then add a meta course above each three for future global enrolments leaving the current users intact.

In reply to Roger Mepham

Re: The role in the backup file cannot be mapped to any of the roles that you are allowed to assign

by Roger Mepham -

Hi In case anyone has the same issue I fixed it eventually by unchecking the blocks backup. I think it might have been a custom plugin block causing the problem.

Average of ratings: Useful (1)