Upgraded to 2.0 - where did all my files go?

Upgraded to 2.0 - where did all my files go?

by Michael Pohl -
Number of replies: 19

I recently updated my Moodle from 1.9.7 to 2.0.  I've been looking around the Web and discovered the new file management in 2.0.  However, I can't find any of my old files.  They used to be stored in numbered folders in my moodledata directory.  I pulled a copy of all the folders into the new moodledata directory that was created by the 2.0 installation.  How do I convert this structure so I can access these files?

There's got to be some step that I'm missing.  Someone please help.

The files are accessible on the server.  They're not deleted or anything.  I know right where they are.  I just can't get to them from the individual courses like I used to be able to.  I can't find any documentation on how to do a conversion.

Average of ratings: -
In reply to Michael Pohl

Re: Upgraded to 2.0 - where did all my files go?

by Michael Pohl -

I don't mind using the new file structure but I need to be able to import/convert the 1.x moodledata folder into the 2.x format without having to individually upload each one.

In reply to Michael Pohl

Re: Upgraded to 2.0 - where did all my files go?

by david southern -

You should have a folder shown in your navigation bar "legacy site files"!

In reply to david southern

Re: Upgraded to 2.0 - where did all my files go?

by Michael Pohl -

I do have the Legacy Site Files option listed but the repository is empty when I click on it.  I followed the directions as posted here: http://moodle.org/mod/forum/discuss.php?d=158778 but it doesn't seem to make any difference.  It just won't populate with all my old files.  A lot of my modules and links are broken now too.  I'm finding out more and more as the day goes on that anywhere anything used the Course Files is broken now.  The unlinked moodledata folder is the heart of it.

It's like the moodledata folder conversion didn't happen when I updated the site.  Is there a way to re-run the conversion scripts?  If so, how will this affect my database?  If it's not possible to re-run the scripts, how do I activate the Legacy Files?

In reply to Michael Pohl

Re: Upgraded to 2.0 - where did all my files go?

by Mary Cooch -
Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Testers Picture of Translators

MIchael- if you click on a resource in a course, like a word doc for example, what message do you get? I know there has been an issue whereby course files displayed on the page do not show unless you go into editing mode and add a description to the resource - then they display - have you tried that?

Average of ratings:Useful (1)
In reply to Mary Cooch

Re: Upgraded to 2.0 - where did all my files go?

by Michael Pohl -

Some files display a red X (like a broken hyperlinked image) and others display a popup with "This legacy resource type (file) was not yet migrated, sorry."

I tried editing the resource for one of the "legacy resource types" and the description (required) was blank as well as the "select files" box.  I filled in a description and then got a warning that "no files are attached".

I try to add a file to the resource and it opens the 2.0 repository pane with none of my old (1.9) files listed.

In reply to Michael Pohl

Re: Upgraded to 2.0 - where did all my files go?

by Michael Pohl -

anyone know a way to rerun the moodledata conversion scripts?  bueller?

In reply to Michael Pohl

Re: Upgraded to 2.0 - where did all my files go?

by Michael Pohl -

I tried backing up my database using command line mysqldump and reloading version 2.0 like a few other people on here have done.  I succeeded in locking myself out of my Moodle.  Apparently I don't know where I went wrong or how to find my way out of the woods.

After a couple hours of banging my head against the wall I stumbled into my phpMyAdmin site and copied the password for the guest account into the admin record on the mdl_users table.  This didn't work at first.  Then I noticed that the database type in my config.php file somehow got changed from mysql to mysqli (some "improved" mysql engine).  Well, this didn't help me much because as long as Moodle was looking for a mysqli engine it wouldn't accept any of my passwords.  I found an older config.php file that had mysql in its database type field and "holy cow" it let me back in using the guest password that I had configured in the database!  This change must have happened during one of the many 'rename config.php and rerun install.php' cycles.

I breathed a heavy sigh of relief to discover that my database was still intact.  However, still no improvement on the moodledata front.  I thought that maybe rerunning the install.php file with my old data in place would convert the directory.  I guess I'm wrong.

Am I sunk at this point?  Since I apparently converted my database to 2.0 without converting my data folder I can't get the files back into my courses?

Legacy course files seems like a likely location but it remains empty.  I can't find any documentation on how to populate Legacy Course Files with my 1.9 moodledata data.  Let alone all the assignment submissions that aren't linked anymore.

Drowning man...going down for the last time...someone throw me a life jacket?

In reply to Michael Pohl

Re: Upgraded to 2.0 - where did all my files go?

by Fred Weiss -

I am having the same problem.  Did the upgrade.  All seems oK.  Leagacy files repository activated as per instructions.  When I click on a document link I get the message;

This legacy resource type (file) was not yet migrated, sorry.

When I click on the Update this file link and try to add the file there are no files listed in the legacy course files area I get 'No files available'

Did you find any resolution?

In reply to Fred Weiss

Re: Upgraded to 2.0 - where did all my files go?

by Michael Pohl -

No.  It sounds like you're having the same problem I'm having.  Everything else seems to work.  All my users can upload new files and work as normal but anything that uses anything that was in the old system (in the course file directory: pictures, documents, uploaded student work) is inaccessible.  I can see the files in the moodledata folder and have extracted some of them to email to my teachers so they can stumble along.  I'm glad I'm not the only one with this issue.

I spent some time looking through the file.php code at how the pathing is being built.  I tried a few different ways to see if I could get a picture from one of my courses to show up in my browser.  No luck.

Please post back here if you find a solution.

In reply to Michael Pohl

Re: Upgraded to 2.0 - where did all my files go?

by Philipp Budde -

Hello together,

I have exactly the same problem: No course files although all the entries in the config.php are right and the files exist in the data directory.

