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) »
  • ALTER TABLE error on DB upgrade from 4.3.5 to 4.5.4
Pages: [1]

Author Topic: ALTER TABLE error on DB upgrade from 4.3.5 to 4.5.4  (Read 395 times)

dwfriederichs

  • I post occasionally
  • **
  • Posts: 56
  • Karma: 1
ALTER TABLE error on DB upgrade from 4.3.5 to 4.5.4
December 17, 2014, 08:11:01 am
I'm upgrading a test version of my CiviCRM from 4.3.5 to 4.5.4 and am running into database errors when it reaches the 4.4 alpha1 upgrade step.  It looks like it's temporarily trying to rename the CiviCRM activity table while it builds a new table with the old name, presumably so it can load the existing data into the new table.

The exact error message is: "ALTER TABLE civicrm_activity DROP FOREIGN KEY FK_civicrm_activity_source_contact_id [nativecode=1025 ** Error on rename of './C168529_CareerEp_Dev/civicrm_activity' to './C168529_CareerEp_Dev/#sql2-6327-403b87e' (errno: 152)]"

I've also attached a screenshot with the complete error.  Can anyone offer advice on how to resolve this error?

dwfriederichs

  • I post occasionally
  • **
  • Posts: 56
  • Karma: 1
Re: ALTER TABLE error on DB upgrade from 4.3.5 to 4.5.4
December 28, 2014, 02:21:11 pm
Posting again in hopes that someone can point me in the right direction on this question.

I realize that this board is a volunteer effort, so if this is a bigger problem than can be addressed through this forum, would appreciate a referral to a CiviCRM services group who could help me.

Thanks!

Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: ALTER TABLE error on DB upgrade from 4.3.5 to 4.5.4
December 29, 2014, 05:33:23 am
The SQL that's failing is:

Code: [Select]
ALTER TABLE civicrm_activity DROP FOREIGN KEY FK_civicrm_activity_source_contact_id
Could be that your civicrm_activity table lacks the key called FK_civicrm_activity_source_contact_id. Can you check on that? If it does, then you can either:

1. Create any old key with that name so that the upgrader can then drop it.
2. Find that SQL code in the upgrader code and remove it.
CiviHosting and CiviOnline -- The CiviCRM hosting experts, since 2007

See here for the official: What to do if you think you've found a bug.

dwfriederichs

  • I post occasionally
  • **
  • Posts: 56
  • Karma: 1
Re: ALTER TABLE error on DB upgrade from 4.3.5 to 4.5.4
December 29, 2014, 07:31:53 pm
Thanks Hershel, that did it.  There were two more foreign key issues but I got through them with the same process.

Thanks again for your help!

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Upgrading CiviCRM (Moderator: Deepak Srivastava) »
  • ALTER TABLE error on DB upgrade from 4.3.5 to 4.5.4

This forum was archived on 2017-11-26.