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

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:

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

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]

Additionally, 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 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.

References

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