WeBWorK Main Forum


Re: backup

by Gavin LaRose -
Number of replies: 0
Hi Ted,

That would get some information, but would lose all the information that's in the database. You also need to get all of the data from the WeBWorK mySQL database to back up the course. On my (RedHat) system, the data files for the mySQL database are in /var/lib/mysql, but that may differ for you.

If you're thinking about doing a tar/gzip of the course directory to start with, a possibility would be to do a dump of the mysql tables for the course into that directory first. For example, if /opt/webwork is your WeBWorK root directory, you might do something like
# cd /opt/webwork/courses/MAT000/DATA
# mysqldump -u root -p webwork MAT000_password MAT000_permission MAT000_problem MAT000_problem_user MAT000_set MAT000_set_user MAT000_user > MAT000_backup.sql

And then tar/gzip/etc. the course directory. If you're running WeBWorK 2.4, you'll want to add MAT000_set_locations and MAT000_set_locations_user to the list of tables that you backup.

(The mysqldump command says: dump [-u root] as user root [-p] asking for a password [webwork] the webwork database. We then give a list of tables to dump and send the dump file to MAT000_backup.sql. This will obviously require that you know the mySQL root password.)