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) »
  • Foreign key problem: need advice on solution
Pages: [1]

Author Topic: Foreign key problem: need advice on solution  (Read 2477 times)

brunodbo

  • I’m new here
  • *
  • Posts: 8
  • Karma: 0
Foreign key problem: need advice on solution
May 18, 2007, 07:52:11 am
I was also experiencing a foreign key problem, pretty much like http://forum.civicrm.org/index.php/topic,96.0.html . My problem was occuring when importing the 1.6 data (after running the upgrade script) into a 1.7 db, having installed its tables using the civicrm_41.mysql script. The import of the dumpfile didn't work because of the foreign key error on the civicrm_address table:

Code: [Select]
|#1452 - Cannot add or update a child row: a foreign key constraint fails (`db/civicrm_address`, CONSTRAINT `FK_civicrm_address_location_id` FOREIGN KEY (`location_id`) REFERENCES `civicrm_location` (`id`)) |

I applied the fix described in the mentioned forum post (http://forum.civicrm.org/index.php/topic,96.0.html):

- instead of dumping just the 1.6 data after running the upgrade script, dumping structure + data
- importing the dump

Like this, my civicrm 1.7 install works fine so far. I'm asking myself though if this is a good way to do it, since I didn't install 1.7 from scratch. Does it make a difference whether I install the 1.7 db scheme or run the upgraded 1.6 one?

Thank you.

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: Foreign key problem: need advice on solution
May 18, 2007, 11:18:42 pm

Just to be sure you have the right schema, you might want to do a structure dump only and make sure it matches the civicrm_41.mysql schema from a v1.7 distribution

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

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Upgrading CiviCRM (Moderator: Deepak Srivastava) »
  • Foreign key problem: need advice on solution

This forum was archived on 2017-11-26.