BACKUP Issues

BACKUP Issues

by Louis Fleming -
Number of replies: 6

Version 1.9.9  - approx 6 courses covering about 125 students.

Discovered today but 1 course will not backup individually or as a group. Wanting to backup and have hosting company upgrade to newer PHP and MYSql so I can mose to at least 1.9.11 or 2.0

All have fully permissioned backup folders

Cleared out initial backup files and all other files from some time ago so the backup folders are empty.

Even tried deleting folders and recreating folders

all are 0777 permissions.

Ideas??

Average of ratings: -
In reply to Louis Fleming

Re: BACKUP Issues

by Colin Fraser -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Testers

OK, stop doing what you are doing. You are probably adding to the problem. Understand that you have not really provided a lot of information here so the responses here are either  a shotgun approach or a guess, which may or may not be of any value to you.

As a general observation, when you have any kind of issue, the first thing you can do is to go to Administration > Server > Debugging and turn on Debug messages to "ALL:..." Do whatever is causing the issue and then check the logs. Sometimes this means you can track the problem down and resolve it quickly, or it will point to something that needs further investigation. The information from the logs can then be given here which can help resolve issues more rapidly. Don't forget to turn the Debug Messages off afterward, btw.

Now, my guess. Whenever I have had a restore issue it often meant I have a Role, quite often the Admin User Role, that is different and Moodle rejected the restore because it cannot reconcile these two roles. In your backup, go to the zip file and unzip it, open the Moodle.xml file and delete the Admin User Role, the details of it anyway. (Use a UTF-8 compatible text editor, like TextPad or NotePad++ or Crimson Editor anything, but not Windows Notepad.) Save the file, rezip the backup and try a restore. This can also apply to other Roles as well, but usually the Admin User Role is the one that creates the drama. Another issue can be there is a block used in the course and included as a site file in the backup that is not present in the restore Moodle. You may want to find the block, using the same method as above, and delete references to it from the backup. This does not always work, as you can delete something you should not have - be aware of that, and be careful if you do it.

Suggestion, run two types of backups, one that is a class changeover, or end of year or semester or course backup that includes ALL user files. Store that backup somewhere off your Moodle and keep it secure. Reset the course then create a second backup without User Data, but when creating the backup, do other things as well. I do NOT include User Data, Users, User Files, Site Files, Logs, Grade Histories, and NO backup Role Assignments. I try and make it as small as possible. It may mean losing some Exercise and Workshop activities, but we do not use a lot of these we use more Lessons anyway. This I store off the Moodle in a separate location and try to keep it safe, and I only keep one of these. This is my first port of call when having a problem in a course. It may mean losing some User data sometimes, if there is no current backup but better that than my courses. It also means courses can be operational again quickly.

The other thing is backing up. If a single course is not backing up, then there is often a corrupt file or block somewhere that is causing the issue. If it is restricted to one course then it may even be a course file, go into the course, delete from it any unusual blocks. Look at the files area and see if there is anything unusual in there. If there is, delete it and try again. The shotgun is using your test Moodle. FTP to your Moodle Root and look at the folder structure. You should be able to find the Backup folder, then delete it. From your test Moodle, copy the Backup folder directly to your site using FTP.  This works for a couple of reasons, the connectionless nature fo the Internet, and second, there is not a lot of files in Modle that are installed, these are scripted pages, not executables, so you can replace entire folders or single pages and still have Moodle running properly.

If you have no test Moodle then I suggest you create one, the same version, from the same download as your site Moodle. Test things here first, use a smal number of courses to do things with, and do not be afraid of wrecking it. A small Moodle used to test stuff in before you do anything to your site is going to show you problems before you import them to your production site. I usually place this test Moodle on my local machine, environment does not matter much, usually, but sometimes it does. Get a problem on your production site and you can test responses here too.

Good luck.

In reply to Colin Fraser

Re: BACKUP Issues

by Louis Fleming -

Unzipped and looked in XML file - deleted entire admin block - rezipped the file

No change in restoring

 

As far as the backup folders - all have been emptied - deleted - recreated - permissioned. No change - some courses backup on a general backup - and others do not.

Would like to take entire backup and test on a 2.0 site - but unable to back up entire site.

 

Louis

 

 

In reply to Louis Fleming

Re: BACKUP Issues

by Colin Fraser -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Testers

Ahhh Louis, be careful here, I said the Admin User Role not the Admin Block. No guarrantee this will work anyway, but when I have such a restore issue, this is the first thing I do, and it will often work for me - but not always. Look for anything that is different that you can recall. Is there an older block that is now deleted but may be appearing in your backup yet not in your Moodle? Have you changed something since you made the original backup? What was it?

Did you turn on the logs and look for an error message? What did you find?  If anything. What is the specific error message you get when the restore fails? Have you searched the forums for a possible answer to that error message? We are working in the dark here... you have to help us to help you.

 

In reply to Colin Fraser

Re: BACKUP Issues

by Louis Fleming -

Word admin did not appear anywhere else in the XML file.  Original backup still saved.

With regards to backups issues

Several backup individually with no problem.

Located issues in 2 classes - they now backup when one block is turned off.

Last course - when I attempt to back it up - I select any blocks - click continue - it returns to asking me which course to backup.

Only time It will backup - but only users - not with any one block selected.

php shows no errors when checked in phpmyadmin.

 

 

In reply to Louis Fleming

Re: BACKUP Issues

by Colin Fraser -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Testers

mmm .. Of course.. sorry, the Admin User is a Role specifically created for a purpose, not by me, by someone else, I came in later, should have remembered.. duh.. my error.. that is why it works for me, appears in my courses but is not a default role. This is the same reason it causes problems...

The hints are there, all we have to do is analyse them... You have a problem with a block in a course, turn the block off then it backs up. Other course, turn it off and it throws you out, backup with users and no problems in some courses, but problems in others. The block that you turned off, is that a standard block or a third party block? Can you delete it and then replace it with a fresh, newly unzipped, block? How much is it used in other courses?

Are you gettign any unusual error messages? Did you turn on Debugging to look if there was any unusual error messages?

Some backup problems can occur when something has been updated and something else has not. This can mean third party blocks not properly maintained, and those that are are not always updated if you update your Moodle, can cause issues - and not just in backups. Is this possible in this case?  Has anything else changed?

What I have done in the past is to replace sections of a Moodle without updating the whole thing, which can be a risky strategy if you are not using the same version. As it is PHP scripting, you can progressively update or refresh is a better word here, by deleting the existing pages and replacing them with freshly unzipped pages from the same version downloaded file  if you still have it, or download a more recent release and update it manually, one folder at a time (higher risk because of a coding change but it can be beneficial too in updating a Moodle). Backups acting odd, replace the folder, a block problem replace the blocks, all of them, filters, the same. Icons can also cause problems in some things, but not one in backups AFAIK, but they too can be easily replaced. At this point, time is becoming an issue so start stripping stuff, like site files, out of backups. Try different combinations on the courses that are not backing up properly. That may narrow the field of potential problems. Outside of that, I am afraid I can't help much more.

 

In reply to Colin Fraser

Re: BACKUP Issues

by Louis Fleming -

Standard blocks - I only use Quizzes and webpages - maybe detailed output on grades -   but not a lot of blocks loaded.

 

No real surprises under debugging errors. Major notification I get is about upload data and it not being direct accesible via the net - but everytime I restrict permissions - I get unable to backup errors.

9 weeks left - will hobble along with this install while I test other installs on a new domain.