[LON-CAPA-admin] question about backup

Stuart Raeburn raeburn at msu.edu
Fri Feb 19 10:00:33 EST 2016


Hi Balagopal,

>
> ... I have a question on backup and restore of lon capa. I  have a  
> standalone loncapa server used for statistics courses and a  webwork  
> server used for mathematics courses. At the moment I backup  /home,  
> /etc and mysql daily overnight to tape and to another disk  array.
>

For LON-CAPA, backup of /home and /etc is appropriate. In LON-CAPA any  
tables in the loncapa MySQL database are temporary, so although there  
is no harm in using mysqldump to dump the MySQL to a file for backup,  
the tables will be repopulated, either by entries in  
/etc/cron.d/loncapa run by cron, or by actions in LON-CAPA itself  
(e.g., displaying grades or generating reports).

You could use less space if you limited your backup of /etc to  
/etc/httpd/conf, /etc/httpd/conf.d, /etc/passwd, /etc/shadow,  
/etc/group, and /etc/gshadow.

>
> ... I came across the hardware  upgrade section of the lon capa  
> documentation which mentions to restore the whole /home. But nothing  
> I could find about moving a  single course in and out of the current  
> capa server.
>

The difficulty in moving a single course is that you if you wanted to  
preserve all the data associated with a course would need to copy both  
the data directory for the course (in  
/home/httpd/lonUsers/dal/$1/$2/$3/$courseid and each's student  
submission data for the course, stored in a separate dal_courseid.db  
file in each student's directory, e.g.,  
/home/httpd/lonUsers/dal/$1/$2/$3/$username). Furthermore the majority  
of the content used in a course is likely to come from the "published"  
resource space. In the case of a standalone LON-CAPA instance, that  
will be from /home/httpd/html/res/dal on the library server for the  
dal domain.

I suppose a reason you might ask about moving a single course is how  
you can validate that your back-up is working correctly. One way to do  
that would be to start httpd and the LON-CAPA daemons on the back-up  
instance, and then log-in to a course and confirm that all is working  
as anticipated.  You would need to replace the hostname of the  
production instance with the hostname assigned to the back-up instance  
in the hosts.tab and dns_hosts.tab files in /home/httpd/lonTabs.

Note: if you do that on a back-up of a LON-CAPA library server, that  
is part of a cluster (i.e., not standalone), you should replace the  
copied hosts.tab, dns_hosts.tab, and dns_domain.tab files in  
/home/httpd/lonTabs with files that only refer to the back-up machine,  
and your own domain.

The question about moving courses is most often asked in the context  
of aiming to free disk space, and there is an existing enhancement  
request which will implement a method for archiving old users and  
courses. See: http://bugs.loncapa.org/show_bug.cgi?id=6766.

One way, today, that you can free up disk space on a production server  
is to compress the activity.log file in each old course.  You can do  
that by running
/home/httpd/perl/parse_activity_log.pl as user www.  That script has  
one required argument:

/home/httpd/perl/parse_activity_log.pl -course=<courseid>

If you run it without an argument then information about other  
possible arguments will be displayed.

Notes:

1. When a Course Coordinator views course activity for a user in a  
course, parse_activity_log.pl is run by the lonsql daemon, so if a  
Course Coordinator does that from the web GUI fro any old courses you  
would not need to do that from the command line.

2. A side effect of running parse_activity_log.pl is to create  
temporary tables in the MySQL loncapa database:

<courseid>_<domain>_activity
<courseid>_<domain>_machine_table
<courseid>_<domain>_resource
<courseid>_<domain>_students


Stuart Raeburn
LON-CAPA Academic Consortium


Quoting Balagopal Pillai <Balagopal.Pillai at Dal.Ca>:

> Hi,
>
>           I have a question on backup and restore of lon capa. I   
> have a standalone loncapa server used for statistics courses and a   
> webwork server used for mathematics courses. At the moment I backup   
> /home, /etc and mysql daily overnight to tape and to another disk   
> array. With webwork, I could move a particular course to another   
> server by simply copying over the courses/<some course> directory   
> and corresponding mysql tables. I was wondering what would be the   
> steps
> to accomplish the same thing in loncapa. I came across the hardware   
> upgrade section of the lon capa documentation which mentions to   
> restore the whole /home. But nothing I could find about moving a   
> single course in and out of the current capa server.  Thanks.
>
> Regards
>
> Balagopal Pillai
> Room 004, Chase Building
> Department of Mathematics and Statistics
> Dalhousie University
> Halifax, NS
> (902) 494-3204
>
> _______________________________________________
> LON-CAPA-admin mailing list
> LON-CAPA-admin at mail.lon-capa.org
> http://mail.lon-capa.org/mailman/listinfo/lon-capa-admin



More information about the LON-CAPA-admin mailing list