Backups Fail After Upgrade

Backups Fail After Upgrade

by Floyd Collins -
Number of replies: 5

Hello All,

I have tried to find a clear answer to my problem but so far nothing seems to work. Here is the scenario.

We recently upgraded our server from a G4 to a dual G5 running Mac OSX 10.4. All seems to be working fine, except for back ups. When I go into a course and try and run a back up I get the following error.

An error occurred while copying course files

And down in the pink section I have: The backup did not complete successfully

When I try and run a full site backup I get the following.

An error occurred while copying course files

And down in the pink section I have: The backup did not complete successfully

I can run the backup manual from inside the temp directory and all works fine. Just for some reason Apache seems to not be able to run the backup scripts.

One oddity is that I have many files in the temp folder that I can not explain.

XServeG5:/Library/WebServer/moodledata/temp/backup root# ls

1128772743 1128775811 1128776259 1128776772 1128780015

1128774212 1128775929 1128776284 1128779533

Any suggestions would be greatly appreciated.

Here are the ls – al for the moodledata folder

drwxrwxrwx 46 www admin 1564 Sep 30 14:25 moodledata

Please Help, I am hitting a brick wall here!!

Average of ratings: -
In reply to Floyd Collins

Re: Backups Fail After Upgrade

by Floyd Collins -

Anyone ??? please

In reply to Floyd Collins

Re: Backups Fail After Upgrade

by Eloy Lafuente (stronk7) -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Peer reviewers Picture of Plugin developers Picture of Testers
Hi Floyd,

such error use to be caused by some file that can not be copied to the temp backup area (all those xxxxxxxxxx dirs under your temp dir) , mainly due to some wrong perms at origin.

If you aren't able to detect what files/dirs are the problematic, you can try this:

- Edit the /backup/lib.php file (under your moodle installation).
- Go to line 288. You will see this:
    //echo "<br />Copying ".$from_file." to ".$to_file;              //Debug

- Delete the 2 initial slashes. Then, the line will be:
    echo "<br />Copying ".$from_file." to ".$to_file;              //Debug

- Go to line 314 in the same file. You will see this:
    //echo "<br />Creating ".$to_file;                                //Debug

- Delete the 2 initial slashes. Then, the line will be:
    echo "<br />Creating ".$to_file;                                //Debug

- Save the file
- Run one course backup manually. You will see how every file is copied and how every directory is created. If you get the error, the last file before it is the problematic one.

Uhm, I hope it wasn't one of the .DS_Store Apple internal files... sad

Hope it helps smile

PS: Before trying that, don't forget to make a copy of your original /backup/lib.php, to be able to undo those manual changes.
In reply to Eloy Lafuente (stronk7)

Re: Backups Fail After Upgrade

by Floyd Collins -

Good info,, yep pointed me right to the prob, I deleted the temp folder recreated it as www user and wham everything started backing up.

One other issue to deal with, when I run http://server/admin/cron.php I get nothing, when I run it from the command line, I get database error could not connect to database ect ect something about it being busy. Very odd the rest of the site works fine so I dont think it is something with config.php. Any ideas on that issue, or have you seen this problem around the forums.


Anyways, thanks for the help. Oh one other issue that may have been the prob is that I had it set to 20777 and I took the 2 out of config.php. Maybe that was the saving grace I dont know.

In reply to Floyd Collins

Re: Backups Fail After Upgrade

by Russell Myers -
Hey Floyd,

I was trying to recreate my temp dir and give it the right permissions, I was also trying to chmod the user folders and other files. Nothing would work and fix my backup woes. I finnaly tried to delete the 2 out of the directory permissions = 02777. In the end my directory permissions ended up being 0777 and my backups work. I have no idea why, but it works!

Thanks for the help!
In reply to Floyd Collins

Re: Backups Fail After Upgrade

by Russell Myers -
I have the same problem, almost. I am still on 10.3, I was not having fun installing GD for Tiger. I have no explanation yet.