Creating a Backup of Moodle

Now that course settings are understood from the last tutorial What are the Moodle Course settings?, learning how to back up Moodle is the next topic. Moodle has its own back up feature where the site can be backed up through the Moodle dashboard. The following article will outline the process of backing up Moodle through the Moodle Dashboard.

Create a backup of Moodle through the Moodle Dashboard

  1. Log into Moodle
  2. backup-moodle-step-1

    Click Backup in the Settings on the left.

  3. backup-moodle-step-2

    The Initial settings page should display. There should be a list of Backup Settings that can be selected for configuring the Moodle backup. Select the values that need to be backed up and click Next.

  4. backup-moodle-step-3

    The next page that displays is the Scheme Settings. This is the database information that Moodle will need for the restore. To back up the entire site, select ALL. There is the option to only backup specific database information; However, for learning purposes, All the database information will be selected in this example. Click Next.

  5. backup-moodle-step-4

    The Confirmation and review page should load. This page will display the backup settings and the database information that is being backed up. Click Perform backup.

  6. backup-moodle-step-5

    After the Perform backup runs, the page should show “The backup file was successfully created.” Click Continue. Congratulations, the backup of the Moodle site was successful and can be restored at a later date.

Now that the Moodle site is backed up, the backup can be restored at a later date. Please see the following tutorial on Restoring Moodle from a backup. For more information creating courses, please visit our education channel on Creating and restoring backups in Moodle. this article is also in the Getting Started with Moodle after the tutorial on Managing the Moodle question bank

Alyssa Kordek Content Writer I

Alyssa started working for InMotion Hosting in 2015 as a member of the Technical Support team. Before being promoted to Technical Writer, Alyssa developed expertise in the fields of server hardware, Linux operating systems, cPanel, and WordPress. She now works to produce quality technical content featuring cutting-edge topics such as machine learning, data center infrastructure, and graphics card technology.

More Articles by Alyssa


  • Many times got this, and never could make a full course backup:

    Debug info: MySQL server has gone away

    SELECT count(r.repositoryid)

    FROM mdl_files f

    LEFT JOIN mdl_files_reference r

    ON = f.referencefileid

    JOIN mdl_backup_ids_temp bi

    ON = bi.itemid

    WHERE bi.backupid = ?

    AND bi.itemname = ‘filefinal’

    [array (

    0 => ‘24328a6f2e8ce3b90875ff01f8d71c3a’,


    Error code: dmlreadexception

    ×Stack trace:

    line 486 of /lib/dml/moodle_database.php: dml_read_exception thrown

    line 1245 of /lib/dml/mysqli_native_moodle_database.php: call to moodle_database->query_end()

    line 1571 of /lib/dml/moodle_database.php: call to mysqli_native_moodle_database->get_records_sql()

    line 1644 of /lib/dml/moodle_database.php: call to moodle_database->get_record_sql()

    line 1854 of /lib/dml/moodle_database.php: call to moodle_database->get_field_sql()

    line 522 of /backup/util/dbops/backup_controller_dbops.class.php: call to moodle_database->count_records_sql()

    line 2007 of /backup/moodle2/backup_stepslib.php: call to backup_controller_dbops::backup_includes_file_references()

    line 34 of /backup/util/plan/backup_execution_step.class.php: call to backup_store_backup_file->define_execution()

    line 181 of /backup/util/plan/base_task.class.php: call to backup_execution_step->execute()

    line 178 of /backup/util/plan/base_plan.class.php: call to base_task->execute()

    line 119 of /backup/util/plan/backup_plan.class.php: call to base_plan->execute()

    line 322 of /backup/controller/backup_controller.class.php: call to backup_plan->execute()

    line 136 of /backup/util/ui/backup_ui.class.php: call to backup_controller->execute_plan()


    line 142 of /backup/backup.php: call to backup_ui->execute()

    • If you’re getting a database error, then you may need to speak with a Moodle Support rep. You may also need to check your database to make sure it isn’t corrupted. You can find out more information on making Moodle backups here.

Was this article helpful? Let us know!