How to move Data folder to a different drive?

How to move Data folder to a different drive?

by Cindy Zhao -
Number of replies: 8

Our Moodle Data folder was on C drive. It's getting full, so I copied it over to E drive. I edited the data path, and it seems all courses find their contents. I thought that's easy!

But I laughed too early. sad The problems came when our teachers try to update files which are already in the data folder.  They couldn't rename, delete or upload newer version files to Moodle. It gives error messages say, "can't rename ...", "Error deleting whatever file". It's okey for loading brand new files.

There's nothing I can do other than deleting files directly on the server, then upload new zip files through Moodle.

There are many more folders to fix. I wonder if I have other choices?  Thank you very much!!!

Average of ratings: -
In reply to Cindy Zhao

Re: How to move Data folder to a different drive?

by Josiah Ritchie -
I'm pretty fresh to Moodle, but I would expect this to be a file-system permission issue. Moodle probably doesn't have access to the files and so it doesn't matter what you do in Moodle. Have you tried checking what the permissions were on the C:/ drive and then duplicating them on the E:?
In reply to Josiah Ritchie

Re: How to move Data folder to a different drive?

by Cindy Zhao -

Josiah,

Good suggestion! I will try that and let you know.

Thank you!

Cindy

In reply to Josiah Ritchie

Re: How to move Data folder to a different drive?

by Cindy Zhao -

Thank you Josiah. I checked permissions. They are about the same now. The only thing I can't duplicate is "Inherited from:" for Internet user account. On C drive, it's inherieted from C, but on E, it's not inherited.  Should that cause problem?

Still doesn't work. Do I need to restart some services? Even if the permission is wrong, how come it works on new files uploaded using Moodle, but it doesn't work for the files I copied from C to E on the server directly? Do i have to load everything from Moodle? That doesn't make sense...

Thanks again!

In reply to Cindy Zhao

Re: How to move Data folder to a different drive?

by Cindy Zhao -

This problem happened to Dave a year ago. You can try these suggestions at http://moodle.org/mod/forum/discuss.php?d=56935

Nothing works for me. So I started my process. Although Moodle can't rename or delete files, luckily it still unzips files. So I went though folders on the server to create zip files, and unzip them in Moodle, after I am sure it works, I delete the zip file and the old folder.

Moodle surely likes the newly unzipped files. It happily does everything I want it to do now. I think Moodle just generally doesn't like the idea of us doing things on the server without his notice. If we do everything through him, he is a much happier person - NO guarantee though!

In reply to Cindy Zhao

Re: How to move Data folder to a different drive?

by Richard Enison -
CZ,

If the files you had a problem with were copied to E: before you changed the permissions for that drive, maybe those files needed to have their permissions changed before they could be used. I'm just guessing, but I would believe that's the reason rather than because Moodle wants to do everything itself! I don't think it keeps track of which files it unzipped and which files were already unzipped (or maybe never unzipped, but copied from another Moodle site or created from scratch).

RLE
In reply to Richard Enison

Re: How to move Data folder to a different drive?

by Cindy Zhao -

RLE,

Thank you. I guess something is wrong for my permissions. But those files worked just fine before we moved to E. Have you tried to create a file or folder right on server and manage it on Moodle?  I wonder if you can rename, delete or move them around on Moodle.  It doesn't work for me even on the C drive before I moved files to E. Moodle will desplay those files, but can't change around...

Thanks again!

Cindy

In reply to Cindy Zhao

Re: How to move Data folder to a different drive?

by Richard Enison -
CZ,

No, I'm afraid I don't have a Moodle site on a Windows server right now, just a Windows package (XAMPPlite) Moodle on my own PC, which is a stand-alone system, not connected to a network (except the Internet), so most permissions don't apply. I did install Moodle on a server once, but it was a Linux system.

RLE
In reply to Cindy Zhao

Re: How to move Data folder to a different drive?

by Ken Wilson -

Cindy

You might want to try again with this command (assuming moodledata is stored as c:\moodledata and e:\moodledata):

c:\>md e:\moodledata
c:\>xcopy c:\moodledata\*.* e:\moodledata /E /H /K /O /Y /C

This will recursively copy all the files from the c: drive into the e:\moodledata. The pertinent switches are /O and /K which copy the ownership/ACL info and well as attributes. We used this recently to successfully copy to a new disk.

Ken



Average of ratings: Useful (1)