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

Re: Restoring/downloading files over 2GB

$
0
0
by Ken Task.  

Oh, thought you said couldn't unarchive! Sorry.  Still the info is kinda related to the following.

One has to reverse engineer the .mbz file.

One can remove the references to the largest items (size wise) in the corresponding .xml files.  Suspect the largest items involve the 'files' directory and the 'files.xml' file.

In a work folder unzip the renamed .mbz.  That should create a folder with the same title as the backup file.

drwx------@ 18 ktask  staff    612 Sep 22  2012 backup-moodle2-course-2-tinker-20120914-2047

cd backup-moodle2-course-2-tinker-20120914-2047

ls -lR files

And note the largest files - copy and paste the contenthash name to textedit for later reference/use

example:

./b1:
total 40216
-rwxr-xr-x@ 1 ktask  staff  20586557 Sep 14  2012 b16cc8ce0dcdee28dfba17a27b753802e89659af

this one file is 20M

file b1/*

Ken-Tasks-MacBook-Pro:files ktask$ file b1/*
b1/b16cc8ce0dcdee28dfba17a27b753802e89659af: Macromedia Flash data, version 8

It's a flash file.

move the b1/b16cc8ce0dcdee28dfba17a27b753802e89659af file to a 'savedfiles' folder outside of present location and rename it something - flashfile1.flv.  Then remove the b1/ folder.

Open the files.xml file and do a search for the contenthash name.

Finding the reference in files.xml, remove the reference ... be sure you remove all lines contained in the tag references for the file:

  <file id="126">    <contenthash>b16cc8ce0dcdee28dfba17a27b753802e89659af</contenthash>
    <contextid>33</contextid>
    <component>mod_resource</component>
    <filearea>content</filearea>
    <itemid>0</itemid>
    <filepath>/</filepath>
    <filename>mdl-files.png</filename>
    <userid>3</userid>
    <filesize>20586557</filesize>
    <mimetype>image/png</mimetype>
    <status>0</status>
    <timecreated>1343260609</timecreated>
    <timemodified>1343260609</timemodified>
    <source>mdl-files.png</source>
    <author>Ken Task</author>
    <license>allrightsreserved</license>
    <sortorder>0</sortorder>
    <repositorytype>$@NULL@$</repositorytype>
    <repositoryid>$@NULL@$</repositoryid>
    <reference>$@NULL@$</reference>
  </file>

NOTE: Don't let the above example above confuse.  I know the above references a mime type as a png file.  This was a tinker backup and course I had been fooling with.  The file is really a flv file:

./files/b1/b16cc8ce0dcdee28dfba17a27b753802e89659af: Macromedia Flash data, version 8

Continue until all the largest items have been copied out and the files.xml file that referenced them no longer refer to them.

The tricky part (not really, just have to  do this step at the right location) - create a zip **in** the backup-moodle2-course-2-tinker-20120914-2047 folder (as per example).

zip -r amoodle2backup.zip *

Must zip it in such a fashion that when unzipped by Moodle, the restore process can find the moodle_backup.xml file.  Re-creating the zip note the file size.  Should be smaller now! ;)

Then, renamed the amoodle2backup.zip to amoodle2backup.mbz.

Makes no difference what you name it just as long as the extension is .mbz.  All the information Moodle will use are in the .xml files.

Upload to moodle server.  Think I'd use a file system repository called 'restores' and scp it there (this keeps the .mbz file out of the DB).

X your fingers and restore.

'spirit of sharing', Ken


Viewing all articles
Browse latest Browse all 6586

Trending Articles



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