Experiment - Backup and migrate Moodle

Submitted by Rajasekhar on Sat, 11/17/2018 - 10:13

Below is the recommended method to migrate Moodle.

Use this method in the following scenarios:

  • Moodle site from one server to another. For example, moving a Moodle site from a shared hosting service's server to a dedicated server.
  • Creating a duplicate/shadow copy of Moodle in the same server.

Here, I am showing migrate Moodle following the second method as I want to create a same copy on the same server with a different domain.

Please follow the below steps:

  1. Create a new Domain on the same server.
  2. Create a Database and User to the new site. And ass user to the database with all privileges.




  1. Now take a backup database of your existed Moodle site.
  2. Then upload the backup to a newly created database using phpmyadmin. 


  1. Copy all Moodle site folder and files to new site folder under public_html. For example, public_html/moodle to public_html/migmoodle.
  2. Existed Moodle Site Folder, Copy all these contents to new site folder.


  1. This is Website Moodle Site Folder after copied existed site folder contents. 


  1. Next, need to create another duplicate moodledata folder with another name under Home path as shown below. For example, moodledata1.


  1. Now copy all moodledata contents to moodledata1 folder.



  1. Now go to public_html -> migmoodle -> config.php. Update all $CFG->wwwroot, $CFG->dataroot and new Database details as shown below.





  1. After done with configuring Moodle as above. Now try to access your new Moodle site.


I am getting HTTP ERROR 500 as above, Please suggest any solution for this.