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) »
  • My experience with 3.1.5 upgrade to 4.1.2
Pages: [1]

Author Topic: My experience with 3.1.5 upgrade to 4.1.2  (Read 692 times)

civicrmsav

  • I post frequently
  • ***
  • Posts: 121
  • Karma: 5
  • CiviCRM version: 4.2.6
  • CMS version: Drupal 7.x
My experience with 3.1.5 upgrade to 4.1.2
May 16, 2012, 09:05:21 am
Just wanted to post my experience with the upgrade in case it benefits someone else.

The fist time I ran  the upgrade I got
"Sorry. A non-recoverable error has occurred.
DB Error: already exists
Return to home page."

I restored from backup and ran again with debugging on and got the error below.   So apparently the upgrade doesn't expect the civicrm_price_field_value table to be there, but it was.  I'm not using that anyway, so I just restored from backup again, dropped that table manually and then ran the upgrade script which ran clean.


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

   => -5
    [message] => DB Error: already exists
    [mode] => 16
    [debug_info] => CREATE TABLE `civicrm_price_field_value`
  (`id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Price Field Value',
  `price_field_id` int(10) unsigned NOT NULL COMMENT 'FK to civicrm_price_field',
  `name` varchar(255) COLLATE utf8_unicode_ci NOT NULL COMMENT 'Price field option name',
  `label` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT 'Price field option label',
  `description` text COLLATE utf8_unicode_ci DEFAULT NULL COMMENT 'Price field option description.',
  `amount` varchar(512) COLLATE utf8_unicode_ci NOT NULL COMMENT 'Price field option amount',
  `count` int(10) unsigned DEFAULT NULL COMMENT 'Number of participants per field option',
  `max_value` int(10) unsigned DEFAULT NULL COMMENT 'Max number of participants per field options',
  `weight` int(11) DEFAULT '1' COMMENT 'Order in which the field options should appear',
  `is_default` tinyint(4) DEFAULT '0' COMMENT 'Is this default price field option',
  `is_active` tinyint(4) DEFAULT '1' COMMENT 'Is this price field option active',
  PRIMARY KEY (`id`),
  CONSTRAINT `FK_civicrm_price_field_value_price_field_id` FOREIGN KEY (`price_field_id`) REFERENCES civicrm_price_field(id) ON DELETE CASCADE )ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci [nativecode=1050 ** Table 'civicrm_price_field_value' already exists]
    [type] => DB_Error
    [user_info] => CREATE TABLE `civicrm_price_field_value`
  (`id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Price Field Value',
  `price_field_id` int(10) unsigned NOT NULL COMMENT 'FK to civicrm_price_field',
  `name` varchar(255) COLLATE utf8_unicode_ci NOT NULL COMMENT 'Price field option name',
  `label` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT 'Price field option label',
  `description` text COLLATE utf8_unicode_ci DEFAULT NULL COMMENT 'Price field option description.',
  `amount` varchar(512) COLLATE utf8_unicode_ci NOT NULL COMMENT 'Price field option amount',
  `count` int(10) unsigned DEFAULT NULL COMMENT 'Number of participants per field option',
  `max_value` int(10) unsigned DEFAULT NULL COMMENT 'Max number of participants per field options',
  `weight` int(11) DEFAULT '1' COMMENT 'Order in which the field options should appear',
  `is_default` tinyint(4) DEFAULT '0' COMMENT 'Is this default price field option',
  `is_active` tinyint(4) DEFAULT '1' COMMENT 'Is this price field option active',
  PRIMARY KEY (`id`),
  CONSTRAINT `FK_civicrm_price_field_value_price_field_id` FOREIGN KEY (`price_field_id`) REFERENCES civicrm_price_field(id) ON DELETE CASCADE )ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci [nativecode=1050 ** Table 'civicrm_price_field_value' already exists]
    [to_string] => [db_error: message="DB Error: already exists" code=-5 mode=callback callback=CRM_Core_Error::handle prefix="" info="CREATE TABLE `civicrm_price_field_value`
  (`id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Price Field Value',
  `price_field_id` int(10) unsigned NOT NULL COMMENT 'FK to civicrm_price_field',
  `name` varchar(255) COLLATE utf8_unicode_ci NOT NULL COMMENT 'Price field option name',
  `label` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT 'Price field option label',
  `description` text COLLATE utf8_unicode_ci DEFAULT NULL COMMENT 'Price field option description.',
  `amount` varchar(512) COLLATE utf8_unicode_ci NOT NULL COMMENT 'Price field option amount',
  `count` int(10) unsigned DEFAULT NULL COMMENT 'Number of participants per field option',
  `max_value` int(10) unsigned DEFAULT NULL COMMENT 'Max number of participants per field options',
  `weight` int(11) DEFAULT '1' COMMENT 'Order in which the field options should appear',
  `is_default` tinyint(4) DEFAULT '0' COMMENT 'Is this default price field option',
  `is_active` tinyint(4) DEFAULT '1' COMMENT 'Is this price field option active',
  PRIMARY KEY (`id`),
  CONSTRAINT `FK_civicrm_price_field_value_price_field_id` FOREIGN KEY (`price_field_id`) REFERENCES civicrm_price_field(id) ON DELETE CASCADE )ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci [nativecode=1050 ** Table 'civicrm_price_field_value' already exists]"]
)

JonGold

  • Ask me questions
  • ****
  • Posts: 638
  • Karma: 81
    • Palante Technology
  • CiviCRM version: 4.1 to the latest
  • CMS version: Drupal 6-7, Wordpress 4.0+
  • PHP version: PHP 5.3-5.5
Re: My experience with 3.1.5 upgrade to 4.1.2
May 16, 2012, 02:33:40 pm
I ran into a very similar problem yesterday on a 3.0.0 to 3.4.8 upgrade.  Here's what's going on:
* You backed up the 3.1.5 db, probably with mysqldump.
* You ran a failed upgrade.  As part of the upgrade process, the civicrm_price_field_value table was created.
* You restore from backup.
...and THERE is where I had the same disconnect I think you had.  When you restore from backup, you expect the database to be back in the state it was when you started the process.  However, the backup is made up of SQL statements that say "DROP IF EXISTS civicrm_whatevertable".  The backup does NOT touch any tables that didn't exist when the backup was taken.

So even though you restored from a db dump, your db has this extra table that causes the upgrade to barf.

I resolved this by DROPping the entire database, creating the database again, THEN restoring my original backup.  Once I did that, I could upgrade cleanly (well...not exactly, but that's a story for another time).
Sign up to StackExchange and get free expert CiviCRM advice: https://civicrm.org/blogs/colemanw/get-exclusive-access-free-expert-help

civicrmsav

  • I post frequently
  • ***
  • Posts: 121
  • Karma: 5
  • CiviCRM version: 4.2.6
  • CMS version: Drupal 7.x
Re: My experience with 3.1.5 upgrade to 4.1.2
May 16, 2012, 04:44:29 pm
Hmm.  Sounds like your problem was different than mine.  I know for sure that the table is in my 3.1.5 version, because I can see it on my live server which I haven't trouched (i'm working on my test server to make sure the upgrade works).   And anyway I always drop all the tables from the database manually before restoring from backup.  But whatever, it's working now.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Upgrading CiviCRM (Moderator: Deepak Srivastava) »
  • My experience with 3.1.5 upgrade to 4.1.2

This forum was archived on 2017-11-26.