Am I backing up the entire database, all courses, & site with the automated backup

Am I backing up the entire database, all courses, & site with the automated backup

by Barron Koralesky -
Number of replies: 9

I am wondering if I am backing up all of the database, courses, course files, etc. when I use the backup feature.

I ask because when I last moved my moodle install I had to do a mysqldump and also move the moodle data folder.  I am wondering if both are done for the automated backup.

I want to make sure that if my server was to die, I could restore the enirety of my server into a different moodle install.  (Here's to hoping that I don't have to actually do that soon!)

Thanks!


Average of ratings: -
In reply to Barron Koralesky

Re: Am I backing up the entire database, all courses, & site with the automated backup

by W Page -
Hi Barron,

Yes, it would be nice to know exactly what is backed up with the "BackUp" feature in Moodle.

I also would like to know how to just do nightly backups of the entire site
  • files
  • data directory
  • database associated with that site
  1. Is it possible to do this with just one "CRON" or is a special script needed?
  2. Someone in one of the other threads asked about a script wihich would email backups to another server. Does anyone know anything about this as well.


Hope someone responds.

WP1
In reply to W Page

Re: Am I backing up the entire database, all courses, & site with the automated backup

by Jan Dierckx -
The backup facility backups databasetables AND files. Of course there is no need to backup the files that constitute the Moodle application itself, because you can always download a fresh copy from moodle.org, unless of course you have a lot of customisations and hacks that you want to keep... tongueout
 
For the past 8 months I've been using dbsender which mails a compressed zip file of the complete Moodle database to me. (At the moment with about 300 students and 10 teachers using it, the attachment weighs about 800 Kb)
You can include dbsender in your crontab, or you can visit it manually from time to time just by typing in it's address.
 
dbsender only sends you the database, not the files. Downloading all the files every day would be very time consuming, but someone referred me to a command WGET. It has a mirroring option to only download the files that have been changed recently. There is a windows version of WGET here.
 
I've entered the following commands in a notepad document:
 
wget -o log.txt -np -m ftp://username:password@www.olvrode.be/private/moodledata 
wget ww.olvrode.be/moodle/admin/dbsender.php
 
and saved it with extension .cmd
 
Now whenever I click on this file
all the recently changed files are downloaded to my pc
the database gets mailed to me
 
I also use Windows Task scheduler on the computer in the teacher's room  to run the script every evening at 20.00h (when there's nobody there)
If needed I can provide more details later, right now I'm preparing my lessons: school starts again on 1 September.
<shameles plug>
... I was trying to get the script working in the other direction as well. I'd like to synchronize the bookmarks of the computer in the teachers room with Stephan Frech's bookmark program. Unfortunately I cannot find a way to automatically make IE export it's favorites. If someone knows a way (javascript?) to do that, it would be very useful. It would be nice to tell colleagues that they could just add favorites to that one computer in the teacher room, and the favorites would be added automatically to the schools Moodle site. It might tempt more teachers into getting invloved in our school's Moodle site. 
In reply to Jan Dierckx

Re: Am I backing up the entire database, all courses, & site with the automated backup

by W Page -
QUOTE:
"....have a lot of customisations and hacks that you want to keep... " Jan Dierckx

wink wink wink wink wink

Hi Jan!

Thanks for such an extensive and thorough response.

WP1
In reply to Jan Dierckx

Re: Am I backing up the entire database, all courses, & site with the automated backup

by Timothy Takemoto -

Dear Jan Dierckx

Thannks very much for the backup tips.

I have the dbsender going, in my webspace for the time being. It is really useful. A complete copy of my database came to me just like that. It was a quite a thrill.

I will put another copy of dbsender in a folder in my home directory (above public_html) and ask my sysadmin to set up a cron.

The WGET thing is intersting as well. I think that you are using it to go and GET the backupfiles created automatically by moodle.

I guess that as well as downloading things it can also simply click (ping? cron?) urls hence the reason for the dbsender URL being in the WGET command file. I would like to do the same to avoid having to ask my system administrator to set up a cron task but I would like to be able to password protect my dbsender (using .htaccess and .htpasswd) . In fact that is my first task.

I don't suppose you or anyone would happen to know of another php script that would be able to upload and restore the backup? As it stands I would have to ask my system administrator to restore.

Thanks for telling us about these useful tools.

Tim

In reply to Timothy Takemoto

Re: Am I backing up the entire database, all courses, & site with the automated backup

by Timothy Takemoto -

I can't seem to download the WGET from either of the two official sites.
http://xoomer.virgilio.it/hherold/
ftp://sunsite.dk/projects/wget/windows/
It has take more than 30 minutes and it seems to have stopped half way.
Does anyone know where else I might wget my hands on one?

I spoke too soon,

ftp://ftp.sunsite.dk/projects/wget/windows/wget-1.9.1b-complete.zip

seems to work for me. I have not installed it yet though.

By the way, it seems that WGET has a way of specifying a password and username so I can leave the dbsender in my web directory in a password protected folder.

Tim

In reply to Timothy Takemoto

Re: Am I backing up the entire database, all courses, & site with the automated backup

by N Hansen -
I have a couple questions regarding the database and backup:

1-What exactly does the database contain vis-a-vis the course and site files?

2-I "think" I performed a backup of my database through my Cpanel a couple days ago-wound up downloading a file called moodle.gz. Is that a backup of the database?
In reply to N Hansen

Re: Am I backing up the entire database, all courses, & site with the automated backup

by Timothy Takemoto -

Dear N. Hansen,

1 I am not 100% sure about the course files but I presume that they are NOT included in the database backup.

2 The moolde.gz does sound like the zipped database, created for you by CPANEL.

In reply to Timothy Takemoto

Re: Am I backing up the entire database, all courses, & site with the automated backup

by Timothy Takemoto -
So no one knows of a restore PHP freak program then?
In reply to W Page

Re: Am I backing up the entire database, all courses, & site with the automated backup

by Eloy Lafuente (stronk7) -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Peer reviewers Picture of Plugin developers Picture of Testers
Moodle "automatic backup" feature backups courses (one file for each course).

Although is true the course backup files contains all the necessary info to restore courses at any moment, the quickest way to recover an entire Moodle site (or to move it to other server) is to copy everything (database, moodle dir and moodledata dir) and store them in a safe place at regular intervals.

You can find some useful info about this in:

"backup moodle" link.
http://moodle.org/mod/forum/discuss.php?d=9803
http://moodle.org/mod/forum/discuss.php?d=5894
http://moodle.org/mod/forum/discuss.php?d=2112

Hope they help...ciao smile