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) »
  • Unknown DB error while upgrading from 4.4 to 4.5
Pages: [1]

Author Topic: Unknown DB error while upgrading from 4.4 to 4.5  (Read 520 times)

liblogger

  • I’m new here
  • *
  • Posts: 19
  • Karma: 0
  • CiviCRM version: 4.3.5
  • CMS version: Drupal 7.23
  • MySQL version: 5.0.7
  • PHP version: 5.3.5
Unknown DB error while upgrading from 4.4 to 4.5
November 05, 2014, 06:28:03 am
Hi there,

I've been trying to upgrade from 4.4 to 4.5 (initially from 4.4.4 to 4.5.2, but I got the same error when going incrementally, with the error occuring between 4.4.9 and 4.5.0), and it fails when trying to upgrade the database to 4.5.alpha1:

[Error: Upgrade DB to 4.5.alpha1: SQL]

Error Field    Error Value
Type    DB_Error
Code   -1
Message   DB Error: unknown error
Mode   16
UserInfo   ALTER TABLE civicrm_contribution DROP FOREIGN KEY `FK_civicrm_contribution_honor_contact_id` [nativecode=1025 ** Error on rename of '.\twitch\civicrm_contribution' to '.\twitch\#sql2-1020-117' (errno: 152)]
DebugInfo   ALTER TABLE civicrm_contribution DROP FOREIGN KEY `FK_civicrm_contribution_honor_contact_id` [nativecode=1025 ** Error on rename of '.\twitch\civicrm_contribution' to '.\twitch\#sql2-1020-117' (errno: 152)]
PEAR_Exception: DB Error: unknown error in unknown on line unknown
- DB_Error: DB Error: unknown error in unknown on line unknown

