Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-17970

Question backup does not work on MSSQL

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.9.3
    • 1.9.4
    • Questions
    • None
    • MOODLE_19_STABLE
    • MOODLE_19_STABLE

    Description

      First reported by Luis de Vasconcelos in http://moodle.org/mod/forum/discuss.php?d=114294:

      Notice: The data types ntext and nvarchar are incompatible in the equal to operator.

      Followed by:

      INSERT INTO mdl_backup_ids (backup_code, table_name, old_id, info) SELECT '1232364873', 'question', q.id, '' FROM mdl_question q, mdl_backup_ids bk WHERE q.category = bk.old_id AND bk.table_name = 'question_categories' AND bk.info = 'course' AND bk.backup_code = '1232364873'

      line 103 of lib\dmllib.php: call to debugging()
      line 461 of question\backuplib.php: call to execute_sql()
      line 445 of question\backuplib.php: call to question_insert_q_ids()
      line 49 of mod\quiz\backuplib.php: call to question_insert_c_and_q_ids_for_course()
      line 501 of mod\quiz\backuplib.php: call to quiz_insert_category_and_question_ids()
      line 179 of in C:\Moodle\lib\weblib.php on line 6923

      When I created the backup I selected just the following options on the backup screen (\backup\backup.php):

      Include:

      • Quizzes
      • Certificates

      Users: None
      Logs: No
      User Files: No
      Course files: Yes
      Site files used in this course: Yes
      Grade histories: No

      I don't want, and am not including, any user data in the backup.

      Both instances of Moodle are on the same server and are running Moodle 1.9.3+ Build 20081112 (2007101531)

      Is there a solution to the above error so that I can restore the Courses with all the quiz questions?

      I had a look at the moodle.xml file in the course backup file and it does not contain any of the quiz questions.

      Also, I was able to export the questions from MoodleDev1 to a GIFT file and then import the GIFT file into the quiz on MoodleDev2, but that isn't the ideal solution. Is there a way to get around the above data types error?

      Server config:
      Windows Server 2003 SP2 Std Edition
      IIS 6 (6.0.3790.3959)
      PHP 5.2.6 (Non Thread Safe)
      FastCGI from Microsoft
      FreeTDS 5.2.9.9 (the NTS version built by Trevor Johnson, MDL-14725)
      MS SQL Server 2005 SP2 Std Edition (9.00.1399.00)

      Modules:
      Certificate Module
      Certificate - Site Wide Report (080513)

      Attachments

        Activity

          People

            timhunt Tim Hunt
            timhunt Tim Hunt
            Safat Shahin, Tim Hunt, Ilya Tregubov, Kevin Percy, Mathew May, Mihail Geshoski, Shamim Rezaie
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              28/Jan/09