Moving a huge single folder from one server to another

Moving a huge single folder from one server to another

by Derek Chirnside -
Number of replies: 3

I think I know the answer to this question, but I'm just checking.

I have a person I work for wanting to shift a HUGE folder from one server to another.  I copied the contents to an excel spreadsheet and counted over 90 folders and 1400 files in it.  Backing it up gives a zip file of 2.4GIG.  Moodle 2.2.

This size file I cannot manage to download > upload > restore. (see for example https://tracker.moodle.org/browse/MDL-34388)  I can't use the work around here of selectively backing up, since you can't back up part of a folder.

The "Download all" option simply goes no-where, no error, just nothing.  Probably hitting a zip file limit.

Any innovative thoughts on this?  Or is it "copy the folder, do hundreds of manual deletes, maybe while watching NCIS, and then backup the folder in smaller bits"  ??

-Derek

[If you feel like saying how stupid such a design model this is, feel free.  Once the files are migrated, I can help try to improve this, maybe]

Average of ratings: -
In reply to Derek Chirnside

Re: Moving a huge single folder from one server to another

by Ken Task -
Picture of Particularly helpful Moodlers

Not sure I follow this ... 'shift a HUGE folder from one server to another'.  Is it a 'folder' in a 2.x Moodle course comprised of a bunch of files/sub-folders?

When you backup the course that contains this folder, can you not select ONLY that resource? (ie, don't include all the other resources links, etc. in the course).  What's the download size of that 'reduced course'?

Am unaware of any utility that would 'break apart' a folder in version 2 or Moodle.  It has to be done the 'hard way'.  If one could download the 'reduced course', change the extension to .zip, and unzip it into a 'test' folder, one could work through getting the contenthash named files back into something humanly readable.

Will follow up with some specifics on how to do that, IF am on the right track with the issue.

'spirit of sharing', Ken

In reply to Ken Task

Re: Moving a huge single folder from one server to another

by Derek Chirnside -

Not sure I follow this ... 'shift a HUGE folder from one server to another'.  Is it a 'folder' in a 2.x Moodle course comprised of a bunch of files/sub-folders?

>>Yes.  Folder resource.

When you backup the course that contains this folder, can you not select ONLY that resource? (ie, don't include all the other resources links, etc. in the course).  What's the download size of that 'reduced course'?

>>Done this, which is what I tried to say.  smile The backup is 2.4GIG.  Just the folder.

Am unaware of any utility that would 'break apart' a folder in version 2 or Moodle.  It has to be done the 'hard way'.  If one could download the 'reduced course', change the extension to .zip, and unzip it into a 'test' folder, one could work through getting the contenthash named files back into something humanly readable.

>>I know.  Trying to avoid this.  smile

Will follow up with some specifics on how to do that, IF am on the right track with the issue.

>>Tx.

In reply to Derek Chirnside

Re: Moving a huge single folder from one server to another

by Ken Task -
Picture of Particularly helpful Moodlers

Well, it appears that my 'solution' is not something one desires to do ... understandable, considering the number of files.

Maybe a true programmer would care to make a buck or two!  Basically, the flow would be this:

rename the .mbz file to a .zip file.

unzip the zip to a 'work' directory/folder

Script run from the 'work' directory.

read and parse the files.xml file for these items:* the contenthashed file name

* the humanly re-cognizable file name

* the directory where the contenthashed named file resides in the files folder of the extracted zip

mv the contenthashed named file from the 'files' directory to an 'extracted' directory and while moving rename it to the 'humanly readable' (original as uploaded) filename.

Since one is working with a backup to be pulled apart, it's ok to move rather than copy because once the extractions are done, there is no need for the stuff that remains in the 'work' folder.

One could (maybe) reverse engineer the PHP script that created the 'mess'.  Folders were useful in =< 1.9.x.  Not so much so now in 2.  That, of course, is my personal opinion.

Wonder how much such a handy utility would cost? :|

Sorry, don't have a 'wizard utility' to assist with this and am not enough of a programmer to provide something that would work in a timely fashion (don't we all need something 'yesterday'? :\).

'spirit of sharing', Ken