Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-24169

Moodle 2.0 Back up failed on Windows Moodle install

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Duplicate
    • Affects Version/s: 2.0
    • Fix Version/s: 2.0
    • Component/s: Backup
    • Labels:
      None
    • Environment:
      Windows, Apache

      Description

      When doing backups with Moodle 2 and the new backup and restore I get an error:

      "Can not read file, either file does not exist or there are permission problems"

      I found that backup.zip is not created. $zippacker->archive_to_pathname() uses ZipArchive->open() with the parameter ZIPARCHIVE::OVERWRITE and as the file backup.zip does not exist the function returns false.

      To fix it on my build I added a few lines in backup_stepslib.php before the call to $zippacker->archive_to_pathname() to create an empty file called 'backup.zip'. This seemed to fix the issue.

       if (!file_exists($zipfile)) {
          $fo=fopen($zipfile,'w');
          fclose($fo);
      }

      May not be the most elegant way to do this but it fixed the issue.

      This is only an issue on my Windows install of Moodle 2 on my linux install this is not an issue.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              skodak Petr Skoda
              Reporter:
              paul.dawson Paul Dawson
              Tester:
              Nobody Nobody
              Participants:
              Component watchers:
              Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Peter Dias, Sujith Haridasan
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Fix Release Date:
                24/Nov/10