Exception trace
#   Function   Location
0   CRM_Core_Error::exceptionHandler(Object(DB_Error))   unknown:unknown
1   call_user_func(Array, Object(DB_Error))   C:\xampp\htdocs\switch\sites\all\modules\civicrm\packages\PEAR.php:931
2   PEAR_Error->PEAR_Error('DB Error: unknow…', -1, 16, Array, 'ALTER TABLE civi…')   C:\xampp\htdocs\switch\sites\all\modules\civicrm\packages\DB.php:975
3   DB_Error->DB_Error(-1, 16, Array, 'ALTER TABLE civi…')   C:\xampp\htdocs\switch\sites\all\modules\civicrm\packages\PEAR.php:564
4   PEAR->raiseError(null, -1, null, null, 'ALTER TABLE civi…', 'DB_Error', true)   C:\xampp\htdocs\switch\sites\all\modules\civicrm\packages\DB\common.php:1905
5   DB_common->raiseError(-1, null, null, null, '1025 ** Error on…')   C:\xampp\htdocs\switch\sites\all\modules\civicrm\packages\DB\mysql.php:899
6   DB_mysql->mysqlRaiseError()   C:\xampp\htdocs\switch\sites\all\modules\civicrm\packages\DB\mysql.php:328
7   DB_mysql->simpleQuery('ALTER TABLE civi…')   C:\xampp\htdocs\switch\sites\all\modules\civicrm\packages\DB\common.php:1216
8   DB_common->query('ALTER TABLE civi…')   C:\xampp\htdocs\switch\sites\all\modules\civicrm\CRM\Utils\File.php:303
9   CRM_Utils_File::sourceSQLFile('mysql://root:1ns…', ' SELECT @wo…', null, true)   C:\xampp\htdocs\switch\sites\all\modules\civicrm\CRM\Upgrade\Form.php:205
10   CRM_Upgrade_Form->source(' SELECT @wo…', true)   C:\xampp\htdocs\switch\sites\all\modules\civicrm\CRM\Upgrade\Form.php:405
11   CRM_Upgrade_Form->processLocales('C:\xampp\htdocs\…', '4.5.alpha1')   C:\xampp\htdocs\switch\sites\all\modules\civicrm\CRM\Upgrade\Form.php:437
12   CRM_Upgrade_Form->processSQL('4.5.alpha1')   C:\xampp\htdocs\switch\sites\all\modules\civicrm\CRM\Upgrade\Incremental\php\FourFive.php:307
13   CRM_Upgrade_Incremental_php_FourFive::task_4_5_x_runSql(Object(CRM_Queue_TaskContext), '4.5.alpha1')   unknown:unknown
14   call_user_func_array(Array, Array)   C:\xampp\htdocs\switch\sites\all\modules\civicrm\CRM\Queue\Task.php:82
15   CRM_Queue_Task->run(Object(CRM_Queue_TaskContext))   C:\xampp\htdocs\switch\sites\all\modules\civicrm\CRM\Queue\Runner.php:189
16   CRM_Queue_Runner->runNext(true)   C:\xampp\htdocs\switch\sites\all\modules\civicrm\CRM\Queue\Page\AJAX.php:48
17   {closure}()   C:\xampp\htdocs\switch\sites\all\modules\civicrm\CRM\Queue\ErrorPolicy.php:89
18   CRM_Queue_ErrorPolicy->call(Object(Closure))   C:\xampp\htdocs\switch\sites\all\modules\civicrm\CRM\Queue\Page\AJAX.php:51
19   CRM_Queue_Page_AJAX::runNext()   unknown:unknown
20   call_user_func(Array)   C:\xampp\htdocs\switch\sites\all\modules\civicrm\CRM\Core\Invoke.php:296
21   CRM_Core_Invoke::runItem(Array)   C:\xampp\htdocs\switch\sites\all\modules\civicrm\CRM\Core\Invoke.php:75
22   CRM_Core_Invoke::_invoke(Array)   C:\xampp\htdocs\switch\sites\all\modules\civicrm\CRM\Core\Invoke.php:52
23   CRM_Core_Invoke::invoke(Array)   C:\xampp\htdocs\switch\sites\all\modules\civicrm\drupal\civicrm.module:457
24   civicrm_invoke('upgrade', 'queue', 'ajax', 'runNext')   unknown:unknown
25   call_user_func_array('civicrm_invoke', Array)   C:\xampp\htdocs\switch\includes\menu.inc:517
26   menu_execute_active_handler()   C:\xampp\htdocs\switch\index.php:21
27   {main}


I think I'm right in saying that there was a change in the way that CiviCRM deals with way the honoree is recorded? So in 4.4 the 'in honor of' information is a separate field, while in 4.5 it's a soft credit?

(I tried using the instructions here: http://wiki.civicrm.org/confluence/display/CRMDOC/Ensuring+Schema+Integrity+on+Upgrades  to create a new database for 4.5.2, but it gets stuck when I try to import the data from the original database because the contributions table is missing columns for the honor_contact_id and honor_type_id)

I'm pretty sure that this is the same problem mentioned in this forum thread: http://forum.civicrm.org/index.php?topic=34209.0 - but I'm wary of trying the workaround used there, because it seems like I'd lose the honoree information. Or at the very least I'd have to manually copy all the honoree info into the soft credit columns/table, and I have no idea what else I might be missing...


liblogger

  • I’m new here
  • *
  • Posts: 19
  • Karma: 0
  • CiviCRM version: 4.3.5
  • CMS version: Drupal 7.23
  • MySQL version: 5.0.7
  • PHP version: 5.3.5
Re: Unknown DB error while upgrading from 4.4 to 4.5
November 05, 2014, 07:52:00 am
Wait, nevermind - the one thing I didn't try was setting up a new database for the 4.4.x version. Doing that seems to have fixed the upgrade problem. (Which, yes, obviously trying to import data from one version into the structure of another wasn't going to work, which is why I shouldn't be allowed near databases after 5pm)

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Upgrading CiviCRM (Moderator: Deepak Srivastava) »
  • Unknown DB error while upgrading from 4.4 to 4.5

This forum was archived on 2017-11-26.