Backing up Moodle
This is probably been discussed many times, but I can't seem to find a 'full' solution from start to finish. We are starting to use our Moodle after half-term and I need to start backing it up. I will be backing up to a NAS box (FreeNAS with SMB setup).
I don't know what to backup or how to backup. Can anybody give me a solution? (scripts for cron jobs etc would be grand :))
You can back up courses and config from within moodle, moodle.org will have details. Best if you backup the db and other files as well though, I stop the db from running then use ntbackup to copy the info. This has the added advantage that you then have a backup of the backup so if you need to go back a way you can.
Ok, forgot to say my Moodle install is sitting on a Ubuntu server. I want an automated solution - something I don't have to think about (or remember to do).
I do a mysqlhotcopy (can be done on-line) of the database
MySQL :: MySQL 5.1 Reference Manual :: 4.6.9 mysqlhotcopy ? A Database Backup Program
then use rdiff-backup to backup the filesystem
to an Openfiler box.
Openfiler — Openfiler - Open Source Storage Management Appliance
Some perversion of the rsyncd config on Openfiler is required to make this work.
Moodle itself can backup the courses for you (and users,blogs etc...). You can set the various backup options under:
Site Administration > Courses > Backups (/admin/settings.php?section=backups)
The moodle cron script (/moodle/admin/cron.php) must be run regularly for this to work. You'll end up with a bunch of zip files in the backup folder, one for each course. eg: backup-hrm-20090527-2201.zip
You can either have the backup folder mounted over the network or use another script to rsync the files to the nas.
More info here: Backup and restore FAQ - MoodleDocs
The alternative is to use a combination or mysqldump and rsync in a script. Examples: Site backup - MoodleDocs