Hallo everyone i have a problem when restoring more than one course with same user data , i did some instruction that i've found on this forum but problem still same. $ sudo -u www-data php moosh.php course-restore --ignore-warnings -e /home/temp/ekuliahfk/backup-moodle2-course-2446-c_1001_uai707_pai_7_\(islam_disiplin_ilmu_kedokteran\)_a_12022-20230706-1603.mbz 221 Adding backup to current content of existing course -> Course ID: 221 Restoring (new course id,shortname,destination category): 221,C_1001_UAI707_PAI 7 (Islam Disiplin Ilmu Kedokteran)_A_12022,16 Default exception handler: Error writing to database Debug: Duplicate entry '0-d960231' for key 'mdl_user_mneuse_uix' INSERT INTO mdl_user (username,idnumber,email,phone1,phone2,institution,department,address,city,country,lastip,picture,description,descriptionformat,imagealt,auth,firstnamephonetic,lastnamephonetic,middlename,alternatename,firstname,lastname,confirmed,policyagreed,deleted,lang,theme,timezone,firstaccess,lastaccess,lastlogin,currentlogin,mailformat,maildigest,maildisplay,autosubscribe,trackforums,timecreated,timemodified,trustbitmask,password) VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?) [array ( 0 => 'd960231', 1 => '', 2 => 'asep.ahmad@unisba.ac.id', 3 => '', 4 => '', 5 => 'Universitas Islam Bandung', 6 => '', 7 => '', 8 => 'Bandung', 9 => 'ID', 10 => '114.125.117.106', 11 => '0', 12 => '', 13 => '1', 14 => NULL, 15 => 'manual', 16 => NULL, 17 => NULL, 18 => NULL, 19 => NULL, 20 => 'ASEP AHMAD SIDDIQ, DRS., M.SI.', 21 => '-', 22 => '1', 23 => 0, 24 => '0', 25 => 'en', 26 => '', 27 => 'Asia/Jayapura', 28 => '1663541692', 29 => '1688569506', 30 => '1688569499', 31 => '1688569506', 32 => '1', 33 => '0', 34 => '2', 35 => '1', 36 => '0', 37 => '1663226949', 38 => '1663338199', 39 => '0', 40 => 'restored', )] Error code: dmlwriteexception * line 489 of /lib/dml/moodle_database.php: dml_write_exception thrown * line 291 of /lib/dml/moodle_read_slave_trait.php: call to moodle_database->query_end() * line 1357 of /lib/dml/mysqli_native_moodle_database.php: call to mysqli_native_moodle_database->query_end() * line 1403 of /lib/dml/mysqli_native_moodle_database.php: call to mysqli_native_moodle_database->insert_record_raw() * line 1261 of /backup/util/dbops/restore_dbops.class.php: call to mysqli_native_moodle_database->insert_record() * line 1143 of /backup/moodle2/restore_stepslib.php: call to restore_dbops::create_included_users() * line 34 of /backup/util/plan/restore_execution_step.class.php: call to restore_create_included_users->define_execution() * line 181 of /backup/util/plan/base_task.class.php: call to restore_execution_step->execute() * line 191 of /backup/util/plan/base_plan.class.php: call to base_task->execute() * line 168 of /backup/util/plan/restore_plan.class.php: call to base_plan->execute() * line 408 of /backup/controller/restore_controller.class.php: call to restore_plan->execute() * line 198 of /home/ekuliahfk/moosh-1.11/Moosh/Command/Moodle39/Course/CourseRestore.php: call to restore_controller->execute_plan() * line 365 of /home/ekuliahfk/moosh-1.11/moosh.php: call to Moosh\Command\Moodle39\Course\CourseRestore->execute() !!! Error writing to database !!! Potential coding error - existing temptables found when disposing database. Must be dropped!
I hope there is an exit way to solve this problem.
===========================================================================
by Indra Abdurojak.