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) »
  • 1.6 > 1.7 database upgrade
Pages: [1]

Author Topic: 1.6 > 1.7 database upgrade  (Read 4280 times)

Neil Adair

  • I post occasionally
  • **
  • Posts: 78
  • Karma: 4
  • CiviCRM version: 4.5.8
  • CMS version: Drupal 7
  • MySQL version: MariaDB 10
  • PHP version: 5.5 FPM
1.6 > 1.7 database upgrade
August 06, 2007, 11:57:45 am
Current CiviCRM 1.6 8703 Drupal 5 php5
Testing the upgrade to 1.7

When I run the civicrm_upgradedb_v1.6_v1.7_41.mysql script I get the following error:

ERROR 1050 (42S01) at line 12: Table 'civicrm_event' already exists

There are indeed civicrm_event and civicrm_event_page tables. I can drop the civicrm_event_page table but I get a foreign key constraint error when I try to drop civicrm_event.

mysql> drop table civicrm_event;
ERROR 1217 (23000): Cannot delete or update a parent row: a foreign key constraint fails

I thought CiviEvent was introduced in 1.7. Why do I have tables for it in 1.6?

In the upgrade procedure the database dump and reload step now seems to be between 1.7 and 1.8 whereas before (before 1.8 beta) it was between 1.6 and 1.7. Is this correct?

Neil

Kurund Jalmi

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4169
  • Karma: 128
    • CiviCRM
  • CiviCRM version: 4.x, future
  • CMS version: Drupal 7, Joomla 3.x
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: 1.6 > 1.7 database upgrade
August 06, 2007, 12:23:46 pm
Neil:

Yes you are right CiviEvent was introduced in v1.7.  Can you restore your db to CiviCRM v1.6 and try upgrading.
In case upgrade fails, you should always restore to previous stable db state.

kurund
Found this reply helpful? Support CiviCRM

Neil Adair

  • I post occasionally
  • **
  • Posts: 78
  • Karma: 4
  • CiviCRM version: 4.5.8
  • CMS version: Drupal 7
  • MySQL version: MariaDB 10
  • PHP version: 5.5 FPM
Re: 1.6 > 1.7 database upgrade
August 06, 2007, 12:35:03 pm
Can you restore your db to CiviCRM v1.6 and try upgrading

Yes, but I can't get rid of the civicrm_event table which is in my 1.6 db. This was originally 1.6.8517 upgraded to 1.6.8703.

Kurund Jalmi

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4169
  • Karma: 128
    • CiviCRM
  • CiviCRM version: 4.x, future
  • CMS version: Drupal 7, Joomla 3.x
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: 1.6 > 1.7 database upgrade
August 06, 2007, 01:07:53 pm
Neil:

I upgraded using civicrm_upgradedb_v1.6_v1.7_41.mysql  from v1.6 to v1.7 without any problem.
CiviCRM 1.6 has 86 tables (there is no civicrm_event table ) compare to 91 tables in CiviCRM v1.7. 

I suspect your upgrade must have failed hence some table were created.
Check your db for have civicrm_participant table, delete that first before deleting civicrm_event.

HTH

kurund
Found this reply helpful? Support CiviCRM

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: 1.6 > 1.7 database upgrade
August 06, 2007, 02:25:44 pm

Neil:

most likely your 1.6 db is not really a 1.6 db but a 1.7 db or in some wierd state in bteween. CiviEvent tables are not present in the 1.6 sql (i just checked)

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

Neil Adair

  • I post occasionally
  • **
  • Posts: 78
  • Karma: 4
  • CiviCRM version: 4.5.8
  • CMS version: Drupal 7
  • MySQL version: MariaDB 10
  • PHP version: 5.5 FPM
Re: 1.6 > 1.7 database upgrade
August 06, 2007, 06:58:19 pm
Yes, I figured out they were from an earlier attempt, dropped the db and recreated.
Everything goes well until I import the data after dumping and reloading the database.

I get this error during the import
ERROR 1062 (23000) at line 103: Duplicate entry '812299607' for key 2

And I get the familiar non-recoverable error caused by a foreign key constraint failure. It's our webadmin email address!

I went looking and there are 3 Individuals in our db with that email, one is correct. I have no idea how the others came to have it but have cleared them. I'll try again with tonights backup tomorrow.

Thanks

fen

  • I post frequently
  • ***
  • Posts: 216
  • Karma: 13
    • CivicActions
  • CiviCRM version: 3.3-4.3
  • CMS version: Drupal 6/7
  • MySQL version: 5.1/5.5
  • PHP version: 5.3/5.4
