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

upgrade from Moodle 1.8.4 - .9.15 to 2.1.3 results in error: could not create unique index "mdl_userpref_usenam_uix"

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not a bug
    • Icon: Minor Minor
    • None
    • 1.9.15, 2.1.3
    • Installation
    • None
    • Upgrade from Moodle 1.9.14 to 2.0.5
    • PostgreSQL
    • MOODLE_19_STABLE, MOODLE_21_STABLE
    • Hide

      Worked on this test with ESX 4.1 Server with Virtaul Machine of SuSE 11.4, moodle - moodledata copied from production site then upgrade was first done on the working Moodle 1.8.4 to upgrade 1.9.14, to remove duplicates I tried this patch file from tracker http://tracker.moodle.org/browse/MDL-15726 but not sure I did right on the instructions.
      I understand the postgresql tables may be in a mess, but need a way to move this site on to Moodle 2.0 - 2.1 then create new Moodle Site of 2.1 then backup and restore. Tried backup and restore from 1.9.14 to Clean Install of Moodle 2.1 but no user data shows only course, exported users via CVS file.

      Show
      Worked on this test with ESX 4.1 Server with Virtaul Machine of SuSE 11.4, moodle - moodledata copied from production site then upgrade was first done on the working Moodle 1.8.4 to upgrade 1.9.14, to remove duplicates I tried this patch file from tracker http://tracker.moodle.org/browse/MDL-15726 but not sure I did right on the instructions. I understand the postgresql tables may be in a mess, but need a way to move this site on to Moodle 2.0 - 2.1 then create new Moodle Site of 2.1 then backup and restore. Tried backup and restore from 1.9.14 to Clean Install of Moodle 2.1 but no user data shows only course, exported users via CVS file.

      I managed to clear duplicated user account from mdle_user table,
      moodle=>
      moodle=> select username,
      moodle-> count(username) AS instances
      moodle-> from mdl_user
      moodle-> group by username
      moodle-> having (count(username) > 1);
      username | instances
      ------------------------------------------------+----------
      f.sirname66@student.domainxxx.com.1225454661 | 2
      (1 row)

      After removing this duplicated name the install moves on with Moodle 2.0.5, then stops with the error below, need some help to resolve. This Moodle Site has moved from 1.5.3 changed to unicode for 1.8.4 then upgrade to 1.9.14+ works with Moodle 1.9.14+ but when trying to upgrade to Moodle 2.0.5+ it stops with this.

      Debug info: ERROR: could not create unique index "mdl_userpref_usenam_uix"
      DETAIL: Key (userid, name)=(0, forum_displaymode) is duplicated.
      CREATE UNIQUE INDEX mdl_userpref_usenam_uix ON mdl_user_preferences (userid, name)
      Stack trace:
       
          line 400 of /lib/dml/moodle_database.php: ddl_change_structure_exception thrown
          line 232 of /lib/dml/pgsql_native_moodle_database.php: call to moodle_database->query_end()
          line 573 of /lib/dml/pgsql_native_moodle_database.php: call to pgsql_native_moodle_database->query_end()
          line 88 of /lib/ddl/database_manager.php: call to pgsql_native_moodle_database->change_database_structure()
          line 75 of /lib/ddl/database_manager.php: call to database_manager->execute_sql()
          line 892 of /lib/ddl/database_manager.php: call to database_manager->execute_sql_arr()
          line 5437 of /lib/db/upgrade.php: call to database_manager->add_inde)
          line 1423 of /lib/upgradelib.php: call to xmldb_main_upgrade()
          line 277 of /admin/index.php: call to upgrade_core()

      What can I do next to get past this error.

            stronk7 Eloy Lafuente (stronk7)
            gpouser gpouser
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.