Import a backup file hangs

Import a backup file hangs

by Joel Schaefer -
Number of replies: 6

Hello,

I have a new Moodle server running with the following versions:
  Moodle 3.8.2+ (Build: 20200428)
  mariadb 10.4.12
  php 7.2.24.0.0.18.04.6
  nginx 1.14.0

I have modified in php.ini:

  upload_max_filesize = 2000M
  post_max_size = 2000M
  memory_limit = 2000M

In hopes of getting 2Gb uploads.  The issue I am having is when attempting to import course backup files such as Moodle Mountain.mbz I see the upload completes but then the File Picker screen just hangs with a revolving circle.

Any thoughts?  Is this course backup perhaps not compatible with the Moodle version I am running?

Thanks for the response!

Average of ratings: -
In reply to Joel Schaefer

Re: Import a backup file hangs

by Ken Task -
Picture of Particularly helpful Moodlers

There is a difference in import (which is supposed to be a backup from the same server) and restore ... a .mbz backup made from any moodle server.

Check in Moodle Server -> php info and see if the values you set are seen in php config.

Hosting also makes a diff.   How hosted?  From what you've described upload is ok, but when beginning the process you chose, it hangs at that point.   The link to the .mbz file you provided is only 33.9 Megs

So is there any restrictions where you host?

'SoS', Ken

In reply to Ken Task

Re: Import a backup file hangs

by Joel Schaefer -
Hi Ken,

This is a new on premise server, not hosted. The values I provide are what is displayed on the Administration / Server / PHP Info page. I have full access to the CLI on this box and it is not yet in a production role so I can make changes as needed. I am also having issues uploading video files to use on the server so thinking there has to be something else I am missing.

Thanks again.
In reply to Joel Schaefer

Re: Import a backup file hangs

by Ken Task -
Picture of Particularly helpful Moodlers

There is a difference in importing a backup (.mbz file) and restoring a backup (.mbz file).   Importing is for restoring a backup that was made from the same server.  

https://docs.moodle.org/38/en/Import_course_data

The Mountainxxxx.mbz file link you shared I downloaded, uncompressed locally, inspected the moodle_backup.xml file to see that is a backup from version 2.4.x and from a server no longer in existence .. mooch.moodle.org.  

I also successfully **restored** (not import) that course to a sandbox 3.8.highest of mine.

From what you've shared about your server, see no reason why your server won't do the same ... except for one thing ...

Use *restore* and not 'import'.

https://docs.moodle.org/38/en/Course_restore

'SoS', Ken


In reply to Ken Task

Re: Import a backup file hangs

by Joel Schaefer -
Hi Ken,

Thanks again for the response! I have been attempting the Course Restore, not an import and I am leaving it in the .mbz format. Although now I see the .mbz format is simply a .zip format so I can open by renaming.

There seems to be something inconsistent. I have been successful at restoring other backups from the archive.moodle.net site but not all. I also have been able to install some themes but not others. Currently I am having difficulties uploading a video to include in a course.

I'm going to go hunting through site logs to see if anything jumps out. Any suggestions of what logs to look at?
In reply to Joel Schaefer

Re: Import a backup file hangs

by Ken Task -
Picture of Particularly helpful Moodlers

Not sure MountainClimbing.mbz is really any good for use cept testing restore of a course and what could go wrong.   I had no issues with it.   But couldn't use some content contained there in and noted below (for what that's worth).

Files date from Mar. 6 2013 ... over 7 years ago.

No offense to authors ... example: one question contains a .wmv video - Windows Media Video ... which is a proprietary video format and probably seldom used in any modern moodle or web site ... unless a Windows Bigot!

Ditto for a Snow_and_Ice_on_Pinnacle_Ridge.3gp found in course. Who uses a .3gp for Moodles these days?

Ditto for La haute montagne avec Gaston Rebuffat.flv ... a flash file ... even Adobe (the maker of flash) no longer supports.

Shall I go on? (not!)

'install some themes' ... are they compat with your version of Moodle?

'having difficulties uploading a video' type of video?

Did you check Site Admin Menu -> Server -> php info to see if the changes you made to php.ini for file size uploads really did take? (I've asked that before but no response).

If your moodle is a tinker instance, fine ... fool around with it.   If you plan to use it for real courses, time to do some planning and put something usefull up - not junk that you will/should clean up later.

Another question ... related ... did you set up a cron job and is it successfully executing every minute ... yes, that's the recommended frequency now ... once every minute.

Site runs nginx so it has to be Linux of some flavor (nginx doesn't make a version for Windows) so what flavor of Linux is it?

Where to look ... first, these failed restores of backup are probably taking up some space in your moodledata/temp/backup/ directory.   Manually remove any files/folders in there.   We have no idea of how much space you have left on your server and the last thing you want to do is run out of space!!!!   Database (assuming db server on same machine) will get corrupted when one runs out of space and difficult to repair.

Look in nginx server error logs for clues or other error logs for clues.

Or, turn on debugging all the way to developer and let's see what Moodle can tell you.

Look over https://docs.moodle.org/38/en/Nginx

Sounds like you are a beginning server admin ... Google is your friend ... If Moodle HQ had a true blue  server admin course I'd send ya there but, alas, there isn't one that covers it all.

If anything really does 'jump out at you' in logs ... DUCK! ROLE! AND RUN!

We all pick our own 'poisons' ... and then learn our own antedote. smile

'SoS', Ken

In reply to Ken Task

Re: Import a backup file hangs

by Joel Schaefer -
Hi Ken,

Thanks again. Your insight has been incredibly helpful.

Agreed. I am going to give up on bringing in content from archive.moodle.net on account of file formats may not be compatible with my database structure. I was looking for a course that I could use for training managers on the ins and outs of Moodle. Instead I will point people to https://learn.moodle.org

Yes. Changes in php.ini are reflected in /admin/phpinfo.php page.

My Moodle instance currently is in development as proof of concept but expected to be put into a corporate production environment with intentions of providing internal training material to staff and management as well as meeting statutory requirements from the State of California (Hostile Workplace, Sexual Discrimination, etc.)

Ubuntu version is 18.04

I have not set up any chron jobs although it is possible the admin that spun up the server set up several during set up. I have been going through the Moodle Administration screens to configure scheduled tasks. I do have full CLI access to Ubuntu but it has been a decade or so since I have worked on Linux. Still I can find my way around to get things done.

I did turn on debugging mode through the Moodle Admin screens but did not see anything in any log files presented through Moodle reporting that might point to the culprit. Another user was able to SFTP a large file to the server but I don't think that's a good test since it is not going through the HTTPS interface.

I'm going to read up on the Nginx documentation and logs to see if I see anything standing out.

Cheers for now! Joel