Re: 1.6 > 1.7 database upgrade
August 16, 2007, 07:07:13 pm
I've got a similar problem, it seems: upgrading from 1.6 > 1.7:

When I try to load the dumped data from the upgraded 1.6 DB into the clean 1.7 structure, I get:

Code: [Select]
ERROR 1062 (23000) at line 117: Duplicate entry '1' for key 2
Line 117 is

Code: [Select]
INSERT INTO `civicrm_contact` (`id`, `domain_id`, `contact_type`, ...
Is this a foreign key problem?  (I seem to remember having a similar problem some time ago with the solution being to turn off a foreign key check on import, but I'm not sure.  I'll continue trying things and will report back if I find anything useful.)

Thanks.

Piotr Szotkowski

  • I live on this forum
  • *****
  • Posts: 1497
  • Karma: 57
Re: 1.6 > 1.7 database upgrade
August 16, 2007, 09:46:05 pm
Quote from: fen on August 16, 2007, 07:07:13 pm
When I try to load the dumped data from the upgraded 1.6 DB into the clean 1.7 structure, I get:

Code: [Select]
ERROR 1062 (23000) at line 117: Duplicate entry '1' for key 2
Line 117 is

Code: [Select]
INSERT INTO `civicrm_contact` (`id`, `domain_id`, `contact_type`, ...

My guess is that either you’re trying to load the data into something more than just the structure or the dumped data is inconsistent – i.e., contains two civicrm_contact entries with the same value of 1 for either the external_identifier column or the id column.

Quote from: fen on August 16, 2007, 07:07:13 pm
Is this a foreign key problem?

The error suggests the dump (or the attempt to load it, but more probably the dump in itself) breaks a UNIQUE key, so first check whether you don’t have two contacts with external_identifier of 1 in the dumped civicrm_contact table.
If you found the above helpful, please consider helping us in return – you can even steer CiviCRM’s future and help us extend CiviCRM in ways useful to you.

fen

  • I post frequently
  • ***
  • Posts: 216
  • Karma: 13
    • CivicActions
  • CiviCRM version: 3.3-4.3
  • CMS version: Drupal 6/7
  • MySQL version: 5.1/5.5
  • PHP version: 5.3/5.4
Re: 1.6 > 1.7 database upgrade
August 17, 2007, 11:29:37 am
Thanks, Piotr - that appears to be it.  There are 15 sets of civicrm_contact reciords that have duplicate external_identifier values.

I'm editing them manually, but I wonder: might this column be a bit like the civicrm_uf_match table in that it could be NULLed out and it would re-create if/when necessary?

Thanks again!

Piotr Szotkowski

  • I live on this forum
  • *****
  • Posts: 1497
  • Karma: 57
Re: 1.6 > 1.7 database upgrade
August 17, 2007, 02:25:28 pm
I’m pretty sure that this column is for holding contact identifiers when the contacts are imported from some external source (like another CRM or some set of data) and there’s a need to keep the key they were identified in that other system for some reason.

I’m not quite sure on how would you recreate this data once it’s NULLed out…
If you found the above helpful, please consider helping us in return – you can even steer CiviCRM’s future and help us extend CiviCRM in ways useful to you.

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: 1.6 > 1.7 database upgrade
August 17, 2007, 02:31:00 pm
Quote from: fen on August 17, 2007, 11:29:37 am
Thanks, Piotr - that appears to be it.  There are 15 sets of civicrm_contact reciords that have duplicate external_identifier values.

I'm editing them manually, but I wonder: might this column be a bit like the civicrm_uf_match table in that it could be NULLed out and it would re-create if/when necessary?

Thanks again!

Hi Fen - That field is never "auto-populated" or calculated by the software. As Piotr mentioned, it is intended to store a reference unique key from a source / related / legacy application. It is populated explicitly via Import or screen input. It is available as one of the alternative methods of matching importing transaction data to existing contacts (e.g. Import Contributions) - hence it is set up as a UNIQUE column. Hope that helps...
Protect your investment in CiviCRM by  becoming a Member!

fen

  • I post frequently
  • ***
  • Posts: 216
  • Karma: 13
    • CivicActions
  • CiviCRM version: 3.3-4.3
  • CMS version: Drupal 6/7
  • MySQL version: 5.1/5.5
  • PHP version: 5.3/5.4
Re: 1.6 > 1.7 database upgrade
August 19, 2007, 12:14:59 pm
Thanks for all the replies and help.  I'm now happily running v1.8 stable!  :)

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Upgrading CiviCRM (Moderator: Deepak Srivastava) »
  • 1.6 > 1.7 database upgrade

This forum was archived on 2017-11-26.