Backup fails when Moodle is at WWW root, not in folder

Backup fails when Moodle is at WWW root, not in folder

by Gerald Grow -
Number of replies: 2

We are unable to backup and restore a course where the contents of the moodle folder have been installed in the www root directory, and are not in the usual moodle folder. (We do this so the moodle opens at the URL mydomain.com, instead of mydomain.com/moodle. It works.)

Backup goes through the motions, but restoring it to a different server results in a blank page, sometimes with a "course" called something like "restore in progress."

Anybody succeeded with this? Any clues how to fix it?

Thanks.

Running Moodle 2.5.5 on an ample server, with accentuate theme.

Average of ratings: -
In reply to Gerald Grow

Re: Backup fails when Moodle is at WWW root, not in folder

by Ken Task -
Picture of Particularly helpful Moodlers

Suggest you share a little more info about your system - operating system? 'ample server' means what?

When it comes to backups and restores, Moodle uses moodledata/temp/backup/ so it might not be the location of the code folder but the location/relationship of/to the moodledata folder/directory.

What does the config.php file say for the location of the moodledata folder? (that's a question for investigation, you might not want share the specifics to that ... but in general, moodledata folder needs to be readable/writable by the web server user (on Linux/CentOS/RHEL that user is 'apache') but it shouldn't be in the document root for the web server (on typical Linux/CentOS/RHEL) that's /var/www/html

The actuall code of Moodle or the moodle folder is located in /var/www/html/ (again, CentOS/RHEL)

Have you turned on debugging to see what (if anything) is reported when a restore/backup fails?

One might get a clue by inspecting the contents of moodledata/temp/backup/

0 byte .log files indicate a successful backup or restore.  A .log file of any size contains info about issues with the backup/restore.   Example:

-rw-rw-rw- 1 apache apache     24406 Jun  5 17:14 972520630a2d3bf36f90098fc256354c.log

Viewing that .log file *might* show lines like the following ... remember this is an example and your .log file will say something different:

[Thu 05 Jun 2014 17:05:50 CDT] [error] (moodle1) question type converter not found dragdrop

which indicates the backup contained a quiz that had drag n drop addon question type.   The Moodle to which this course was restored did NOT have a question type dragdrop thus ... issues.

Have seen the 'restore in progress' before ... it means the restore failed. 

Again, check moodledata/temp/backup folder.

One might see:

-rw-rw-rw- 1 apache apache 352678102 Jun  5 17:04 c46a86109e69888092aecc1fea62f243

That's a file and it's really a .zip

One might also see a directory:

drwxrwsrwx 6 apache apache      4096 Jun  5 17:07 45ee7c330dc2374b5a0a239d6883a292

cd 45ee7c330dc2374b5a0a239d6883a292

and inspect:

[root@www 45ee7c330dc2374b5a0a239d6883a292]# ls -l
total 26036
drwxrwsrwx 588 apache apache    20480 Jun  5 17:07 activities
drwxrwsrwx   2 apache apache     4096 Jun  5 17:07 course
drwxrwsrwx 251 apache apache     4096 Jun  5 17:05 files
-rw-rw-rw-   1 apache apache   875625 Jun  5 17:07 files.xml
-rw-rw-rw-   1 apache apache    70947 Jun  5 17:07 gradebook.xml
-rw-rw-rw-   1 apache apache       57 Jun  5 17:07 groups.xml
-rw-rw-rw-   1 apache apache   371985 Jun  5 17:07 moodle_backup.xml
-rw-rw-rw-   1 apache apache       83 Jun  5 17:07 outcomes.xml
-rw-rw-rw-   1 apache apache 25237145 Jun  5 17:06 questions.xml
-rw-rw-rw-   1 apache apache      771 Jun  5 17:05 roles.xml
-rw-rw-rw-   1 apache apache     1490 Jun  5 17:07 scales.xml
drwxrwsrwx  29 apache apache     4096 Jun  5 17:05 sections
-rw-rw-rw-   1 apache apache       55 Jun  5 17:07 users.xml

Hmmmm ... rather large questions.xml file and a large files.xml file.   Those need inspecting.

One might also need to check apache error logs to see if restore/backup scripts are timing out or don't have enough memory to complete the job.

Afraid there is no set/pat answer to your question.  Much depends upon system, how configured, php/mysql resource limits, the backups themselvles, etc..  Been my experience that each backup/restore issue  is/has been unique so it's been a sleuthing game.

'spirit of sharing', Ken

In reply to Ken Task

Re: Backup fails when Moodle is at WWW root, not in folder

by Gerald Grow -
Ken, thanks for your generous response.

I have discovered that what we created was not a Moodle "course" but a Moodle "front page," populated with HTML files created as Activities that are accessed through the dropdown menus created under Theme Settings.

We were trying to make something that works like a WordPress page, but has the look of our other Moodle pages.

As far as I can tell, a backed-up Moodle front page cannot be restored by itself, but must be restored into a Moodle course. A blank course seems to work, but I now need to fix the internal links.

My original problem has morphed into a different problem, which I'll be working on.

If anyone has looked at restoring a front page and found something useful, please let me know.

Thanks.