Some Confusion on Backup

Some Confusion on Backup

by Dennis Herrick -
Number of replies: 14

I'm using Moodle 1.9 on Windows Server 2003. We host our own and I'm the "administrator" (who isn't at all sure what he's doing!!)

I've read some on backup, but much of things I find here have a big 2.0 in the top left. 

I understand course backup -- that's done within the course and I would think this is something each teacher should do?

I'm trying to figure out site backup. The actual Moodle server is in the IT office in another building. I have that machine mapped to my Windows Vista machine as a drive. I also have a separate external drive on my machine that's to be the backup drive. 

If I just drag my entire moodle19 folder from the server to the external drive on my machine, is that all I need? Are all the databases, etc. IN the moodle19 folder?

The moodle19 folder is currently a little over 500 meg and I know this is bringing extra stuff (moodle code, etc) that doesn't need backup, but with this 2 TB external drive, several years of backing up just the moodle19 folder would fit

I've read some about site backup from within Moodle. I can get to that machine through remote desktop but can't get to my external drive from there. Should I be doing a site backup from within Moodle TO the server, and then have the backup software on my machine ONLY backup this?

I set up the server last year and learned how to do courses and things, and this year it's open to all faculty to use. At this point it's definitely being used but not by any means with all faculty (small school, so there's only around 40 faculty anyway....)

Any suggestions?

Average of ratings: -
In reply to Dennis Herrick

Re: Some Confusion on Backup

by Helen Foster -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators

Hi Dennis,

Here are a couple of links about backup in Moodle 1.9:

Hopefully they answer all your questions, but if not, please post again!

Average of ratings: Useful (1)
In reply to Helen Foster

Re: Some Confusion on Backup

by Dennis Herrick -

Helen, thanks for your reply. 

I've got course backup working, but the docs say "however they should never be used as a primary backup system"

So what I need is site backup. What's on that page (from the link above) gives a nice example of a Unix script and down at the bottom there's a link to a video on backup for Linux , but I'm windows. It also mentions phpMyAdmin but I don't think I have that.

In other words, I'm pretty new and clueless!!!

1. If I just drag my entire moodle19 folder from the server to the external drive on my machine does that cover it all?

2. Should I be asking faculty to backup THEIR courses? 

(There was also a link to backup for low-tech users, and I'm working on that.)

In reply to Dennis Herrick

Re: Some Confusion on Backup

by Ann Adamcik -

For site backups, you'll need a copy of your moodledata directory, a copy of your application directory, and a dump of your database. How you get those depends on your system. Just copying your moodle19 folder probably isn't going to get you everything you'll need to recover. You can install phpmyadmin into your moodle/admin folder, if you want to back up your database that way. See http://moodle.org/mod/data/view.php?d=13&rid=448.

We do both types of backups here. Faculty are responsible for backing up and storing their own courses, and we also do nightly site backups.

Average of ratings: Useful (3)
In reply to Ann Adamcik

Re: Some Confusion on Backup

by Dennis Herrick -

OK, i've got phpMyAdmin (was already installed...); I've got a moodledata directory, but don't have an applications directory. Is that inside the moodle19 directory?

By dump of your database, is that the EXPORT from phpMyAdmin?

(note: on the phpMyAdmin page it says "Your PHP MySQL library version 5.0.51a differs from your MySQL server version 5.1.33. This may cause unpredictable behavior." -- is this anything to be concerned about?

In reply to Dennis Herrick

Re: Some Confusion on Backup

by Dennis Herrick -

I still could use a little help.... Ann mentioned an Applications directory, but I don't have one. 

I've got the database dump. First time I did it, it took a minute or so then put it all on screen. So that's not what I want, so I see the SAVE AS FILE and clicked that. Then I'm asked if it want to save the file, and it's then saved to my default download directory. The only other choice is to save it to my moodledata/mysql directory. 

How do I automate this? Shouldn't this be done every night?

So out of the three things mentioned above, I backup the moodledata directory, the database dump (which is IN the moodledata directory) and all I need then is the Applications directory?

And I still need help with this from previous message:

(note: on the phpMyAdmin page it says "Your PHP MySQL library version 5.0.51a differs from your MySQL server version 5.1.33. This may cause unpredictable behavior." -- is this anything to be concerned about?

Thanks for any help!! I'm getting there slowly but surely....

In reply to Dennis Herrick

Re: Some Confusion on Backup

by Colin Fraser -
Picture of Documentation writers Picture of Testers

Hi Dennis, this is like a lot of things in Moodle, once you understand what is happening, then it becomes easy. It like pushing against an open door very frustrating until you can see it is open. Also, if you are the Admin of the Moodle on a large intranet then it may not be your problem to back it up in its entirety, talk to your techies, that may be their problem.

Moodle backups really come in three parts, the moodledata folder, the moodle code and the database. Backups occur at course level and site level and they can be subdivided to suit each need.

If you want to do a site backup, then you are backing up all parts of the site and you are better off using a specific tool, whatever your favourite tool is, to cover everything you want. You can backup the code, but there is really no point, you should already have stored somewhere the code anyway. Or you can download and install the latest version - less than 22 minutes the last time I did it from starting the download to begin to restore the first courses - on a server btw

Specific tools, like phpMyAdmin are excellent to backup just the database, the tables without data, the data without tables or the tables and data, suit yourself. 

Course backups can be done internally, by Admins or by Teachers, either one. You can backup the course files, in whole or in part, the user files, in whole or in part, or the both as a whole lot, or any part thereof.

You can suit yourself with the flexibility. Moodle does really not back itself up in its entirety, it can but a dedicated backup tool is a better option.

As for the error message, it really does not make too much difference, but to get rid of the message, go to the Zend site and download the latest release, untar or unzip it and copy the php_mysql.dll file to your php/ect folder and update yours. That should take care of that issue. Alternatively, you may want to download the latest release of PHP and update it. This might not be for you to decide so talk to your techies let them know what is happening, it give them a chance to sort it. 

Average of ratings: Useful (3)
In reply to Colin Fraser

Re: Some Confusion on Backup

by Dennis Herrick -

Colin, thanks for your reply! I am beginning to understand what's happening!

I am the Admin of Moodle here, but it's a small school. I am responsible for all the backup. They gave me a big external drive, set up the Moodle machine as one of my network drives so I can access it easily. I've got software do do it and am trying to get it started.

The Moodledata seems easy. There's a folder there and I can just put it as one of the items my backup software backsup....

For the code... on the server there's a folder called moodle19, and I have copied that entire folder to my backup drive, so I would think that covers the code.

So I guess my remaining problem is the database. You mentioned tables without data, data without tables, etc. and I understand what that means, but for a backup which is easiest to restore if the need arises??

I don't see a way to automate the database backup with my backup software. I can use phpMyAdmin to do a database dump, but don't see how to schedule that to be done daily before my backup software on my machine runs.

For course backups, this is our first year with Moodle and faculty are just learning Moodle. For this year I'd like to handle course backups which I can do and automate. 

In reply to Dennis Herrick

Re: Some Confusion on Backup

by james mergenthaler -

Dennis - I am in a similar situation as you, a new administrator.  The guy who i replaced had some things documented, but i am asking similar questions that you are. 

We store the DB separate from the application instance.  On our DB server, i am using MySQL administrator, and have a weekly scheduled task that backs up all 6 of our different moodle dbs into a single backupfile ( i keep three copies of it - in case one became corrupt and killed the lastest backup)  We have 6 different moodle sites and 6 different moodle db instances - so this is how we *automate them into a single task.  If I needed to restore one of the db's, i could load the backup file and parse through it using the MySQL administrator GUI - selecting the specific db and even the specific tables, if i only needed to restore part of the db.  If our entire db server crashed, I could restore all 6 of the dbs from one backup file.


I am trying to figure out the best way to handle the per course backup, pushing that responsibility to the teachers as much as poss.  I do like the option as a *emergency backup, the automated course backup procedure mentioned in Mary previous post. 

This feels to me like the smart thing to do, since moodle makes this provision for us, we should use it.  I will still *hold to the position, that it is the course creators responsibility to backup their course.

As far as backing up the moodle core, probably not a big concern, as mentioned in Mary links, unless you start to add 3rd party plugins or customize the installation or tweak the code manually.  Even so, an occasional backup of the code is not a bad idea.  Especially before you attemp to upgrade moodle or install a third party moodle.

I have set up a sandbox instance where i can experiment with different backup options (course and DB) to ensure i know what im doing. 

In reply to Dennis Herrick

Re: Some Confusion on Backup

by Colin Fraser -
Picture of Documentation writers Picture of Testers

James mentions something I have not heard of before, MySQL Administrator, but if it allows scheduled backups then it is going to save me a bit of work every week. Going to have a look at it now and looks interesting.  

In reply to Colin Fraser

Re: Some Confusion on Backup

by Colin Fraser -
Picture of Documentation writers Picture of Testers

Sorry, been tied up on other things. MySQL Adminsitrator has reached its EOL, and been replaced with MySQL Workbench. This looks to be a far wider reaching tool as it combines several popular MySQL tools into a single tool. While I don't have the tiome to follow this up just yet, you may want to try it out yourself, and let us know how you get on. Cheers.  

In reply to Colin Fraser

Re: Some Confusion on Backup

by james mergenthaler -

Im using MySQL workbench on my localhost and have been using it alot over the past couple years, especially with regard to some development work that i have been doing.  MySQL Administrator is version 1.2.14 and resides on our production db server.

Thats good info for both http://dev.mysql.com/downloads/gui-tools/5.0.html.

Seems we could still use MySQL Administrator, just not supported.  But, makes sense to try to phase it out and work with MySQL Workbench.  I will have to look at how to replicate the same automated backup process in MySQL WorkBench.

In reply to james mergenthaler

Re: Some Confusion on Backup

by Dennis Herrick -

I got MySQL Workbench installed. While I am one of the tech guys on campus (although a music faculty) I have gotten myself in places before that I can't fix.  Opening a new program that somehow has to connect to my working Moodle installation is a little intimidating since it works just fine right now.

The Workbench has three panels, SQL Development, Data Modeling, and Server Administration. I assume it's the Server Admistration I want to be able to automate my database backups?

In reply to Colin Fraser

Re: Some Confusion on Backup

by Ravi Vare -

Hi Colin,

"it can but a dedicated backup tool is a better option."

Pl. Suggest some tools

 

"go to the Zend site and download the latest release......"

I have downloaded 'exe'.

I will try it.

Best Regards,

Ravi

In reply to Ravi Vare

Re: Some Confusion on Backup

by Colin Fraser -
Picture of Documentation writers Picture of Testers

I have used Acronis on a Windows machine, but that is not a free tool, perhaps Bacula or perhaps another low cost solution like building your own backup server using a Linux box. This is not as difficult as it sounds, but getting a windows box to talk to a Linux backup server might be a little tricky. I cannot really recommend anything, I don't do this anymore, the techie takes care of all backups these days, and he uses a tape drive, I am given to understand. 

Be a little wary of .exe files. For PHP I have only ever used the Zip file. I understand the exe is actually a self extracting zip file and installer, but essentially it does the same as the zip file, and I think you still have to alter the path statement manually.