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 from 4.2 to 4.4 break on 4.3.alpha1 [SOLVED]
Pages: [1]

Author Topic: Upgrading from 4.2 to 4.4 break on 4.3.alpha1 [SOLVED]  (Read 1547 times)

Secrer

  • I’m new here
  • *
  • Posts: 6
  • Karma: 0
  • CiviCRM version: 4.4.2
  • CMS version: Drupal 7
  • MySQL version: 5.5.x
  • PHP version: 5.3.x
Upgrading from 4.2 to 4.4 break on 4.3.alpha1 [SOLVED]
November 29, 2013, 03:16:22 am
EDIT : Problem solved :)

It's the same problem as here.

My CiviCRM language is "French". I put it in "English (USA)" and the upgrade run perfectly !

OR

For 4.4.2 and before, apply theses patches :
https://github.com/civicrm/civicrm-core/pull/2122
https://github.com/civicrm/civicrm-core/pull/2128

Thanks a lot to Kurund Jalmi for the help ;)


Hi.

I'm trying to upgrade CiviCRM from 4.2.9 to 4.4.2 but the upgrade break at the 4.3.alpha1 stage.
I also tried to upgrade to 4.2.14 first and to 4.4.2 after and it's the same message.

I'm trying on my dev' computer before trying on production.
 
First of all, i've a DB_Error Constraint violation at stage "Error: Upgrade DB to 4.3.alpha1: SQL" :
Quote
INSERT INTO `civicrm_entity_financial_account` ( entity_table, entity_id, account_relationship, financial_account_id ) SELECT 'civicrm_financial_type', ft.id, @option_value_rel_id_exp, @financial_account_id_bf FROM `civicrm_financial_type` as ft [nativecode=1452 ** Cannot add or update a child row: a foreign key constraint fails (`civicrm`.`civicrm_entity_financial_account`, CONSTRAINT `FK_civicrm_entity_financial_account_financial_account_id` FOREIGN KEY (`financial_account_id`) REFERENCES `civicrm_financial_account` )]

Well, i solved this problem by adding the following lines in the CRM/Upgrade/Incremental/sql/4.3.alpha1.mysql.tpl :
Code: [Select]
SET FOREIGN_KEY_CHECKS = 0;
SET UNIQUE_CHECKS = 0;
SET SQL_NOTES = 0;

(I know, it's not the solution but it's for testing :) )

Restoring database, trying upgrade and getting this message :
Quote
Error: Create financial records for contributions
DB Error: syntax error
INSERT INTO civicrm_financial_trxn (contribution_id, payment_instrument_id, currency, total_amount, net_amount, fee_amount, trxn_id, status_id, check_number, to_financial_account_id, from_financial_account_id, trxn_date) SELECT con.id as contribution_id, con.payment_instrument_id, IF(con.currency IN ('AFN','ALL','DZD','USD','EUR','AOA','XCD','XCD','ARS','AMD','AWG','AUD','EUR','AZM','BSD','BHD','BDT','BBD','BYR','EUR','BZD','XOF','BMD','INR','BTN','BOB','BOV','BAM','BWP','NOK','BRL','USD','BND','BGN','XOF','BIF','KHR','XAF','CAD','CVE','KYD','XAF','XAF','CLP','CLF','CNY','AUD','AUD','COP','COU','KMF','XAF','CDF','NZD','CRC','XOF','HRK','CUP','CYP','CZK','DKK','DJF','XCD','DOP','USD','EGP','SVC','USD','XAF','ERN','EEK','ETB','FKP','DKK','FJD','EUR','EUR','EUR','XPF','EUR','XAF','GMD','GEL','EUR','GHC','GIP','EUR','DKK','XCD','EUR','USD','GTQ','GNF','GWP','XOF','GYD','HTG','USD','AUD','EUR','HNL','HKD','HUF','ISK','INR','IDR','XDR','IRR','IQD','EUR','ILS','EUR','JMD','JPY','JOD','KZT','KES','AUD','KPW','KRW','KWD','KGS','LAK','LVL','LBP','ZAR','LSL','LRD','LYD','CHF','LTL','EUR','MOP','MKD','MGA','MWK','MYR','MVR','XOF','MTL','USD','EUR','MRO','MUR','EUR','MXN','MXV','USD','MDL','EUR','MNT','XCD','MAD','MZM','MMK','ZAR','NAD','AUD','NPR','EUR','ANG','XPF','NZD','NIO','XOF','NGN','NZD','AUD','USD','NOK','OMR','PKR','USD','PAB','USD','PGK','PYG','PEN','PHP','NZD','PLN','EUR','USD','QAR','EUR','ROL','RON','RUB','RWF','SHP','XCD','XCD','EUR','XCD','WST','EUR','STD','SAR','XOF','CSD','EUR','SCR','SLL','SGD','SKK','SIT','SBD','SOS','ZAR','EUR','LKR','SDD','SRD','NOK','SZL','SEK','CHF','CHW','CHE','SYP','TWD','TJS','TZS','THB','USD','XOF','NZD','TOP','TTD','TND','TRY','TRL','TMM','USD','AUD','UGX','UAH','AED','GBP','USD','USS','USN','USD','UYU','UZS','VUV','VEB','VND','USD','USD','XPF','MAD','YER','ZMK','ZWD','XAU','XBA','XBB','XBC','XBD','XPD','XPT','XAG','XFU','XFO','XTS','XXX'), con.currency, 'EUR') as currency, con.total_amount, con.net_amount, con.fee_amount, con.trxn_id, con.contribution_status_id, con.check_number, efa.financial_account_id as to_financial_account_id, NULL as from_financial_account_id, REPLACE(REPLACE(REPLACE( CASE WHEN con.receive_date IS NOT NULL THEN con.receive_date WHEN con.receipt_date IS NOT NULL THEN con.receipt_date ELSE 20131129114621 END , '-', ''), ':', ''), ' ', '') as trxn_date FROM civicrm_contribution con LEFT JOIN civicrm_entity_financial_account efa ON (con.financial_type_id = efa.entity_id AND efa.entity_table = 'civicrm_financial_type' AND efa.account_relationship = ) WHERE con.is_pay_later = 1 AND con.contribution_status_id = 2

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 ') WHERE con.is_pay_later = 1 AND con.contribution_status_id = 2' at line 21

