Note: You are currently viewing documentation for Moodle 1.9. Up-to-date documentation for the latest stable version is available here: Automated course backup.

Talk:Automated course backup: Difference between revisions

From MoodleDocs
No edit summary
 
(how to write path to backup folder)
 
(7 intermediate revisions by 2 users not shown)
Line 1: Line 1:
== SQL dump ==
I wonder if administrators should be recommended to use [http://dev.mysql.com/doc/refman/5.0/en/mysqlhotcopy.html mysqlhotcopy] rather than <code>mysqldump</code>.  Although <code>mysqldump</code> outputs a handy SQL file, it does not lock tables before being called, so there is the potential for data inconsistency on large/busy sites.  <code>mysqlhotcopy</code> locks tables before making copies of the table files themselves.  These can be tarred & gzipped for copy to another disk/server:
I wonder if administrators should be recommended to use [http://dev.mysql.com/doc/refman/5.0/en/mysqlhotcopy.html mysqlhotcopy] rather than <code>mysqldump</code>.  Although <code>mysqldump</code> outputs a handy SQL file, it does not lock tables before being called, so there is the potential for data inconsistency on large/busy sites.  <code>mysqlhotcopy</code> locks tables before making copies of the table files themselves.  These can be tarred & gzipped for copy to another disk/server:


Line 11: Line 13:
  # tar & gzip them
  # tar & gzip them
  tar -czf <path_to_homedir>/moodle-db-`date +%Y%m%d`.tar.gz /var/backups/databases/moodle
  tar -czf <path_to_homedir>/moodle-db-`date +%Y%m%d`.tar.gz /var/backups/databases/moodle
== clarification of exclusion ==
I am referring to "''Note: From 1.6 onwards, course backups automatically skip courses which are unavailable to students AND have not been changed in the last month.''" The capitalized "and" could imply that a) any course that is unavailable to students should still be backed up if it was changed; b) any changed course will be backed up only if it is not available to students. I suspect that the sentence should really read: "''Note: From 1.6 onwards, course backups automatically skip courses which are unavailable to students and courses which have not been changed in the last month.''" (no need to capitalize the "and"). In other words, either of the conditions will exclude the course from backup.
:Robert, thanks for your comments. You're right that either of the conditions will exclude the course from backup, and so I've reworded the note accordingly. --[[User:Helen Foster|Helen Foster]] 08:08, 3 October 2008 (CDT)
:Sorry, I was wrong - both conditions need to be satisfied in order to exclude the course from backup i.e. any course that is unavailable to students will be backed up if it was changed. --[[User:Helen Foster|Helen Foster]] 08:20, 3 October 2008 (CDT)
==Full path to the directory where you want to save the backup files==
One of the settings is:
Full path to the directory where you want to save the backup files
(leave blank to save in its course default dir)
I have my Moodle on a hosted server and tried various ways of designating a folder. It seems like the folder must be already created. I get a small red X on saving which I assume it means it won't work/wasn't found. It would be good to have some examples of what this could look like.

Latest revision as of 13:01, 5 May 2009

SQL dump

I wonder if administrators should be recommended to use mysqlhotcopy rather than mysqldump. Although mysqldump outputs a handy SQL file, it does not lock tables before being called, so there is the potential for data inconsistency on large/busy sites. mysqlhotcopy locks tables before making copies of the table files themselves. These can be tarred & gzipped for copy to another disk/server:

#!/bin/sh
#
# clear moodle backup directory
rm -R /var/backups/databases/moodle/*
#
# hotcopy moodle tables
mysqlhotcopy --addtodest -u <username> -p <password> moodle /var/backups/databases
#
# tar & gzip them
tar -czf <path_to_homedir>/moodle-db-`date +%Y%m%d`.tar.gz /var/backups/databases/moodle

clarification of exclusion

I am referring to "Note: From 1.6 onwards, course backups automatically skip courses which are unavailable to students AND have not been changed in the last month." The capitalized "and" could imply that a) any course that is unavailable to students should still be backed up if it was changed; b) any changed course will be backed up only if it is not available to students. I suspect that the sentence should really read: "Note: From 1.6 onwards, course backups automatically skip courses which are unavailable to students and courses which have not been changed in the last month." (no need to capitalize the "and"). In other words, either of the conditions will exclude the course from backup.

Robert, thanks for your comments. You're right that either of the conditions will exclude the course from backup, and so I've reworded the note accordingly. --Helen Foster 08:08, 3 October 2008 (CDT)
Sorry, I was wrong - both conditions need to be satisfied in order to exclude the course from backup i.e. any course that is unavailable to students will be backed up if it was changed. --Helen Foster 08:20, 3 October 2008 (CDT)

Full path to the directory where you want to save the backup files

One of the settings is: Full path to the directory where you want to save the backup files (leave blank to save in its course default dir) I have my Moodle on a hosted server and tried various ways of designating a folder. It seems like the folder must be already created. I get a small red X on saving which I assume it means it won't work/wasn't found. It would be good to have some examples of what this could look like.