WeBWorK Main Forum

Easiest way to backup & move ALL student/homework/exam info of ALL classes to new server? e.g. MySQL dump/restoration to/from single file possible?

Easiest way to backup & move ALL student/homework/exam info of ALL classes to new server? e.g. MySQL dump/restoration to/from single file possible?

by Christian Seberino -
Number of replies: 3
Easiest way to backup & move students, passwords, homework scores, exam scores, etc. of ALL classes to new server?

It seems the wwdb command is deprecated and it only seemed to dump students rather than homework and exam scores too.

e.g. Can I just do a MySQL command do dump the entire database and
restore is on another server?


In reply to Christian Seberino

Re: Easiest way to backup & move ALL student/homework/exam info of ALL classes to new server? e.g. MySQL dump/restoration to/from single file possible?

by Gavin LaRose -
Hi,
  # mysqldump -u root -p webwork > /tmp/webwork_mysql.sql
  # cd /opt/webwork/courses/
  # tar -cvf /tmp/webwork_files.tar .

Should get all WeBWorK data (assuming that your course directory is /opt/webwork/courses/). Then on the new server, assuming that the webwork database exists in mysql,

  # mysql -u root -p < webwork_mysql.sql
  # cd /opt/webwork/courses/
  # tar -xvf webwork_files.tar

Should restore the state of the database and course files (obviously, the files webwork_mysql.sql and webwork_files.tar will have to have been moved to the new server as well).

Gavin

In reply to Gavin LaRose

Re: Easiest way to backup & move ALL student/homework/exam info of ALL classes to new server? e.g. MySQL dump/restoration to/from single file possible?

by Danny Glin -
Minor correction:
I believe you need
  # mysql -u root -p webwork < webwork_mysql.sql
In reply to Gavin LaRose

Re: Easiest way to backup & move ALL student/homework/exam info of ALL classes to new server? e.g. MySQL dump/restoration to/from single file possible?

by Christian Seberino -
Thanks!  What does the tar file of the courses directory give you?
I never would have thought to do that.  Does that just save less important
stuff like CSS stylings or vital stuff too?

I thought everything was in the database.

cs