Backing up Moodle

Backing up Moodle

Hans de Zwart -
回帖数: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?
回复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
回复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.
回复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.

 

回复Hans de Zwart

Re: Backing up Moodle

Martin Dougiamas -
Core developers的头像 Documentation writers的头像 Moodle HQ的头像 Particularly helpful Moodlers的头像 Plugin developers的头像 Testers的头像
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/
回复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

回复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

回复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

 

回复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 ?



回复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