In Moodle we can import the data of one course to another course by using the standard course import functionality in course administration as shown below
But sometimes we are facing an error when we try to perform this activity even after following all the standard steps to execute this activity.
The error which we are facing is database error as observed in the image below.
To check whether this was a concern for all the courses, we have created a sample test course and imported it to another test course and it was successful.
So after debugging at server level we found that as per the current configurations we are unable to import a course which was more than 1GB.
Current PHP.ini Configuration settings
post_max_size = 1024M
upload_max_filesize = 1024M
max_execution_time = 300
max_input_time = 60
The size of the course that needs to be imported is 1.4GB.
So to resolve the raised concern, we need to modify the settings in the PHP.ini configuration file.
Desired PHP.ini Configuration settings
post_max_size = must be greater than 1GB
upload_max_filesize = must be greater than 1GB
max_execution_time = 600
max_input_time = 180
Once after configuring the above settings, the course import functionality would be done normally without any errors.