Talk:Backup and restore FAQ: Difference between revisions
Marc Grober (talk | contribs) |
Marc Grober (talk | contribs) No edit summary |
||
Line 9: | Line 9: | ||
This is not a script but a list of commands that one might consider in developing a script. | This is not a script but a list of commands that one might consider in developing a script. | ||
''cd /my/backup/directory'' | ''cd /my/backup/directory'' | ||
''mv moodle-database.sql.gz moodle-database-old.sql.gz'' | ''mv moodle-database.sql.gz moodle-database-old.sql.gz'' | ||
''mysqldump -h example.com -u myusername --password=mypassword -C -Q -e --create-options | ''mysqldump -h example.com -u myusername --password=mypassword -C -Q -e --create-options mydatabasename > moodle-database.sql'' | ||
''gzip 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] | 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] | ||
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. | 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. |
Revision as of 19:37, 9 July 2008
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
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]
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
- Using Moodle An error occurred deleting old backup data forum discussion
- Using Moodle Meaning of error message forum discussion
A big THANK YOU to Eloy Lafuente (stronk7) :-) Helen Foster 26 November 2005 17:34 (WST)