Getting DB transaction error while trying to restore courses from one portal to another portal

Getting DB transaction error while trying to restore courses from one portal to another portal

by Karan Rawat -
Number of replies: 2

Database transaction aborted automatically in /var/www/html/admin/tool/brcli/restore.php

Default exception handler: Error writing to database Debug: Duplicate entry '0-ae17d201' 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(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)

Error code: dmlwriteexception !!
!! Stack trace: * line 489 of /lib/dml/moodle_database.php: dml_write_exception thrown
* line 1357 of /lib/dml/mysqli_native_moodle_database.php: call to moodle_database->query_end()
* line 1403 of /lib/dml/mysqli_native_moodle_database.php: call to mysqli_native_moodle_database->insert_record_raw()
* line 1266 of /backup/util/dbops/restore_dbops.class.php: call to mysqli_native_moodle_database->insert_record()
* line 1145 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 394 of /backup/controller/restore_controller.class.php: call to restore_plan->execute()
* line 81 of /admin/tool/brcli/restore.php: call to restore_controller->execute_plan()
 !!
Potential coding error - existing temptables found when disposing database. Must be dropped!
Error in Rollno: ae17d201

Average of ratings: -
In reply to Karan Rawat

Getting DB transaction error while trying to restore courses from one portal to another portal

by Ken Task -
Picture of Particularly helpful Moodlers

What version of Moodle are you using?

Your txt file attached shows an admin/tool/brcli tool.

which is an addon ...

https://moodle.org/plugins/tool_brcli/versions

compat up to version 4.1 of Moodle.

In 4.1.highest and higher versions of moodle, there is a restore_backup.php script in code/admin/cli/

'SoS', Ken

In reply to Ken Task

Getting DB transaction error while trying to restore courses from one portal to another portal

by Karan Rawat -

Hello Ken,


I'm using Moodle 4.0. I'm getting the same error while restoring through admin/cli/restore_backup.php

As i can check  this is calling a method in restore_dbops.class.php file called create_included_users. but i little bit confuse why it is creating user if it is already created.



Thanks