restore unknown context mapping

restore unknown context mapping

by Mike Jackson -
Number of replies: 2

I have been trying to restore a fairly large (420Mb backup)course into an existing Moodle site (3,1)as  a new course but the operation fails each time after quite a wait. The error is sometimes: unknown_context_mapping.

The process never gets to the progress bar. Can anyone provide some suggestions?

Average of ratings: -
In reply to Mike Jackson

Re: restore unknown context mapping

by Ken Task -
Picture of Particularly helpful Moodlers

Think you might have to work with a copy of the mbz file in another directory ... like 'test'.   In 'test' extract the backup file ... it's a gzipped archive.   After extraction in 'test' check out the .xml files for users ... the context mappings *might be* other names the course had for teacher, student, etc.  Or the context mappings might have to do with some other area in the original course where teacher of that course could have set such things.

Can't tell you specifics ... but you might need to edit the xml's related, then re-pack the .mbz file.

You did say 'sometimes' ... so we could be looking at the tip of the iceburg here.

Also, check your apache error logs to see if there is any hint given about the restore.

Also, check moodledata/temp/backup/ for a directory that has a long name consisting of letters and numbers.   That directory was being used to restore the course.   Since it failed, the directory might still exist and hasn't been cleaned up by task/cron.   Can't use it to restore again, but it's already un-compressed and using a shell one could with an editor like nano inspect the .xml files there ... looking for any clues about 'context mappings'.

'spirit of sharing', Ken

In reply to Mike Jackson

Re: restore unknown context mapping

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

What version of Moodle was the backup made in?  Are all the plugins present in the new site that were in the originating site?