has the format of backup files changed?

has the format of backup files changed?

od Przemyslaw Stencel -
Število odgovorov: 2

In the past, it was possible to simply rename .mbz files to .zip. I could then unzip the file, modify the included xml files in a text editor, compress the whole package again, rename it back to .mbz and restore it. I ued this procedure in some cases when, for example, there was a username conflict while restoring courses moved between different Moodle installs.

However, since the 2.8 upgrade, this does not seem to work - when I change the filename from .mbz to .zip, the zip file cannot be uncompressed (I get an error that the file is not a valid zip archive).

Has the .mbz format changed in 2.8? If so, is there any way to manually modify the contents of the backup file?

TIA

Przemek

Povprečje ocenitev: -
V odgovor na Przemyslaw Stencel

Re: has the format of backup files changed?

od Ken Task -
Slika Particularly helpful Moodlers

Beginning vr 2.6 there was an experimental option to use tar.gz for compression (backups).  Had to be turned on/chosen.   Option still existed in 2.7/2.8 and at 2.9 it became the default.

So, the .mbz file created may have been a tar.gz file, not a zip.

First, you don't really have to change the extension to .zip ... that's only for operating systems that need 3 letter extensions.

You've not mentioned what OS you have ... server or desktop/workstation, so in general install something that can create/extract tar.gz's.   Mac's have that built in.   Linux boxen should also.   Windows requires installation of software.

If Mac or Linux, open a terminal session in the folder/directory where a downloaded .mbz file exist.   The issue:

file -b [nameofbackupfile].mbz

If the .mbz file is a zip you will see:

Zip archive data, at least v2.0 to extract

If the .mbz file is a tar.gz you will see:

gzip compressed data, from Unix

How to from command line:

Download the .mbz file to a test directory on local machine (workstation).

Mac/Linux: open terminal and change into the 'test' directory.

From the test directory location issue:

tar zxvf [nameofbackupfilename].mbz [ENTER]

switches in above command: z (using gzip), x extract, v verbose (show what doing) and f for tar working with a file.

IF the .mbz file is valid, the command above should un-archive without error. Valid backup file confiirmed.

To use .mbz to restore turn on experimental option if OFF (2.7/2.8 - remember, it's on by default in 2.9).   Then restore.

'spirit of sharing', Ken