[LON-CAPA-admin] question about backup

Balagopal Pillai Balagopal.Pillai at Dal.Ca
Fri Feb 19 10:30:01 EST 2016


Hi Stuart,

      Thanks for detailed information. This is very helpful. There are two common scenarios I can think of for moving a single 
course from one loncapa setup to another. For example, loncapa server run by department A gets retired and a request comes in
to migrate those courses to a loncapa server operated by department B that already has live courses. The other scenario would be if a professor 
wants to revert the course data to the state of yesterday or a week before (assuming that something catastophic has happened to that
course) In both cases, courses would need to be moved in and out without touching other live courses. Many thanks.

Regards

Balagopal Pillai
Room 004, Chase Building
Department of Mathematics and Statistics
Dalhousie University
Halifax, NS
(902) 494-3204


________________________________________
From: lon-capa-admin-bounces at mail.lon-capa.org <lon-capa-admin-bounces at mail.lon-capa.org> on behalf of Stuart Raeburn <raeburn at msu.edu>
Sent: Friday, February 19, 2016 11:00 AM
To: lon-capa-admin at mail.lon-capa.org
Subject: Re: [LON-CAPA-admin] question about backup

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

_______________________________________________
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