Moodle automated course backups: what they cover and when to use them
A learning team that needs to recover a deleted or damaged course, roll a course forward into a new term, or show what a course contained at a given time needs per-course archives it can restore on demand. Moodle's automated course backups answer that need: they are scheduled backups of individual courses, written by the platform on a timetable you set. They are not a site backup. A course backup holds the course structure, activities and resources, and it does not replace a copy of the database, the moodledata directory and the code taken together, which is covered separately.
The main reasons to switch them on are accidental deletion of a course or its content, course rollover where a finished course is reused for the next cohort, and an audit trail of what a course looked like at a point in time. Each of these cases depends on the backups being produced reliably, so the first check is whether the scheduled backup runs at all. Moodle core includes a backups report (report_backups), which lists backup activity and results, so administrators can confirm that scheduled backups completed. Confirm in your own environment which role can open that report and who reviews it each week.
This page covers course backups only. It does not address site backups, log retention or the ad hoc task queue. Before you enable anything, decide which courses are in scope, how long each archive must be kept, and where the archives will be stored, because those three choices drive the settings described in the sections that follow.
Automated backup options and when each fits
This table compares the main settings in Moodle's automated course backup configuration, what each one controls, when it fits and what it costs you. Read each row as a decision: pick the setting that matches your recovery needs, storage capacity and privacy obligations, then confirm the trade-off with your own course owners.
| Option | What it controls | When it fits | Trade-off |
|---|---|---|---|
| Schedule | How often automated backups run and the run time, which sets how much course change can be lost between backups | Daily runs at a quiet hour suit courses that change often; less frequent runs suit stable archived courses | Frequent runs add load on the server during the run window and create more files to store |
| Course selection (all courses) | Every course on the site is backed up on each run | Small sites or a single recovery policy for the whole platform | Storage and run time grow with every course, including empty or retired ones |
| Course selection (by category) | Only courses inside chosen categories are backed up | Faculties, departments or programmes that need different retention or schedules | Courses moved between categories may fall outside the selection without anyone noticing |
| Course selection (selected set) | Only courses named in the configuration are backed up | High-value courses such as accredited programmes or courses under audit | New courses are not covered unless someone adds them, so gaps can go unnoticed |
| Storage location (course backup area) | Backups are kept in the course backup area and are visible to course staff | Teams that want to restore a course themselves from the course interface | Backups share course space and are tied to the course, which adds storage pressure inside Moodle |
| Storage location (directory) | Backups are written to a server directory outside the course areas | Central recovery, storage managed separately from course files, or copying to other backup tooling | Someone must control directory permissions, free space and copies outside the server |
| Number of backups to keep | How many automated backups are retained before older ones are removed | Balances restore points against disk use; keep enough to cover the time before a problem is usually noticed | Fewer kept files means less restore history; more kept files means higher storage use |
| Exclude user data | Leaves learner submissions, forum posts, grades and similar records out of the backup | Course structure and content backups where learner data is held elsewhere or must not be copied | Learners' work is lost on restore, and the file is smaller but not a full record of the course |
| Backup report | Report of backup runs, including the status of each course, shown through the backups report in core | Administrators checking that scheduled runs completed and that files were written | Only useful if someone reviews it; failures can pass unnoticed without a regular check |
Setting up automated course backups step by step
This sequence takes a Moodle site from unscheduled course backups to a verified schedule that writes predictable files, keeps a set number of copies, leaves user data out where policy requires, and reports every run.
Confirm cron is running before scheduling
Automated backups are queued by Moodle's scheduled tasks, so nothing runs if cron is stopped or failing. The administrator checks that the system cron entry for the web server user is active and that the scheduled task log shows recent successful runs. Done means the task log shows recent completions and no repeated errors for the backup task family. If cron is not healthy, fix it first, because every later step depends on it.
Set the automated backup schedule
In site administration, the administrator opens the automated backup settings and sets when the backup task runs, along with the day or days and the time window. Pick a window when the site has low activity, and confirm the chosen time with the server's time zone and the site's configured time zone. Done means the saved schedule appears in the settings and the next run time in the scheduled task list matches what was intended.
Choose the storage location for backup files
Decide whether automated backups go to a course backup area or to a directory on the server, then set that choice in the automated backup settings. A course area keeps files inside Moodle's file system and is easier for teachers to find; a directory suits off-server copying and external backup tooling. Confirm the directory exists, is writable by the PHP user, and sits on storage with enough space for the expected number of copies. Done means a test write to the chosen location succeeds under the web server account.
Select which courses are included
Set the course selection so the task covers only the courses you intend, using the category, course list or whole-site option the settings offer. Exclude archived or empty courses where they add nothing, and confirm with course owners any course that holds regulated records. Ask your vendor or check your version's documentation for the exact selection options available. Done means a sample of included and excluded courses matches the list you agreed.
Set how many backups to keep
Set the retention count, which controls how many automated backup files are kept for each course before older ones are removed. Base the number on how far back you may need to restore and on the storage you measured in the previous step. Write the chosen value and the reason in your change record so reviewers can see it. Done means the setting is saved and the storage estimate for the included courses fits the location chosen earlier.
Decide whether user data is included
Choose whether automated backups include user data such as submissions, grades and forum posts, or only course structure and content. Including user data gives a fuller restore but creates copies of personal information, so check this against your data protection obligations and retention rules before enabling it. Record the decision with its owner. Done means the setting matches the approved decision and a test backup reflects that choice.
Run a test backup and check the output
Trigger a manual or scheduled run against one course, then open the storage location and confirm the backup file appears with the expected name and a plausible size. Restore that file into a non-production site or a test course to confirm its contents. Done means the file is present in the right place, restores cleanly, and matches the user data choice you made.
Enable and read the backups report
Enable the backups report, which Moodle core provides as report_backups, and open it after the test run to confirm the test backup is listed with its status and course. Set a routine for someone to review the report after each scheduled run and to investigate failed or missing entries. Done means the report lists the test backup, the review owner is named, and a deliberate failure in a test course shows up in the report.
Choosing storage for course backups
Automated course backups produce files on the Moodle server, and each storage choice changes who can reach them, how much disk they consume and whether they survive a server failure. The decisions below connect the backup area, the directory permissions, the copy-off step and the protection of files from people who can edit courses.
Course backup area or a directory
Moodle can keep automated backups in each course's backup area or write them to a directory on the server. The course backup area keeps files tied to the course and visible to people with the right capabilities, while a directory gives you one place to inspect, copy and expire files. Confirm which option your backup settings expose in your Moodle version and test a restore from each before choosing.
Disk space on the Moodle server
Backups are written to the same server or storage that holds moodledata, so every retained backup competes with uploads and the file pool. Estimate size from a sample backup of your largest course, multiply by the number of courses and retained copies, and confirm that the volume has headroom for peak weeks. Ask your storage team how that volume is monitored and alerted.
Directory permissions for the web server
A backup directory must be writable by the PHP user that runs cron, and it should be readable only by the accounts that need it. Keep it outside the web root so files cannot be fetched by URL, and check that the directory is not inherited from a broader share. Set ownership and mode explicitly and confirm them after each change window.
Copying backups off the server
A backup on the same disk as the site does not protect against disk loss, deletion or a compromised host. Decide whether a scheduled job copies new files to separate storage you control, how often it runs and how old copies are removed there. Record the copy destination, its encryption and its access list in your operations runbook.
Protecting files from learners and editors
Course editors and teachers can restore or download backups they can reach, and a backup can contain grades, files and other material a learner should never see. Keep the backup area or directory unreachable from the browser, limit restore capabilities to a small role, and review who holds them. Confirm that user data is excluded from routine backups where your policy requires it.
Questions teams ask before automating Moodle course backups
What drives the cost or effort of setting up automated Moodle course backups?
The main driver is how many courses need a schedule and how those courses are grouped, because each group needs its own rules for frequency, retention and storage. Effort also rises with the amount of course content (large files, embedded media and question banks), the number of storage locations, and how much review the backup report needs. Setup itself is usually a small part of the work. Most of the cost sits in agreeing the policy: which courses are covered, how long copies are kept, and who receives the report. Ask any quote to itemize discovery, configuration, test restores, documentation and handover, and to state which items recur, such as monitoring the report or reviewing retention each term.
Can an internal Moodle administrator set up automated course backups alone?
Often yes, for a single site with a clear retention policy and an existing cron setup. The administrator needs site administration access to the automated backup settings, a way to confirm that scheduled tasks run, and permission to write to the chosen storage. Teams usually need outside help when the policy is unsettled, when courses span several categories with different rules, or when backups must go to a directory that the web server and operating system permissions do not yet allow. Confirm internally who owns the backup report, who can approve a restore, and whether the team has tested a restore before relying on the schedule.
How long does automated course backup setup take?
The duration depends on the number of courses in scope, how many schedules and storage designs are needed, and whether test restores must be proven before go-live. A pilot on a few courses with one schedule is far shorter than a site-wide rollout with separate rules for each faculty or department. Storage design can lengthen the work when it involves a directory outside the default course area, permissions for the web server user, or a retention approach that must match records policy. Ask for a timeline built from the written scope, with the number of course groups, storage locations and restore tests listed as separate milestones.
What does the work need from our team before and after setup?
Before setup, the team needs a working cron schedule so Moodle's scheduled tasks actually run, enough free storage for the number of copies the retention rule keeps, and a test course that can be backed up and restored without affecting live students. Your team also needs to decide which courses are included, how many backups to keep, whether user data is excluded, and where files are stored. After setup, someone must read the backup report, watch disk use, and carry out periodic restore tests. Ask the implementer to document each of these responsibilities and to name the person who receives failure alerts.
Do automated course backups replace a full Moodle site backup?
No. Course backups capture the content of individual courses, typically the activities, resources and settings, and they can exclude user data. They do not protect the database, the moodledata directory, the code and configuration, or the ability to rebuild the whole platform after a failure. A site recovery plan needs those components backed up together and consistently, with recovery time targets agreed in advance. Course backups remain useful for recovering a deleted course or an earlier version of course content, and a sibling page covers the whole-site approach in detail.
How do we verify that course backups actually restore?
Check by restoring a sample backup into a separate test course or test site, then confirming that activities, resources, grades settings and files appear as expected. Restore tests should cover courses of different sizes and types, including one with large files and one with quizzes or question banks, because those are the most likely to show problems. Read the backup report after each scheduled run, looking for failed or skipped courses, and treat a missing report as a failure. Record the results, repeat restores after Moodle upgrades or storage changes, and agree in writing who signs off each test.
Will automated course backups include student data, and can we exclude it?
Automated course backups can be configured to exclude user data, so the copies hold course structure and content without learner records. Whether to include user data depends on your retention obligations, your privacy policy and whether the backups are used for restoring learner activity. Confirm the setting for each schedule with your data protection lead, and check where backup files are stored and who can access them. Excluding user data reduces the sensitivity of the stored copies but changes what a restore can recover.
Why restore testing matters more than the backup count
A backup is only useful if it restores, so plan restore tests as a routine task rather than assuming the backups report is enough. The backups report (report_backups) in Moodle core shows what ran and when, but it cannot tell you whether a course file will import cleanly into a working site. Pick a sample course that represents your harder cases, such as one with a large quiz question bank, embedded media or many enrolled users, and restore it into a separate test site on a schedule you can keep. Confirm the restore path with your own team before you rely on it, since the steps depend on your Moodle version and how your backup storage is set up.
Record every restore test in a simple log: the date, the backup file tested, the destination site, the time the restore took, whether the course opened and quizzes and grades looked right, and any errors. Treat a failed restore as an incident with an owner and a fix, not as a note for later. A recurring failure usually points to a cause worth tracing, such as a backup written with settings your restore process does not expect, a full disk on the backup storage, or a course that depends on a plugin missing from the test site. Keep the test site close enough to production in version and plugins that the result means something.
Course backups also have limits that a restore test will not reveal. A course backup does not capture the whole platform, and the database, moodledata and code have to be kept consistent with each other to recover a site. Read the sibling topic on backing up and restoring a whole Moodle site before you decide how much course-level recovery is enough for your organization. Ask your team to define which restore failures would stop teaching and how quickly they need a course back, because those answers shape how often you test and how much of the backup chain you verify.
How the scheduled backup flows from cron to storage and report
The flow starts with the system cron job that calls Moodle's CLI cron, which runs due scheduled tasks. The backup task then reads the admin settings to select courses, writes each backup to the course backup area or a configured directory, and removes older files once the retention count is exceeded. Finally, the backups report is updated so administrators can see what ran. Check each hand-off: cron must run as the web server user, the selected courses must match what you intended, and the report should show a recent success for each run.
Scheduled backups run from system cron through Moodle's task system to storage and the backups report.
How DeployOpen works on this
DeployOpen plans and implements Moodle automated course backups inside your own infrastructure, starting from a written scope that names the courses, schedule, storage location and retention you need. The work is delivered as a fixed-scope engagement with documented settings, a tested restore path and a handover your administrators can operate.
How we scope
- Inventory which course categories and courses need scheduled backups, and which can be excluded
- Agree the backup schedule, storage location in course areas or a directory, and how many copies to keep
- Confirm which Moodle version and server setup run the site, including the cron and task runner in use
- Record the written scope, deliverables and timeline before any configuration changes start
How we build
- Configure automated course backup settings for the agreed categories, with user data excluded where required
- Set the storage location and retention limits, and check that the chosen directory is writable by the web server user
- Verify that scheduled backups complete on the target courses and that the backups report lists each run
- Test a sample restore into a non-production copy of the site to confirm the backups are usable
How we hand over
- Document each configured setting, the reason for it and where it is reviewed in the administration menus
- Provide a runbook for checking the backups report, reading failures and rerunning a course backup
- Walk your administrators through the restore steps and record who is responsible for reviewing backup results
- Deliver the configuration notes in a form your change control process can review and approve
How we support
- Offer ongoing support and retainers for changes to courses, schedules, storage and retention
- Review backup results after Moodle upgrades, because release changes can affect scheduled tasks
- Retest restores on a set cadence agreed in the retainer, so recovery steps stay current
- Confirm with your team which backup responsibilities sit with them and which sit with DeployOpen

