What needs to be backed up?
A Moodle system comprises three parts:
- The data stored in the database (For example, a MySQL database)
- The uploaded files (For example, site and course files uploaded via Moodle located in moodledata)
- The Moodle code (For example, everything in server/htdocs/moodle)
You can confirm where all these things are located in a Moodle installation by checking the config.php file.
-
- $CFG->dbname shows the database name
- $CFG->prefix shows the the database table name prefix
- $CFG->dataroot controls where the uploaded files are stored; and
- $CFG->wwwroot points to where the code is stored.
- Tip
Generally speaking, the database (“dbname and prefix”) and the uploaded files (dataroot) are the two most important to copy on a regular basis. These contain information that will change most often.
The Moodle code (wwwroot) is less important as a frequent backup, since it will only change when the the actual code is changed through upgrades, addins and code tweaks. You can always get a copy of the standard Moodle code from http://download.moodle.org so you only have to backup the parts you added or changed yourself.
Visit this Moodle Site Backup page for details.