My restore file is about 1 GB and can't upload

My restore file is about 1 GB and can't upload

by hoàng nguyễn -
Number of replies: 7

Last week my course is error and I want to upload a backup file. But the size limit is 64M.

I had tried to modify  php.ini  file and make an .htaccess in server.After, In Administration > Security > Site Policies > Maximum uploaded file size, it shown 2G max, but when I upload, the task shows 0% several seconds, and collaps sad

I had tried to upload some file< 500M and it is OK

I had tried to change *mbz to zip, and unziped it. But it became a file that don't have the extention.

I can't go to bed about 3 days and tried many ways

Now what should I do? please help me and thank so many

Average of ratings: -
In reply to hoàng nguyễn

Re: My restore file is about 1 GB and can't upload

by Emma Richardson -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers

Did you also update the max_post_size?  Needs to be set to the same.  I would also suggest looking at your script timeout settings.

In reply to Emma Richardson

Trả lời: Re: My restore file is about 1 GB and can't upload

by hoàng nguyễn -

I had done in php.ini ( with putty soft)

  • Type "sudo nano usr/local/etc/php5/cgi/php.ini"
  • Press Ctrl and W and type "post_max_size" and change the value to the number of Mb to 2000
  • Press Ctrl and W and type "upload_max_filesize and Change the value to the number of Mb to 2000
  • Press Ctrl and W and type "max_execution_time and change the value to 600
  • Press Ctrl +O
  • Press Ctrl + X 
  • restart server
  • But can't upload as above 

In reply to hoàng nguyễn

Re: Trả lời: Re: My restore file is about 1 GB and can't upload

by Emma Richardson -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers

Hmmm, that should fix it.  When you look at your php settings in Moodle (php info page) do you see your changes reflected there.

The only other thing that might be timing out is the database...hopefully someone can give you a clue to on what to change there (Ken?)

You might try moving the backup to a repository and see if you can restore it from there..

In reply to hoàng nguyễn

Re: Trả lời: Re: My restore file is about 1 GB and can't upload

by Ken Task -
Picture of Particularly helpful Moodlers

DB only records meta data about files ... no blob records that would be representations of files that have been uploaded to Moodle.   So don't think DB is an issue here.

After the edits to php.ini and restart of apache, the phpinfo in Moodle now shows the values for 2G.   Is that correct?

.htaccess files can override what one puts in php.ini ... so really only one method for controlling this need be done.   I use .htaccess to override defaults - max size 2 Gigs ... in some apps on same server I'd have to use .htaccess files to set that lower in some areas of the other apps - like a WordPress Uploads directory.

There is one other setting related and it's with Apache ... limitrequestbody ... normally it's set to unlimited.

http://www.cyberciti.biz/faq/apache-limiting-upload-size/

When one sets via php/.htaccess the setting then applies to all users that can upload (mentioned that cause it's something of which to be aware).

There's an alternative method for uploading files to an area/space on the server where Moodle could see it - File System Repo.

First, make a directory in moodledata/repository/ that's reflective of purpose ... like 'largerestores'.

Make the directory readable/writable by the apache user/group.

Then in Moodle, turn on File System Repos.

https://docs.moodle.org/31/en/Repositories

Go to any course and setup the file system repo by a label that points to the 'largerestores' directory.

To get large .mbz backups there, use 'secure copy' ... from a Linux/Mac, one can use the 'scp' command as the root user for the Moodle server to upload a file to moodledata/repository/largerestores/   Think Windows has a thing called WinSCP you'd need to install.

Since you are using scp that's NOT php and thus not restricted/limited by anything Moodle which runs under PHP.

Would limit who knows the login/password to server that would allow scp copies of large files.

'spirit of sharing', Ken


In reply to Ken Task

Trả lời: Re: Trả lời: Re: My restore file is about 1 GB and can't upload

by hoàng nguyễn -

I had made the reposition foder and completly upload the file backup 1G. then, I gave it to restore. Thank you so many

In reply to hoàng nguyễn

Re: Trả lời: Re: Trả lời: Re: My restore file is about 1 GB and can't upload

by Ken Task -
Picture of Particularly helpful Moodlers

Welcome!  In these forums, the way to say thanks ....  feel free to rate posting that helped as 'useful'.   Now you can 'get on with it'! ;)

'spirit of sharing', Ken

In reply to Ken Task

Re: Trả lời: Re: Trả lời: Re: My restore file is about 1 GB and can't upload

by Simon Fraser -

Ken.  You da man!!  

This worked for me !!

Thanks so much for sharing!