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:
- Create a new Domain on the same server.
- Create a Database and User to the new site. And ass user to the database with all privileges.
- Now take a backup database of your existed Moodle site.
- Then upload the backup to a newly created database using phpmyadmin.
- Copy all Moodle site folder and files to new site folder under public_html. For example, public_html/moodle to public_html/migmoodle.
- Existed Moodle Site Folder, Copy all these contents to new site folder.
- This is Website Moodle Site Folder after copied existed site folder contents.
- Next, need to create another duplicate moodledata folder with another name under Home path as shown below. For example, moodledata1.
- Now copy all moodledata contents to moodledata1 folder.
- Now go to public_html -> migmoodle -> config.php. Update all $CFG->wwwroot, $CFG->dataroot and new Database details as shown below.
- 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.