Quantcast
Channel: Backup and restore
Viewing all articles
Browse latest Browse all 6619

Re: Restore Failed - Error Writing to the Database

$
0
0
by Ken Task.  

For ref:

http://dev.mysql.com/doc/refman/5.5/en/server-system-variables.html#sysvar_max_allowed_packet

Am certain others have had similar issues, but there are variables that might prevent anyone for giving any more advice that has already been given. :\ (not that I'm that much of a guru at this!).

So this latest restore failure ... how large is the backup file itself?

Does the restore process get to any restore screen?

If it does, the debug output of for this course report the same thing?

When the backups were created, I wonder if they were using the same question bank?

Have you tried to restore the course minus the quizzes?

You might have to resort to a manual 'fix' ... or 'work-around' ...  It's messy but ...

Un-archive the backup file on a local system - change .mbz to .zip and unzip it in a test folder.

Then one has to 'guess' as to which/what will reduce the issue ... suspect quiz here.

Inside the test directory 'activities' directory of the un-archived backup, you will find other directories named thusly:

quiz_10777

quiz_10756

quiz_28369

Move those folders outside of the test directory.   Jot down the numbers you see. (the 10777, etc. above).   You will need those to edit moodle_backup.xml file.

Edit the questions.xml file and remove all references leaving only the following:

<?xml version="1.0" encoding="UTF-8"?>
<question_categories>
</question_categories>

If the questions.xml file is too large to edit, move the questions.xml file out of the directory then create one with NotePad or other text editor that contains only the lines above.   File you create is in the same location as the moodle_backup.xml file.

Edit the moodle_backup.xml file.

You'll see sections of it like this (following the example of a quiz that had a number of 10777):

        <activity>
          <moduleid>10777</moduleid>
          <sectionid>82</sectionid>
          <modulename>quiz</modulename>
          <title>Shakespeare Intro. Notes Quiz</title>
          <directory>activities/quiz_10777</directory>
        </activity>

Remove those references.

Now re-package the backup.

From the location of the 'test' directory, where you can see moodle_backup.xml

zip -r backup.mbz ./*

The backup.mbz file should be smaller than the backup file you began with but it not be much.

Now attempt to restore the course.

Note: should say I have been successful in restoring a course this way, but, of course, no questions in the restored course.   Also, would not normally do this nor recommend it, but we do what we must!

'spirit of sharing', Ken


Viewing all articles
Browse latest Browse all 6619

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>