It's indeed a SQL syntax error juste before the WHERE :
Code: [Select]
... AND efa.account_relationship = ) WHERE
There is no value to "efa.account_relationship".

In file CRM/Upgrade/Incremental/php/FourTree.php, there is the SQL request :
Code: [Select]
... AND efa.account_relationship = {$accountsReceivableAccount})
Well... At this point, i think it's time to ask for help :P.

Do you have any idea to solve this problem ?

Thanks in advance.
« Last Edit: December 05, 2013, 05:27:48 am by Secrer »

Kurund Jalmi

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4169
  • Karma: 128
    • CiviCRM
  • CiviCRM version: 4.x, future
  • CMS version: Drupal 7, Joomla 3.x
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Upgrading from 4.2 to 4.4 break on 4.3.alpha1
November 29, 2013, 03:20:33 am
Can you try this patch: https://github.com/civicrm/civicrm-core/pull/2122 ( i.e apply this patch to 4.4.2 before upgrade )

Kurund
Found this reply helpful? Support CiviCRM

Secrer

  • I’m new here
  • *
  • Posts: 6
  • Karma: 0
  • CiviCRM version: 4.4.2
  • CMS version: Drupal 7
  • MySQL version: 5.5.x
  • PHP version: 5.3.x
Re: Upgrading from 4.2 to 4.4 break on 4.3.alpha1
November 29, 2013, 04:59:56 am
Quote from: Kurund Jalmi on November 29, 2013, 03:20:33 am
Can you try this patch: https://github.com/civicrm/civicrm-core/pull/2122 ( i.e apply this patch to 4.4.2 before upgrade )

Kurund

Problem is still here on the first "DB Error: constraint violation".

However, put Civi in English, upgrade and change language again works (but a working patch should be great).

Kurund Jalmi

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4169
  • Karma: 128
    • CiviCRM
  • CiviCRM version: 4.x, future
  • CMS version: Drupal 7, Joomla 3.x
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Upgrading from 4.2 to 4.4 break on 4.3.alpha1 [SOLVED]
November 29, 2013, 05:40:37 am
Are you saying this patch: https://github.com/civicrm/civicrm-core/pull/2122 fixed second issue but you still get "DB Error: constraint violation" error ?

Kurund
Found this reply helpful? Support CiviCRM

Secrer

  • I’m new here
  • *
  • Posts: 6
  • Karma: 0
  • CiviCRM version: 4.4.2
  • CMS version: Drupal 7
  • MySQL version: 5.5.x
  • PHP version: 5.3.x
Re: Upgrading from 4.2 to 4.4 break on 4.3.alpha1 [SOLVED]
November 29, 2013, 06:53:50 am
Quote from: Kurund Jalmi on November 29, 2013, 05:40:37 am
Are you saying this patch: https://github.com/civicrm/civicrm-core/pull/2122 fixed second issue but you still get "DB Error: constraint violation" error ?

Exactly.

The first "DB Error: constraint violation error" still remain and if i put the "SET ... = 0" in the sql file, the 2122 patch is working for the DB syntax error.

I could upgrade from 4.2.9 to 4.2.2 without error with your patch and the "SET ... = 0" workaround.

Thanks :)

Kurund Jalmi

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4169
  • Karma: 128
    • CiviCRM
  • CiviCRM version: 4.x, future
  • CMS version: Drupal 7, Joomla 3.x
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Upgrading from 4.2 to 4.4 break on 4.3.alpha1 [SOLVED]
December 02, 2013, 03:37:48 am
Here is another patch in addition to the previous patch: https://github.com/civicrm/civicrm-core/pull/2128

Please let us know if you still have any issues with the upgrade.

Kurund
Found this reply helpful? Support CiviCRM

Secrer

  • I’m new here
  • *
  • Posts: 6
  • Karma: 0
  • CiviCRM version: 4.4.2
  • CMS version: Drupal 7
  • MySQL version: 5.5.x
  • PHP version: 5.3.x
Re: Upgrading from 4.2 to 4.4 break on 4.3.alpha1 [SOLVED]
December 05, 2013, 05:25:59 am
Great news ! It works ! ;D

So, with theses two patches :
https://github.com/civicrm/civicrm-core/pull/2122
https://github.com/civicrm/civicrm-core/pull/2128

I can upgrade with a French (or another non-english language i guess) from a 4.2.x to a 4.4.2.

Thanks a lot.

Kurund Jalmi

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4169
  • Karma: 128
    • CiviCRM
  • CiviCRM version: 4.x, future
  • CMS version: Drupal 7, Joomla 3.x
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Upgrading from 4.2 to 4.4 break on 4.3.alpha1 [SOLVED]
December 05, 2013, 10:14:10 am
Kool, thanks..

Kurund
Found this reply helpful? Support CiviCRM

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Upgrading CiviCRM (Moderator: Deepak Srivastava) »
  • Upgrading from 4.2 to 4.4 break on 4.3.alpha1 [SOLVED]

This forum was archived on 2017-11-26.