/moodledata-files after migration corrupted

/moodledata-files after migration corrupted

by Peter Müller -
Number of replies: 7

Hi there,

I´m having trouble getting the /moodledata-directory from my old moodle (Moodle 2.1.1+ (Build: 20110826) on shared webhoster no SSH) to the new bitnami-moodle (http://bitnami.org/stack/moodle; Version: Moodle 2.1.2 (Build: 20111010) ) on an Amazon-EC2-Server. All of my course files are corrupted, pictures are pixel-trash, pdf files won´t open because they are broken. My moodle courses + all text-elements are fine, just the uploaded files are broken.

How can I fix this? I guess it has something to do with the new /moodledata-format introduced in moodle 2.x. The transfermode of my ftp-client (Filezilla) is set on "auto", so no ASCII or binary if that matters. I transfered the files via SFTP.

I can´t even delete the corrupted files in the moodle file manager and reupload the working ones, I´ll get the error message "wrong content of basefile" (roughly translated from German: "Falscher Inhalt der Basisdatei"). Somehow the old file reference blocks the upload of the identical file. All other files I can upload normally.

 

Average of ratings: -
In reply to Peter Müller

Re: /moodledata-files after migration corrupted

by Peter Müller -

Solved it:

You have to set Your FTP-client´s transfer-mode to "binary", otherwise the moodle 2.x-moodledata-directory gets corrupted. This is something that should be added to the migration-document: http://docs.moodle.org/20/en/Moodle_migration

Specifically at the point "Copy data directory contents (moodledata). Copy the contents of your data directory (check for the value in $CFG->dataroot) to the new server." should be added something like "remember to set Your FTP-clients transfermode to "binary", otherwise Your files will be corrupted. 

Average of ratings: Useful (1)
In reply to Peter Müller

Re: /moodledata-files after migration corrupted

by Jason [Moodle Enthusiast] -

Hello everyone,

 

First off, sorry to dig up an old post... but it is precisely what I think occurred to my Moodle install after migration.

[WHAT HAPPENED]

I migrated from GoDaddy shared hosting garbage, to GoDaddy virtual dedicated (still garbage)...  I used FileZilla to download all my files, after placing site into maintenance mode...  I also backed up the database...  then I migrated, turned off maintenance mode, and boom the site worked, all courses etc… were there, but ALL IMAGES AND FILES uploaded via Moodle were corrupted.

[HOW I FIXED IT]

I re-uploaded all files and images (which was an awful task I must say)

 

[PLEASE RECCOMONED]

I would like to know what FTP program to use so that I do not corrupt data...  Dreamweaver stinks because there is not (re-queue missed files) and FileZilla seems not to like binary mode or at least I cannot seem to get it set properly...

 

In reply to Jason [Moodle Enthusiast]

Re: /moodledata-files after migration corrupted

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
FileZilla is the one most people use.

I don't use it. From what I read, in Moodle 2.x you have to force FileZilla to use the 'binary' mode, earlier it detected the file type and set the mode automatically. Apparently due to the scrambled file names in 2.x https://moodle.org/mod/forum/discuss.php?d=213173&parent=931595.
Average of ratings: Useful (1)
In reply to Jason [Moodle Enthusiast]

Re: /moodledata-files after migration corrupted

by Edward Hewlett -

THANK YOU, JASON!

I had an old Moodle backup that I needed to restore, which I had downloaded with FileZilla (without specifying binary mode) long ago. The original files had long been deleted when I finally got around to trying to restore it - only to run into the file-corruption issue that is being described here!

Following your suggestion, I used FileZilla (without changing any settings) to re-upload all the files (fortunately, I was able to simply use the FTP daemon built into XAMPP to FTP them from one folder to another on my local computer), which SOLVED THE PROBLEM! You are a life-saver.

Thank you!

In reply to Edward Hewlett

Re: /moodledata-files after migration corrupted

by Mohamed Neji -

I have same problem I think, I am using Moodle 2.9.2 and I manage my website to local server (XAMPP 5.6.23). It works fine on webserver but in local I have problem in all data like images and pdf files "Failed to load PDF document". I tried to download App with FTP transfer-mode "binary" but same problem please help me!! and thank you.

image moodle corrupted

In reply to Mohamed Neji

Re: /moodledata-files after migration corrupted

by Ken Task -
Picture of Particularly helpful Moodlers

Local one (not the server) ... running on Windows ... when's the last time you defrag'd the HD?

Total guess!

'spirit of sharing', Ken