Upgrade error 3.1.0 to 3.1.1: Rebuild database fault...

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Etic
    Junior Member
    • Jan 2015
    • 9

    #1

    Upgrade error 3.1.0 to 3.1.1: Rebuild database fault...

    Hi, I have an error when attempting to upgrade from 3.1.0 to 3.1.1...

    I was with version 3.0.1, did the patch before upgrade, then upgraded 3.0.1 to 3.1.0; I needed to execute rebuild.php to make it works again.
    But now I'm stuck with a PDO exception:

    Espo.ALERT: Rebuild database fault: exception 'PDOException' with message 'SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry...

    What can I do to resolve those exceptions?

    Thanks!
  • yuri
    EspoCRM product developer
    • Mar 2014
    • 9621

    #2
    Hi

    You need to find duplicate records in db and remove them. It caused because we added unique keys to relationship tables. Maybe you did some manual import before.

    Comment

    • Etic
      Junior Member
      • Jan 2015
      • 9

      #3
      I didn't import manually but maybe it is related with duplicated relation... I'll check in the DB. Is there a way to scan the database for that before doing the upgrade?

      Thanks again Yuri, EspoCRM is awesome!!!

      Comment

      • yuri
        EspoCRM product developer
        • Mar 2014
        • 9621

        #4
        You can run query that checks for duplicates. Run them only upon relationship tables like account_contact, entity_email_address.

        If your engine is MyIsam you can create unique index with ignore parameter that will remove all duplicates.
        ALTER IGNORE TABLE ... ADD UNIQUE INDEX ....

        Comment

        Working...