Backing up Moodle

Backing up Moodle

Hans de Zwart - ން
Number of replies: 9
I would like to back up my complete Moodle site. I can do a dump of the MySQL database and am able to backup Moodle itself.

However I have a problem with the data directories. I have no access to them since I do not 'own' the rights to them (Moodle created the directories).

Would it be an idea to include backing up the data in the admin page on a new release?
I know in the future you want to add the ability to save courses etc., but that is not what I am asking here.

Does anybody know any other short term solutions?
Average of ratings: -
In reply to Hans de Zwart

Re: Backing up Moodle

Gunther Dippe - ން
Check out i.e...
http://www.hotscripts.com/search/?bool=AND&query=mysql+backup&category=all

You'll find several scripts for backing up your different MySQL databases.

I don't think it's crucial to backup Moodle itself (mybe except for your config file) since Martin provides us with excellent access to past versions.

Cheers
In reply to Gunther Dippe

Re: Backing up Moodle

Greg Barnett - ން
If your server is running some variant of unix/linux/bsd, and you have the command line version of php installed, and you are using mysql, you might want to try the backup script I put together. It is in the contrib/crown_college/backup directory (available at http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/moodle/moodle/contrib/crown_college/backup/backup.php ). I've also attached it. Of course, it won't help with the permissions issue though.
In reply to Greg Barnett

Re: Backing up Moodle

Abdul Rahman - ން

clicking on either link creates a dead graphic.

You might want to save it as a text file backup.php.txt. That because the server sees a php file and attempts to run it.

 

In reply to Hans de Zwart

Re: Backing up Moodle

Martin Dougiamas - ން
ފޮޓޯ ފޮޓޯ ފޮޓޯ ފޮޓޯ ފޮޓޯ ފޮޓޯ
Full backups of the data directory will be in the next version - I've already been looking into it.

I recently found this nice PHP class that does zip and unzip, so there will be soon be a button somewhere to create and download zipped backups.

http://www.phpconcept.net/phpzip/
In reply to Martin Dougiamas

Re: Backing up Moodle

John Windmueller - ން

I just wanted to say a big Yay! for integrating data and database backups in Moodle.  As I get more and more instructors to try Moodle, I've been increasingly concerned with ways of doing responsible backups of Moodle.  My host doesn't provide command-line access--at least not without lots of begging and prodding--and so having the functions built into Moodle would be a wonderful addition.

John

In reply to Hans de Zwart

Re: Backing up Moodle

Ray Le Couteur - ން

I am struggling with the same problem as Hans -  as my site grows, backup of uploaded files becomes ever more important .....

I can backup database and moodle itself, but not the contents of the moodledata directory - these directories are created by moodle and I do not have permission even to view these files by ftp.

Any way round this?

Thanks

Ray Le couteur

In reply to Ray Le Couteur

Re: Backing up Moodle

Ray Le Couteur - ން

>I can backup database and moodle itself, but not the contents of the moodledata directory - >these directories are created by moodle and I do not have permission even to view these files >by ftp.

I have found a workaround - I have changed the file permission values from 750 to 755 in index.php (\files) and moodlelib.php (\lib).

Now I can see, download, delete etc the files (I had to do some deleting/re-uploading to make this apply to current files - but all new file are OK now).

Martin  - are there any issues regarding my changing these values?

Thanks

Ray Le Couteur

 

In reply to Ray Le Couteur

Re: Backing up Moodle

Dr. Prin Singhanart - ން
i tried your method but it still doesn't work .. still don't have permissiong to moodle data directory. I changed chmod 750 to 755 to both files.

When you say..

...Now I can see, download, delete etc the files (I had to do some deleting/re-uploading to make this apply to current files - but all new file are OK now)......

could you kindly be more specify of what you did step by step so that I can follow? ie. delete what / re upload what? those two files that had been chmod or the data files ?



In reply to Dr. Prin Singhanart

Re: Backing up Moodle

Ray Le Couteur - ން

When you change the permissions in Moodle, these changes will only apply to newly added files. The older resources already have permissions set.

I deleted all the older files (from within Moodle), then manually deleted the empty folders by ftp (couldn't delete the non empty files by ftp).

Then I re-uploaded files in Moodle and the new permissions were set correctly.

I am still not sure how well the backup will work - I will certainly be able to download all the files for safe keeping, but if I put them back via ftp the 'permissions' will not be 'owned' by Moodle - it may not work. I might have to upload the files from within Moodle.

Hope this helps.

Ray Le Couteur