Data backup and restore
Data stored in the Moodle database is volatile – even a Moodle site with no users can be “active” with scheduled tasks running in the background. Our client is keen to ensure that, in the event of a disaster, very little data is lost from the Mathaholics platform.
Our Mathaholics Moodle data will reside both in the database and the moodledata
directory. We must ensure that, at the very least, these are regularly backed up so that we can restore our Moodle to a previous state in the event of data corruption, hardware failures, or other disasters.
Let’s begin with database backup strategies.
Database backup to file
A straightforward way of backing up less volatile database data is to run a simple bash script to export data. First, we need to create a new database user dedicated to the backup process. From the command line, log into MySQL and run the following command (replacing password
with your secure password):
CREATE...