moodle xml not found at root level of zip file

moodle xml not found at root level of zip file

by josephine wilson -
Number of replies: 5
Please help. I have this error in trying to restore a course I backed up on a different Moodle. When I look in the folder I see a folder of course files and a folder saying groups and a Moodle xml file - so why am I getting this error? The course was backed up in a Moodle 1.7 and I am restoring to a 1.8 but that shouldn't be an issue, I think.
Average of ratings: -
In reply to josephine wilson

Re: moodle xml not found at root level of zip file

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
Did you by any chance unzip and then rezip the file? This is dead easy to do on Mac that kindly unzips an archive without asking. If you rezip you have to make sure that the folder is not at the top of the archive... zip the files, not the folder.
In reply to Howard Miller

Re: moodle xml not found at root level of zip file

by Deleted user -

It sounds like the xml file is not where is supposed to be, meaning that when you have a zipped file called for example backup.zip, that when you see what's inside it, it should look like this (CORRECT):

onefolder
another folder
xmlfile.xml

If you look inside backup.zip and see this (INCORRECT):

justafolder

and then inside justafolder you see:

onefolder
another folder
xmlfile.xml

then that is the problem, and you need to move everything out of justafolder so that the xmlfile.xml is found in the root of the zip file.

In reply to Deleted user

Re: moodle xml not found at root level of zip file

by josephine wilson -
yes I think that was it! I just redid it - and restored to another Moodle and it worked this time! Thanks!
In reply to josephine wilson

Re: moodle xml not found at root level of zip file

by Tiffany Morgan -
I realize I'm replying to a year old post, but it took me a while to figure this out and I thought others might have struggled as well.

When I created a back up of a course (mycourse.zip) and uploaded that to a new moodle. When I tried to restore I got the error message Error checking backup file. moodle.xml not found at root level of zip file.

I saw all the documentation about the moodle.xml file not being on the root level and zipping the files not the folder, but it wasn't clicking.

The part I was missing was I needed to
1) Unzip the backup of mycourse.zip
2) open the folder names mycourse
3) select the folders within the mycourse folder AND the moodle.xml file and create a zip of that (mycourse_new.zip)
4) upload the new zip file - mycourse_new.zip and restore.

That worked like a champ! It seems really easy now that I figured it out, but it was really throwing me and thought others might be helped by this as well

smile

In reply to Tiffany Morgan

Re: moodle xml not found at root level of zip file

by Huw Smith -
I backed up a course on 1 moodle version 1.9.5+ (Build: 20090729) and it restored with no problems on this moodle.

I then uploaded it on to a different moodle version 1.9.5+ (Build: 20090603) and when I try to restore it I get the "moodle xml not found at root level of zip file" error message.

I also tried restoring it on a third moodle version 1.9.5+ (Build: 20090617) and that restored with no problems.

I didn't think the problem is with the zip file as it has restored on 2 other moodle instances but I repackaged the zip file and the error still existed.

Does anyone have any suggestions as to why this is happening?