General help

 
 
Picture of Jeff White
Editing a file and recompressing a backup
 

I'm using 2.3.4, and I'm trying to edit an .xml file within the .mbz. I tried first to open in windows by changing the extension; however, once I changed, rezipped, and renamed, the backup type was unrecognized by Moodle.

My next thought was to ftp the .mbz onto my server (using a hosted server with control panel) and extract the file there, work on it, and recrompress in File Manager. Though it looks like my options for compressing there are .zip, gzip and bzip2.

What I'm trying to accomplish is to change the userinfo -value- from 1 to 0 in a the moodle_backup.xml. And I could do it if only I could recompress as an .mbz!

thanks...Jeff

 
Average of ratings: -
Picture of Ken Task
Re: Editing a file and recompressing a backup
Group Particularly helpful Moodlers

Have had to hack 1.9 backups before to bludgin them into submission to restore and it's tricky, but ... can be done ... even with .mbz files.

Assume you are using NotePad (a true text editor) to edit.  Do NOT use Word.

The 'trick' to re-zipping is make sure the the zip extracts with certain .xml files at the 'root' of the extraction.  So one creates the zip *while in* the folder that is being used to edit the xml not the folder where the edited .xml file resides.  Including the other folders.  Then rename the file to .mbz.

Am using a Mac and maybe this screen capture will help visualize:

files/folders to zip

All those selected would be included in the zip.

'spirit of sharing', Ken

 
Average of ratings:Useful (1)
Picture of Jeff White
Re: Editing a file and recompressing a backup
 

Much thanks, Ken. I've been using Notepad++ on a PC--though could use any platform if it would work. I'm not quite following that 3rd paragraph...I download the .MBZ file to my PC. I change the name to BACKUP.ZIP and extract, creating a folder called BACKUP. 

Now from that folder, I could open the file.xml and edit it in notepad++ and resave it that folder (with the intention of re-zipping that folder and changing the extension back to .mbz). Is that what you mean--or are you saying to create another folder in the mix--so I'd have original .mbz/.zip, extracted folder of files, AND another which would hold edited files for rezip/.mbzing?

-Jeff

 
Average of ratings: -
Picture of Ken Task
Re: Editing a file and recompressing a backup
Group Particularly helpful Moodlers

One re-zips the *contents* of that BACKUP folder ... NOT the BACKUP folder.  Files and Folders to re-zip:

activities
completion.xml
course
files
files.xml
gradebook.xml
groups.xml
moodle_backup.log
moodle_backup.xml
outcomes.xml
questions.xml
roles.xml
scales.xml
sections

Maybe the following will help visualize.

files/folders to zip

'spirit of sharing', Ken

 
Average of ratings:Useful (1)
Picture of Howard Miller
Re: Editing a file and recompressing a backup
Group DevelopersGroup Documentation writersGroup Particularly helpful Moodlers

What Ken says smile

Most zip utilities default to including the directory in the backup (usually what you want) rather than just the contents.

 
Average of ratings:Useful (1)
Picture of Jeff White
Re: Editing a file and recompressing a backup
 

Awesome. I follow you now. And it worked!

Thanks so much for the help!

 
Average of ratings: -
Picture of Vicki Dunnam
Re: Editing a file and recompressing a backup
 

Question.  I have a large Moodle course from Moodle 2.3 and I am having problems restoring.  When I restore it shows there are 1000 topics.  I used to edit the Moodle.xml file and delete topics that I needed to delete if needed.  How can I delete them in he new version of moodle backup?  I have renamed the mbz file to zip and have opened the moodle.backup.zml file but not sure how do delete the unwanted topics.  I think if I could do that then I could restore this file.  Any suggestions? 

 
Average of ratings: -