Backup and restore

ZIP or MBZ file?

 
 
Picture of Martin Sin
ZIP or MBZ file?
 

Hi,

I want to change content of .mbz file, but my work stopped at the first step.

If I download .mbz file, unzip it and create zip file from command line, rename it to original filename with .mbz extension (without any change of file structure). Moodle cannot restore such type of file with "The selected file is not a valid Moodle backup file and can't be restored." error message. What I am doing wrong?

Best regards.

 
Average of ratings: -
Picture of Ken Task
Re: ZIP or MBZ file?
Group Particularly helpful Moodlers

The trick is to make sure when you re-zip (before changing the extension back to .mbz) you zip the contents of the extracted files ... not the folder that the original unzipping may have created.  Moodle must find moodle_backup.xml at the 'root' of the zip when it extracts ... otherwise, you get the error you have reported.

Ok, ... example:

somebackup.mbz

mv somebackup.mbz somebackup.zip

unzip somebackup.zip

That creates a folder called 'somebackup' and contained therein are the extracted files.

cd somebackup

do whatever changes ... when done

and from the somebackup folder location:

zip -r somebackup.zip *

mv somebackup.zip somebackup.mbz

Use the .mbz for restore.

'spirit of sharing', Ken

 
Average of ratings:Useful (5)
Picture of Martin Sin
Re: ZIP or MBZ file?
 

You are right! I did not notice this.. Many thanks for your answer.

 
Average of ratings: -