Did you find any solution untill the beginning of december? I have to administrate a moodle with many courses, so linking them new would be much work ...

Thanks for your response!

Bye, Philipp

In reply to Philipp Budde

Re: Upgraded to 2.0 - where did all my files go?

by Michael Pohl -

No solution yet. I've tried everything I could think of but no luck.

In reply to Michael Pohl

Re: Upgraded to 2.0 - where did all my files go?

by Shane Greaves -

I would restore the 1.9.7 backups and run the moodle 2.0 upgrade again.

In reply to Michael Pohl

Re: Upgraded to 2.0 - where did all my files go?

by Luca De Andreis -

Hello !

I've just tried to migrate my production server (a clone smile ) fron 1.9.10+ to 2.0.1+

All ok, but...

********************************************************

This legacy resource type (file) was not yet migrated, sorry.

********************************************************

Any update ?

In reply to Luca De Andreis

Re: Upgraded to 2.0 - where did all my files go?

by Phil Raymond -

Same problem here. Updated from 1.9.2+ to 2.0.1+ and my resources say:

This legacy resource type (file) was not yet migrated, sorry.

Phil

In reply to Phil Raymond

Re: Upgraded to 2.0 - where did all my files go?

by Colin Fraser -
Picture of Documentation writers Picture of Testers

OK Simple answer, the error message has it right. The files have not been migrated. The use of the moodledata folder is completely different than it used to be and it no longer holds course files - images, docs, pdfs and so on. There are now stored inside the database which offers considerably more security. This has necessitated entirely new tables, which has necessitated a whole new range of core code, file handling and so on. Once you make such a fundamental change to the way in which you store course files, everything else changes around it. Essentially, every course has its own postions within the course and cache tables, every page has its own fields and every file field has a relation to the appropriate course within the course and cache tables.

What this means is that "upgrades" do not work. Do not use a cvs tool to update your v1.9.x Moodle. This is not an "upgrade" like a v1.8.x to 1.9 it is a complete new product based on ideas within the older versions. Like any new product it needs be seriously road tested and the development team can only do so much. What you are seeing now is not a complete product, which is always an arguable strategy. At what point do you release your product, before all functionality is ready? Or at a core? If you wait, you can miss an opportunity for considerable improvement, if you release you could be giving people the impression the product is really buggy therefore questionable. IMHO the core is there, and for the basic usage of Moodle, it is stable and looks to being developed as an extremely versatile and powerful tool. Yes, I am unhappy that some things do not have their full functionality and that I cannot easily update, but I cannot dismiss the really good things I can ee in it. I know that the basic fuctionality will be improved in coming releases, and they cannot come fast enough.

I am not unhappy at not using it for a production site right now, though. The huge number fo changes that people are going to have to adapt to.. oh my... there is going to be a lot of resistance there and I am seriously unhappy at that. It gives me time to learn it and develop training strategies for all those people either new to Moodle or unwilling to change when they will have to.

Sorry about the length, but all this is just background to your question, so you can, hopefully, be patient and it will come. When it does, it is going to be such a tool you willwonder at how we got along without it!!

In reply to Colin Fraser

Re: Upgraded to 2.0 - where did all my files go?

by Heather P -

Hi

reading your post. If the files for resources are now held in the database (and I hadn't realised that until now)  can I confirm something. Is this going to mean I now need significantly more space on my database server and much less on the server where my moodledata folders are?

Thanks

In reply to Heather P

Re: Upgraded to 2.0 - where did all my files go?

by Colin Fraser -
Picture of Documentation writers Picture of Testers

OK, re-reading my original answer I have not really given a clear and precise answer... sorry 'bout that egg...  The files seem to be renamed and then stored in the moodledata folder, but the encryption code and the path are stored in the database. Again, this is a security feature, but I cannot seem to find a common thread to relate the images. It seems an entirely random pattern, the renaming and storing of images and files. So no, it does not really seem likely you will need to swap servers or anything, but if you have a small client base and few courses, say 1,000 users and 400 courses, there should not be any reason to discontinue what you are doing. I am going to assume that user uploads etc will also be stored in the Moodledata folder the same way for precisely the same reasons.

In reply to Michael Pohl

Re: Upgraded to 2.0 - where did all my files go?

by Evan Donovan -

You could try re-copying your moodledata directory from the backup, making sure that all the files are there, and restoring the 1.9.x database.

Make sure that all the files are owned by the webserver (in my case, nobody:nobody, but could be apache:apache, or something similar), and that the permissions are at least 750, but i think 777 might be necessary, at least for the upgrade.

Make sure then that the correct moodledata directory is configured in your config.php and that the permissions are set to '0750' in there (with one leading zero).

Then, try running the upgrade from the CLI, as a non-interactive script.

In reply to Michael Pohl

Re: Upgraded to 2.0 - where did all my files go?

by William Felton -

I had this issues and saw several posts with the same problem. I fixed mine with this solution.  Hopefully this can help those with the same issue.

Problem: The data from my 1.9 env did not get converted over to moodle 2.0  I got errors that said "file has not been migrated".  I had moved my data from the 1.9 to the /data/moodle20/ directory but it didn't get moved to the new directory structure.  I know it works since i got it working on my test system first.

My mistake: On the production server I set my config.php file with the parameter $CFG->dataroot = '/data/'  but I forgot to add the "moodle20" to the end of the path.

The fix is obvious.  I made the config ='/data/moodle20'  (I have left off my parent directory in this example)

I noticed this first when the upgrade was happening and a bunch of errors occured under the Forum, Wiki and Glossary upgrade areas.  They all complained that the "file is unreadable".  This did not happen after I made the fix.

Good luck.  My moodle upgrade was made much easier with some serious practice on my test system, which I highly recommend.

Willy