Role renaming disappears in backup

Role renaming disappears in backup

by Peter Diedrichs -
Number of replies: 6
Picture of Particularly helpful Moodlers

Is there a purpose of the role renaming to be reset when backing up and restoring a course? That means, that when using course backups as templates and wanting to use renamed roles (for instance, in course templates for courses in different languages) one always have to do another role renaming in the new course. Or have I missed some setting?

Using moodle 2.8+ and 3.0+

Average of ratings: -
In reply to Peter Diedrichs

Re: Role renaming disappears in backup

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

There is code in place for backing up and restoring role renames (which are stored in the role_names table in the database).

So, it is supposed to work.

In reply to Tim Hunt

Re: Role renaming disappears in backup

by Peter Diedrichs -
Picture of Particularly helpful Moodlers

It really doesn't with our sites, moodle 2.8.7+ and moodle 3.0.3+

Now I tried changing the name of every role, I didn't do that before. Actually the name change made for the role "Student" was kept, in both our moodle installations. But all other roles, both original roles and roles we have created, was restored to their original names.

I did it this way:

  1. Renamed ALL roles in the settings of the course
  2. Backed up the course (without registered users)
  3. Restored backup to new course

Any suggestion on how I should move on with this?

 

 

 

In reply to Peter Diedrichs

Re: Role renaming disappears in backup

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

If you can also reproduce the problem at qa.moodle.net, then report the bug to the tracker: https://docs.moodle.org/dev/Tracker_introduction. Thanks.

In reply to Peter Diedrichs

Re: Role renaming disappears in backup

by Chris Nes -

Hi Peter,


I had the same problem today.

Try this as a workaround:

Role-renaming is kept, when you include users in your course-backup, to whom this renamed role "belongs".

  1. When using a course as a template, I enrol only one user.
  2. This user I give all the renamed roles. The user can be either the regular teacher of new courses oder a dummy user.
  3. For backup I include enroled users.
  4. Restore the backup to new course.
  5. Voilà, the renaming of the roles is present in the new course.

Hope, this works for you too.