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) »
  • Upgrading 2.1.4 to 2.2.7 with Drupal
Pages: [1]

Author Topic: Upgrading 2.1.4 to 2.2.7 with Drupal  (Read 1034 times)

toddchris

  • Guest
Upgrading 2.1.4 to 2.2.7 with Drupal
August 05, 2009, 12:06:00 pm
Hello there,

I'm having a problem upgrading from 2.1.4 to 2.2.7.  I get the foreign key errors, so I've been trying to follow the ensuring schema integriy on upgrades instructions. http://forum.civicrm.org/index.php/topic,4259.msg21599.html#msg21599  Here's what I'm doing.

1. I create the database structure for 2.1.4 from the civicrm.sql file in version 2.1.4.  This gives me and empty database of 112 tables.

2.  I then export the data in my current database, minus the two custom tables I have.


When I import the data into the database I get the following error.


#1452 - Cannot add or update a child row: a foreign key constraint fails (`mynlada_civicrm214/civicrm_acl_cache`, CONSTRAINT `FK_civicrm_acl_cache_contact_id` FOREIGN KEY (`contact_id`) REFERENCES `civicrm_contact` (`id`) ON DELETE CASCADE)

It seems no matter what I try I get some time of foreign key error?  Can anyone tell me what I'm doing wrong?  I've avoided upgrading to 2.2 because of this, and I really need to finally get it taken care of.

Thanks,
TC
 

toddchris

  • Guest
Re: Upgrading 2.1.4 to 2.2.7 with Drupal
August 05, 2009, 02:41:33 pm
I thought I'd include the error I get just by running the upgrade script.  This error of course let me to the other things that I have tried.  I just can't seem to find the correct path.


Code: [Select]
Sorry. A non-recoverable error has occurred.


--------------------------------------------------------------------------------

DB Error: a515ac9c2796ca0e23adbe92c68fc9fc

Database Error Code: Error on rename of './mynladat_civicrm/civicrm_participant' to './mynladat_civicrm/#sql2-a11-13c3e' (errno: 152), 1025

Return to home page.

Error Details:


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

    [code] => a515ac9c2796ca0e23adbe92c68fc9fc
    [message] => DB Error: a515ac9c2796ca0e23adbe92c68fc9fc
    [mode] => 16
    [debug_info] => ALTER TABLE `civicrm_participant`
   DROP FOREIGN KEY `FK_civicrm_participant_registered_by_id` [nativecode=1025 ** Error on rename of './mynladat_civicrm/civicrm_participant' to './mynladat_civicrm/#sql2-a11-13c3e' (errno: 152)]
    [type] => DB_Error
    [user_info] => ALTER TABLE `civicrm_participant`
   DROP FOREIGN KEY `FK_civicrm_participant_registered_by_id` [nativecode=1025 ** Error on rename of './mynladat_civicrm/civicrm_participant' to './mynladat_civicrm/#sql2-a11-13c3e' (errno: 152)]
    [to_string] => [db_error: message="DB Error: a515ac9c2796ca0e23adbe92c68fc9fc" code=0 mode=callback callback=CRM_Core_Error::handle prefix="" info="ALTER TABLE `civicrm_participant`
   DROP FOREIGN KEY `FK_civicrm_participant_registered_by_id` [nativecode=1025 ** Error on rename of './mynladat_civicrm/civicrm_participant' to './mynladat_civicrm/#sql2-a11-13c3e' (errno: 152)]"]
)
[/code]

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: Upgrading 2.1.4 to 2.2.7 with Drupal
August 05, 2009, 05:33:47 pm
Try adding this statement at the top of your DB dump file before loading it:

Code: [Select]
SET FOREIGN_KEY_CHECKS = 0;
... and add this at the bottom of the file

Code: [Select]
SET FOREIGN_KEY_CHECKS = 1;
Protect your investment in CiviCRM by  becoming a Member!

toddchris

  • Guest
Re: Upgrading 2.1.4 to 2.2.7 with Drupal
August 05, 2009, 11:42:12 pm
Dave,

This worked perfectly!!!  You're a genius.  Thanks so much.

TC

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Upgrading CiviCRM (Moderator: Deepak Srivastava) »
  • Upgrading 2.1.4 to 2.2.7 with Drupal

This forum was archived on 2017-11-26.