moosh icon indicating copy to clipboard operation
moosh copied to clipboard

Restoring a course backup does not restore the question bank with --overwrite option

Open Badatos opened this issue 2 years ago • 1 comments

  • moosh version: 1.14
  • moodle version: 4.2.2
    • database: Postgres
  • php version: 8.0
  • operating system: Ubuntu 22.04.3 LTS

Actual behaviour

When we use MOOSH to restore a course backup with --overwrite option , it does not restore the question bank, it just delete all the questions. nb: If we use the same command to restore the backup a 2nd time (or on a course with no question bank), it works well.

Expected behaviour

The course-restore --overwrite command must overwrite the question bank.

Steps to reproduce

  1. Export a course backup with a question bank containing at least 2 questions
  2. Modify the questions
  3. Restore the backup with this command: course-restore --overwrite -e course.mbz [COURSE_ID]

Badatos avatar Sep 11 '23 12:09 Badatos

For the record, I just tested the same manipulation directly inside Moodle (Restore the same course backup on the course already containing a question bank), and Moodle worked as expected. The problem really comes from Moosh.

Badatos avatar Sep 11 '23 13:09 Badatos