by Ken Task.
If the tar.gz files were transferred via ascii not binary, then it's possible to get 'extra' characters.
What happened when the tar.gz (or tar) files were un-compressed?
Did they report something like:
gzip error: stdin: invalid compressed data - format violated?
There is a tool to fix such issues (have not had first hand experience with it but some folks say it works:
$ wget http://www.gzip.org/fixgz.zip
$ unzip fixgz.zip
$ gcc -o fixgz fixgz.c
$ fixgz corrupted_backup.tar.gz fixed_backup.tar.gz
$ tar zxvf fixed_backup.tar.gz
Something to check:
Do a mysql query of mdl_files on the troubled instance DB for the humanly recognized file name and contenthash.
Query: select contenthash, filename from mdl_files;
One row example:
188946b0a15d2d08a72ab3debc6c31e2adeca37d | Verb Practice Quick.docx
The contenthash shows where the file is located:
filedir/18/89/188946b0a15d2d08a72ab3debc6c31e2adeca37d
To see if that file is really messed up, one could copy it out to some location and see if it could open in anything:
From moodledata directory:
cp filedir/18/89/188946b0a15d2d08a72ab3debc6c31e2adeca37d /home/test/Verb Practice Quick.docx
And then in /home/test/
file -b "Verb Practice Quick.docx" should show that it's a zip (a .docx is just that).
Then mv "Verb Practice Quick.docx" test.zip
unzip test.zip
inflating: [Content_Types].xml
inflating: _rels/.rels
inflating: word/_rels/document.xml.rels
inflating: word/document.xml
inflating: word/theme/theme1.xml
inflating: word/settings.xml
inflating: word/webSettings.xml
inflating: word/styles.xml
inflating: docProps/core.xml
inflating: word/numbering.xml
inflating: word/fontTable.xml
inflating: docProps/app.xml
If you can do all that, there might be something strange in the tables related: mdl_files. An extra space at the end of the filename field of the DB?
'spirit of sharing', Ken