I can't restore/find automated backups.

I can't restore/find automated backups.

by Ahmad ElGazzaz -
Number of replies: 10

Hello,

I have configures automated backup to run every day at 9:30. the backup report says it is done but I can not find it or restore the courses

Automated backup settings:


The backup report:


And the course restore area:




I am testing moodle on my Linux Mint 17.3 laptop and running moodle 3.2.1

Average of ratings: -
In reply to Ahmad ElGazzaz

Re: I can't restore/find automated backups.

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

I had this happen once before but it was when I was backing up to an external folder.  Moodle couldn't write to the folder so it randomly put them somewhere else (I think in a backup folder in moodledata maybe) and still reported that backups were ok, which I found really curious.  I guess I would check your permissions on your moodledata folder, see if they run tonight by chance and also look for backups (search for .mbz files) having been randomly saved somewhere else.

In reply to Emma Richardson

Re: I can't restore/find automated backups.

by Ahmad ElGazzaz -

Thank you Emma,

Before posting today I have given a full write permission to the whole www folder but still nothing 

and searching for .mbz files I found three files under 20kb none of them contain any backup data.


In reply to Ahmad ElGazzaz

Re: I can't restore/find automated backups.

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

Try and run it manually and see if that helps or at least tells you what is going on.  Either through browser at admin/cron.php or through CLI at admin/cli/cron.php

In reply to Emma Richardson

Re: I can't restore/find automated backups.

by Ahmad ElGazzaz -

It runs manually with no problems at all, but still nothing appears in the course restore area.


EDIT: I noticed when I tried to backup a single course I get to the import screen with all the backups of this course in the automated backup section

In reply to Ahmad ElGazzaz

Re: I can't restore/find automated backups.

by Ken Task -
Picture of Particularly helpful Moodlers

Pardon intrusion ...

The settings for automated backups show 'course backup area' which is moodledata/filedir/

So it could be the ownerships/permissions on all of moodledata ... not the code directory ...  is the issue.  Your apache error logs would probably have references to not being able to write to some directory in moodledata/filedir/

How did you find those 20kb .mbz files?   The backup process actually stores those files in /moodledata/filedir/##/##/somelongcontenthashname ... which is humanly un-recognizable ... ie, file doesn't have a .mbz extension at all.

IF you were using DB queries of mdl_files and saw a reference to a backup file and file name that's meta-data in the DB itself ... not really the physical file in /moodledata/filedir/  So to see if there is a .mbz file in /moodledata/filedir on has to use the contenthash info which shows a long value consisting of a bunch of letters/numbers.

The first two characters of contenthash is a subdirectory in moodledata/filedir/

The second two characters of contenthash is a subdirectory or the subdirectory above

and finally, in there the file has the name of the contenthash.

'spirit of sharing', Ken


In reply to Ken Task

Re: I can't restore/find automated backups.

by Ahmad ElGazzaz -

Thank you for the invaluable information.

One of the first things I tried to do is to upload a file and find it in the moodledata folder. I did find the file but it was tiresome.

Back to my problem, I can not find any errors in the log related to the inability of writing in the moodledata folder. I tried to follow the instructions on the moodle documentation for moodledata folder permissions, but the website was inaccessible so I restored the original permissions.


EDIT: I noticed when I tried to backup a single course I get to the import screen with all the backups of this course in the automated backup section

In reply to Ahmad ElGazzaz

Re: I can't restore/find automated backups.

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

So is it that you are just not looking in the actual course restore area?  You will not see them from the restore area from the front page, you have to actually be in the course...

In reply to Emma Richardson

Re: I can't restore/find automated backups.

by Ahmad ElGazzaz -

I go to: Site Administration > Courses > Restore Course and it is blank as the screenshot I have posted in the beginning.

Is this wrong?

In reply to Ahmad ElGazzaz

Re: I can't restore/find automated backups.

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

Yes, the backups are restored in the individual course backup area.  Go to the course that you want to restore, and then click on restore - you will see the backups listed there....

If you are doing a bunch, you are better off to backup all your courses to a folder on your server.  

In reply to Emma Richardson

Re: I can't restore/find automated backups.

by Ahmad ElGazzaz -

Thank you very much Emma, now I know I have been looking in the wrong place.