CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Upgrading CiviCRM (Moderator: Deepak Srivastava) »
  • error running update script from 2.0.2 to 2.1
Pages: [1]

Author Topic: error running update script from 2.0.2 to 2.1  (Read 2012 times)

myles

  • I post frequently
  • ***
  • Posts: 263
  • Karma: 11
error running update script from 2.0.2 to 2.1
September 19, 2008, 06:20:24 am
Hi, I'm doing a dry run of an upgrade on my local host prior to attempting it on the production server.

I've successfully upgrade drupal to 6.4 and my environment ticks all the boxes (php5.x, mysql5.x)

When I run the update script I get this error with these details:

DB Error: already exists

Database Error Code: Duplicate entry 'preferred_communication_method' for key 2, 1062

Details...

Array
(
    [callback] => Array
        (
           
  • => CRM_Core_Error
  • [1] => handle
            )

       
Code: [Select]
=> -5
    [message] => DB Error: already exists
    [mode] => 16
    [debug_info] => ALTER TABLE `civicrm_option_group`
    ADD UNIQUE `UI_name` (name) [nativecode=1062 ** Duplicate entry 'preferred_communication_method' for key 2]
    [type] => DB_Error
    [user_info] => ALTER TABLE `civicrm_option_group`
    ADD UNIQUE `UI_name` (name) [nativecode=1062 ** Duplicate entry 'preferred_communication_method' for key 2]
    [to_string] => [db_error: message="DB Error: already exists" code=-5 mode=callback callback=CRM_Core_Error::handle prefix="" info="ALTER TABLE `civicrm_option_group`
    ADD UNIQUE `UI_name` (name) [nativecode=1062 ** Duplicate entry 'preferred_communication_method' for key 2]"]
)

Deepak Srivastava

  • Moderator
  • Ask me questions
  • *****
  • Posts: 677
  • Karma: 65
Re: error running update script from 2.0.2 to 2.1
September 19, 2008, 07:12:46 am
The table 'civicrm_option_group' in your db somehow, looks to have duplicate entries for the name 'preferred_communication_method'.

Removing the duplicate entry should solve your problem. ( Make sure the one going to remain has related valid entries in civicrm_option_value table )
« Last Edit: September 19, 2008, 11:23:08 am by Deepak Srivastava »
Found this reply helpful? Contribute NOW and help us improve CiviCRM with the Make it Happen! initiative.

myles

  • I post frequently
  • ***
  • Posts: 263
  • Karma: 11
Re: error running update script from 2.0.2 to 2.1
September 19, 2008, 11:24:07 am
Thanks for the reply

What worries me about this is that there are three entries for each option group: one for each domain. These are not arbitrary duplications and all have corresponding entries in option_value.

Just for the sake of experimentation

First I removed the duplicated entries (though they are not actually duplications having different id's and domain id's)...

same result

Then

I deleted all communication preferences entries and started again....

Now the error is with activity type, which of course is the next entry in the table.

Should I drop the table, or delete all entries?

I'll experiment later tonight or tomorrow (daughter's birthday meal this evening)

PS for anyone else experimenting you have to reinstate the old database since otherwise the upgrade is partial and leaves the database corrupted.

Deepak Srivastava

  • Moderator
  • Ask me questions
  • *****
  • Posts: 677
  • Karma: 65
Re: error running update script from 2.0.2 to 2.1
September 19, 2008, 12:20:55 pm
Quote
Should I drop the table, or delete all entries?
Nope, you would lose /mess-up your data since there might be groups used for custom-group-options, price set options ..etc.
Also upgrade script would not re-fill those entries.

So recommended method is drop duplicates manually (by duplicate i mean rows /w duplicate values for column 'name').
« Last Edit: September 19, 2008, 01:14:20 pm by Deepak Srivastava »
Found this reply helpful? Contribute NOW and help us improve CiviCRM with the Make it Happen! initiative.

myles

  • I post frequently
  • ***
  • Posts: 263
  • Karma: 11
Re: error running update script from 2.0.2 to 2.1
September 19, 2008, 05:00:08 pm
OK thanks. I'll give that a go. That's ok for me for testing purposes, but on the production site it gives me a problem since at least two domains (sites) are going to get stuffed.

What are other people with more that one site running off the same code base doing?


Deepak Srivastava

  • Moderator
  • Ask me questions
  • *****
  • Posts: 677
  • Karma: 65
Re: error running update script from 2.0.2 to 2.1
September 19, 2008, 10:21:36 pm
CiviCRM v2.1 anyway doesn't support multi-domain feature. Check http://civicrm.org/node/352.
Found this reply helpful? Contribute NOW and help us improve CiviCRM with the Make it Happen! initiative.

myles

  • I post frequently
  • ***
  • Posts: 263
  • Karma: 11
Re: error running update script from 2.0.2 to 2.1
September 20, 2008, 03:34:06 am
Does anyone have smart ways of migrating from multiple domains to multiple databases?

myles

  • I post frequently
  • ***
  • Posts: 263
  • Karma: 11
Re: error running update script from 2.0.2 to 2.1
September 20, 2008, 06:35:49 am
Thanks Deepak - multidomains are the problem - I've deleted all but one domain and renamed that domain to domain 1, changed the settings file and upgrade script has run successfully.

Now I'll have to dump the database, create a new one and point the domain to it; and repeat for all domains. Bit of a hassle, but it seems to work.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Upgrading CiviCRM (Moderator: Deepak Srivastava) »
  • error running update script from 2.0.2 to 2.1

This forum was archived on 2017-11-26.