Restore error (error/wrong_setting_level_moodle_backup_xml_file)

Restore error (error/wrong_setting_level_moodle_backup_xml_file)

by Pete Phillips -
Number of replies: 4

Of everything I've done for moodle, a google search has always lead here. This time, google didn't even know what to do. I'm trying to take a backup from Moodle 2.1.3 and restore it in Moodle 2.2.1.

I upload the file, click restore, and get presented with the error under step 1. Confirm:

error/wrong_setting_level_moodle_backup_xml_file

The more information link points to an empty wiki page: http://docs.moodle.org/22/en/error/moodle/wrong_setting_level_moodle_backup_xml_file

Any ideas. I'm looking at the XML file, but can't see anything that looks suspicious.

We're just beginning transitioning from Moodle 1.9. Our host gave us 2.1.3 to transition, but I have a local instance I'm playing with, trying to get training materials done with a custom theme that the provider is slacking on putting in place.

Average of ratings: -
In reply to Pete Phillips

Re: Restore error (error/wrong_setting_level_moodle_backup_xml_file)

by Mark van Hoek -
Picture of Core developers Picture of Plugin developers

Hi Pete -- I've got exactly the same issue restoring a 2.1.3 backup to 2.2.2.  The 2.1.3 host is MoodleRooms, 2.2.2 is on a separate host and is a clean, plain-vanilla Moodle.

In reply to Pete Phillips

Re: Restore error (error/wrong_setting_level_moodle_backup_xml_file)

by Mark van Hoek -
Picture of Core developers Picture of Plugin developers

The restore is dying because the file moodle_backup.xml has some invalid 'levels' in lines like this:

<settings>
...
  <setting> 
     <level>local</level>
     <name>pld_logs_included</name>
    <value>0</value>
  </setting> 

If you edit backup/util/helper/backup_general_helper.php in the function get_backup_information() line ~204 says

throw new backup_helper_exception('wrong_setting_level_moodle_backup_xml_file', $setting['level']);

Add the first line below and comment out that "throw new..." line like this:

continue; //added this line to prevent stopping on <level>local</level>
//throw new backup_helper_exception('wrong_setting_level_moodle_backup_xml_file', $setting['level']); 

The backup will happily chug along now.  Tested in 2.1.3 (Build 20111128) (201170103).

 

Filed as http://tracker.moodle.org/browse/MDL-32559

Average of ratings: Useful (2)
In reply to Mark van Hoek

Re: Restore error (error/wrong_setting_level_moodle_backup_xml_file)

by Pete Phillips -

Sorry I missed your reply! We're also (stuck) on Moodlerooms and I suspected it wasn't a Moodle-wide problem.

Have you reported this to the Moodlerooms people? We did (without your fix) and they seem to be scratching their heads at us. Thanks! I'm going to go try this right now!

In reply to Pete Phillips

Re: Restore error (error/wrong_setting_level_moodle_backup_xml_file)

by Aparup Banerjee -

I've fixed up that empty wiki page now. It should be a more useful page now smile

Average of ratings: Useful (2)