Note: You are currently viewing documentation for Moodle 1.9. Up-to-date documentation for the latest stable version is available here: Backup and restore FAQ.

Talk:Backup and restore FAQ

From MoodleDocs
Revision as of 19:47, 9 July 2008 by Marc Grober (talk | contribs)

Comment

I have some concerns about some of the material provided in this FAQ. I am concerned that the command line resources are potentially being provided to new users who will get very very confused. I also think that the FAQ should, if anything, really be an index into the docs.

As far as specifics:

There are two main things you need to make a copy of - the database and the uploaded files. The Moodle scripts themselves are less important, since you can always download a fresh copy if you have to.

Aside from ending in "to",  ;) , I have to challenge the accuracy of this statement in that I demonstrated that it can be next to impossible to download the save version of moodle as you had installed and it is just so very simple to back this up as well.

Here is an outline of a little script you can run on Unix to backup the database

This is not a script but a list of commands that one might consider in developing a script.

cd /my/backup/directory
mv moodle-database.sql.gz moodle-database-old.sql.gz
mysqldump -h example.com -u myusername --password=mypassword -C -Q -e --create-options mydatabasename > moodle-database.sql
gzip moodle-database.sql

While it is obvious one can't move something that does not exist, I just know that someone is going to complain about this.

Because so many people get confused over -p[password] I do concur that longopts should be recommended, but I think it would also be helpful if the suggestions used longopts throughout, as in

mysqldump --user=[username] --password=[password] --opt [dbname]>[outputfile]

Of course, the error that usually results from placing a space between -p and a password regarding being unable to locate table "nameofthedatabasetobedumped" should be included.

Because the lines may break, it is important with longer lines either to force the break and add the \ and provide a placeholder for the system prompt.

2. If you are running mysql, a backup of the database should be a .sql, .gz or .tar.gz file. If it is .tar.gz or .gz you need to extract it until it is an sql file.

Arguably whether you are running mysql or not has nothing to do with whaty you used to back up your sql file or its extensions. Backed up files may also be in tgz format and could be zip'd or rar'd for that matter.

For the files, you can use rsync regularly to copy only the changed files to another host:

While the rsync info is great, it assume knowledge of how to set up rsync and provides no references of any sort. On the other hand, there is no discussion of simply tarring/gziping the files.

SInce phpmyadmin is so prevalent it might be help to include information on using this tool, as well as information on dropping tables in an existing database.

References

A big THANK YOU to Eloy Lafuente (stronk7) :-) Helen Foster 26 November 2005 17:34 (WST)