Backup failed - zipFile is without files

Backup failed - zipFile is without files

by Leonhard Küllinger -
Number of replies: 4

Need help,

backup is running without problems, but the zip-file is empty -see attachement.

W3K, IIS, PhP502, MySQL4.1.7

thanks for help

power on moodle

Average of ratings: -
In reply to Leonhard Küllinger

Re: Backup failed - zipFile is without files

by Chris Luther -

Not a fix but a possible workaround: I am experiencing similar problems.  Using your file and a demo copy of Zip Recovery I was able to create a new recoverd archive where I could see the contents of the archive. Since I have the demo version of the utily it does not fully restore the archive, I was not able to test the quality of the restored archive or see if restores a course correctly.

Zip Recovery is at  http://www.officerecovery.com/zip/ 

In reply to Leonhard Küllinger

Re: Backup failed - zipFile is without files

by Chris Luther -

Problem Description: Backup and restore is not working with Moodle. It seems there is some problem creating the zip archive. This is important because, in order to create a new class of an existing course you must export and import the existing course into a new class container. To replicate:

  1. Open a course that you'd like to duplicate.
  2. In the left panel select backup.
  3. At the bottom of the course backup screen select not to backup user data, user files or logs. Press Continue.
  4. Review what will be included in the archive. Press Continue.
  5. Moodle will create a zip archive containing the files your requested along with a manifest. You should get a page reporting that the archive was successful. Press Continue.
  6. You will be presented with a HTML page describing the contents of the courses backup folder. The archive has been put in this backup folder. Select the archive and save it to your local drive.
  7. Confirm the size of the local archive file.
  8. To attempt to import this file either create a new course, or go to an existing course (class) where you want to place this content.
  9. In the left panel select restore. Select Upload A File and then Browse to locate the file. Press Open to upload.
  10. Once the file has been uploaded select the files checkbox and select Restore. You will be asked to confirm the restoration. Select Yes.
  11. You will be presented with an alert advising you that the restore was unsuccessful because the file is Invalid or Corrupt.

Investigation: When attempting to extract the archive using WinZip the archive appears empty.  When attempting to extract using command line I get the following:

[root @ chicken: backupdata (136)]unzip backup-m613-0604b-20050406-1444.zip
Archive: backup-m613-0604b-20050406-1444.zip
skipping: moodle.xml volume label
extracting: course_files
checkdir error: course_files exists but is not directory

WORKAROUND

With a little more research I was able to locate a workaround.  The free utility ZIPFIX.EXE, was able to repair the archive.  I was able to restore from this repaired archive.  I have done a preliminary check and it seems that everything was carried over in my files. I've attached your file so you can determine if this fixes your problem also.

ZIPFIX.EXE can be obtained from:

http://www.systweak.com/download/zipfix.zip

In reply to Chris Luther

Re: Backup failed - zipFile is without files

by Eloy Lafuente (stronk7) -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Peer reviewers Picture of Plugin developers Picture of Testers
Hi Chris,

I've been analyzing your backup file and it has been created with Moodle 1.4.2+, using internal zip routines (those that are bundled with Moodle).

I really think that, if you upgrade your server to 1.4.4+ you problems with backup files will stop (an you will have a better Moodle version, sure, see release notes).

Your problem seemed to be caused by a buggy zip library. Starting with Moodle 1.4.3, that library was updated by its authors (see credits) and it's working without reported problems since then.

Another alternative, if you don't want/can upgrade immediately, is to use external zip executables instead of internal Moodle's libraries. It includes looking for some info-zip executables (zip and unzip), installing them in your computer (they are present in most Unix flavors, but not in Win32) and configuring their path in "Administration/General Configuration".

Hope it helps, ciao smile

PS: Upgrading to 1.4.4 is highly recommended!
In reply to Eloy Lafuente (stronk7)

Re: Backup failed - zipFile is without files

by Chris Luther -
Ringraziarlo per suo aiuto.  I'll schedule the upgrade with our IT department.