Need help restoring LARGE course backup (Moodle 2.7.1)

Need help restoring LARGE course backup (Moodle 2.7.1)

by Mike Brinkman -
Number of replies: 3

One of our instructors had a ton of MP3 files in his music course, so the backup ended up being 2.5 GB. Our max size on the server is 2 GB, so the upload fails.

I was going to restore it to my local computer in a Moodle instance, remove the MP3 files, then back it up again so I can restore on the production server. I have Moodle running on XAMPP on my local machine, and changed the php.ini file to allow 5 GB uploads, and the change is reflected in Moodle when I start it up again. However, the upload still never completes.

I know in pre-Moodle 2.x, you could just stick the file in the local uploads folder and restore it from there, but with Moodle 2.X, I have no clue.

Average of ratings: -
In reply to Mike Brinkman

Re: Need help restoring LARGE course backup (Moodle 2.7.1)

by Ken Task -
Picture of Particularly helpful Moodlers

Sounds like production server needs file system repository.

Please see:

https://docs.moodle.org/29/en/File_system_repository

The directory created for the file system respository is outside of moodle's 'normal' file system - ie, the filedir in moodledata.   One uses whatever tool one can (ftp/scp/WinSCP, etc.) to access the server and the directory created for the file system repository.

Such a setup isn't restricted by PHP nor by Moodle ... it might, however, be restricted by the operating system upon which Moodle runs by the provider of the service.

A large course still might require some tweaking of other settings on server ... MySQL as well as PHP.   MySQL might need max_packets_allowed set higher.   PHP might need time for a script to run set higher.

So if your first attempt to restore fails, turn on debugging and then try it again.   Debugging will hopefully give you a clue as to what is needed.   Might also have to check your apache error logs.

'spirit of sharing', Ken

In reply to Ken Task

Re: Need help restoring LARGE course backup (Moodle 2.7.1)

by Mike Brinkman -

Hi Ken,

Thanks for the suggestion. It's a very good one, but a little more involved than I'd like to get for just restoring this particular course.  Hopefully we can get it implemented in the future. Do you have any recommendations for how I could take care of this course though?

In reply to Mike Brinkman

Re: Need help restoring LARGE course backup (Moodle 2.7.1)

by Ken Task -
Picture of Particularly helpful Moodlers

Uhhh ... thought I did address:

"I know in pre-Moodle 2.x, you could just stick the file in the local uploads folder and restore it from there, but with Moodle 2.X, I have no clue."

In 2.x moodlese that's a file system repository.   On a localhost machine, one could drag and drop that large backup in the file system repository directory created and linked in whatever 2.x version of Moodle you are running to skirt the upload issue.

Only difference in localhost from production server out on the net ... one may not be able to do drag and drop in operating system sense but use FTP/WinSCP, etc. 'drag and drop' to xfer the large backup to the file system repository manually created and linked to in production Moodle.

Sorry ... other than tweaking apache/php to allow larger and larger uploads via Moodle UI, file system repo is the only other alternative.   It is also faster and less prone to timeouts, other issues (apache/php).

Also ... since this has happened once on the production server, think you will run across it again ... courses only grow they do NOT shrink (if using just Moodle file system for storing files).   So think taking a local host approach is only delaying what you'll eventually end up doing on the production server. smile

Sometimes an 'easy button' just doesn't exist! :|

OR ... one could make a backup of the course only this time deslecting say 1/2 of the mp3/audio links.  Save the backup with added text in file name - bu1 (backup 1).

Then make another backup, this time de-selecting the stuff you backed up in bu1 and selecting only the items not included in bu1.  Save the backup with bu2 in the name.

Restore bu1 to a course.  Then restore bu2 to the existing course.

When you do the second restore, don't expect everything to come back into the course in the same section/week, whatever as the original course.  You will have some re-arranging to do.

To me ... that could be more work than file system repo setup.

'spirit of sharing', Ken