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) »
  • Upgrade:1.9->2.0 error at Step Five (Custom Data Upgrade)
Pages: [1]

Author Topic: Upgrade:1.9->2.0 error at Step Five (Custom Data Upgrade)  (Read 1679 times)

gmasky

  • Guest
Upgrade:1.9->2.0 error at Step Five (Custom Data Upgrade)
November 13, 2009, 10:06:16 am
I am finally upgrading from 1.9 to 2.0 and hopefully to 3.x. I am first upgrading from 1.9.13019 Drupal PHP5
 to 2.0.0 Drupal PHP5. I am using Drupal 5.19 and MySql 5.0.51a

At CiviCRM 2.0 Upgrade: Step Five (Custom Data Upgrade) I get the error with Sorry. A non-recoverable error has occurred.

Return to home page.

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

    [code] => -2
    [message] => DB Error: syntax error
    [mode] => 16
    [debug_info] =>
INSERT INTO custom_value_1_Membership_Info (domain_id,entity_id,To)
SELECT 1, cv.entity_id, cv.date_data FROM civicrm_custom_value cv
WHERE cv.custom_field_id=10
ON DUPLICATE KEY UPDATE To=cv.date_data [nativecode=1064 ** You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'To)
SELECT 1, cv.entity_id, cv.date_data FROM civicrm_custom_value cv
WHERE cv.' at line 1]
    [type] => DB_Error
    [user_info] =>
INSERT INTO custom_value_1_Membership_Info (domain_id,entity_id,To)
SELECT 1, cv.entity_id, cv.date_data FROM civicrm_custom_value cv
WHERE cv.custom_field_id=10
ON DUPLICATE KEY UPDATE To=cv.date_data [nativecode=1064 ** You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'To)
SELECT 1, cv.entity_id, cv.date_data FROM civicrm_custom_value cv
WHERE cv.' at line 1]
    [to_string] => [db_error: message="DB Error: syntax error" code=-2 mode=callback callback=CRM_Core_Error::handle prefix="" info="
INSERT INTO custom_value_1_Membership_Info (domain_id,entity_id,To)
SELECT 1, cv.entity_id, cv.date_data FROM civicrm_custom_value cv
WHERE cv.custom_field_id=10
ON DUPLICATE KEY UPDATE To=cv.date_data [nativecode=1064 ** You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'To)
SELECT 1, cv.entity_id, cv.date_data FROM civicrm_custom_value cv
WHERE cv.' at line 1]"]
)

I will appreciate any pointers[/code]

gmasky

  • Guest
Re: Upgrade:1.9->2.0 success
November 14, 2009, 07:21:52 pm
I was able to upgrade from 1.9 to 2.06. The Custom data field with id=10 was causing the problem. Since I am testing on localhost I just deleted the particular custom field. It was a date field and was part of From  and To custom date fields. The only date component exposed was the year for both these fields.

Question: Is there any way to avoid deleting the To custom field and get the upgrade to work.

Thanks

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: Upgrade:1.9->2.0 error at Step Five (Custom Data Upgrade)
November 14, 2009, 08:46:53 pm

sorry but we stopped support for 2.0 (and the upgrade) more than a year back. your best bet would be to get someone from http://civicrm.org/professional/ to take a look and figure out how to work around the issue

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

gmasky

  • Guest
Re: Upgrade:1.9->2.0 error at Step Five (Custom Data Upgrade)
November 15, 2009, 06:13:10 pm
I was able to update from 1.9 to 3.0.x after a few initial errors. The essential path I found was to import the civicrm schema 1.9 into a fresh DB. I then imported my data only into this database.

The errors I got was foreign key error which I solved through this link http://forum.civicrm.org/index.php?topic=3092.0

The second error I got pertained to one particular field of Custom data (above). I had two fields From=Year from which member attended the school To=Year upto which a member attended the School. Both fields had a year drop down. I deleted the "To" field (not an ideal solution and I do not have a real solution for this)

After these two errors were fixed the upgrade to 3.0.x was straightforward and error free.

The most important part for me was to get the DB schema right.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Upgrading CiviCRM (Moderator: Deepak Srivastava) »
  • Upgrade:1.9->2.0 error at Step Five (Custom Data Upgrade)

This forum was archived on 2017-11-26.