Answers.Body: <p>The correct answer is already given, but I want to add some nuance.</p>
  <p>This is actually addressed in the upgrade guide and is expected. As the guide states, it is not generally required to do intermediate version upgrades when making a bug version jump. The issue is that the current upgrader only supports versions starting from 4.7.</p>
  <p>So, the issue is not the size of the version bump. You just have to get to 4.7 and then the current installer will work.</p>
  <ul>
  <li><a href="https://docs.civicrm.org/sysadmin/en/latest/upgrade/" rel="nofollow noreferrer">https://docs.civicrm.org/sysadmin/en/latest/upgrade/</a></li>
  <li><a href="https://sourceforge.net/projects/civicrm/files/civicrm-stable/4.7.31/" rel="nofollow noreferrer">https://sourceforge.net/projects/civicrm/files/civicrm-stable/4.7.31/</a></li>
  </ul>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-12-09T13:06:14.300Z
Answers.LastActivityDate: 2021-12-09T13:06:14.300Z
Answers.UserDisplayName: ginkgoMZD
Answers.Body: <p>You're likely making too big of a jump in versions. I try to do it in small jumps, creating a backup after each try. Then I can easily revert to the last one if something breaks.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-12-07T16:47:36.367Z
Answers.Text: Hi Jenni
  You were so right. All I did was make the small jumps as you advised and I am all smiles again. Thank you so so much really appreciate your advice ;)
Answers.UserDisplayName: EmmyL
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-12-08T05:28:16.920Z
Answers.Text: Not a problem. I've run into the issue enough times that this has become my standard if I'm upgrading very far.
Answers.UserDisplayName: Jenni Simonis
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-12-06T19:46:53.100Z
Answers.LastActivityDate: 2021-12-06T19:46:53.100Z
Answers.UserDisplayName: Jenni Simonis
Body: <p>I am trying to upgrade CiviCRM from 4.2.0 to 5.2.2 and am getting the error below. Whenever the upgrade runs it stops at DB to 4.3.alpha1 and throws up the error. Am on Drupal 7.</p>
  <pre><code>[Error: Upgrade DB to 4.3.alpha1]
  ERROR FIELD ERROR VALUE
  Type    DB_Error
  Code    -3
  Message DB Error: constraint violation
  Mode    16
  UserInfo    INSERT INTO civicrm_log (entity_table , entity_id , data , modified_id , modified_date ) VALUES ('civicrm_contact' , 12985 , 'civicrm_contact,12985' , 2 , 20211206190550 ) [nativecode=1452 ** Cannot add or update a child row: a foreign key constraint fails (`fwcivi`.`civicrm_log`, CONSTRAINT `FK_civicrm_log_modified_id` FOREIGN KEY (`modified_id`) REFERENCES `civicrm_contact` (`id`) ON DELETE CASCADE)]
  DebugInfo   INSERT INTO civicrm_log (entity_table , entity_id , data , modified_id , modified_date ) VALUES ('civicrm_contact' , 12985 , 'civicrm_contact,12985' , 2 , 20211206190550 ) [nativecode=1452 ** Cannot add or update a child row: a foreign key constraint fails (`fwcivi`.`civicrm_log`, CONSTRAINT `FK_civicrm_log_modified_id` FOREIGN KEY (`modified_id`) REFERENCES `civicrm_contact` (`id`) ON DELETE CASCADE)]
  PEAR_Exception: DB Error: constraint violation in /Applications/MAMP/htdocs/sites/all/modules/civicrm/packages/PEAR.php on line 921
  - DB_Error: DB Error: constraint violation in unknown on line unknown
  Exception trace
  #   Function    Location
  0   CRM_Core_Error::exceptionHandler(Object(DB_Error))  /Applications/MAMP/htdocs/sites/all/modules/civicrm/packages/PEAR.php:921
  1   PEAR_Error-&gt;__construct('DB Error: constr…', -3, 16, Array, 'INSERT INTO civi…')    /Applications/MAMP/htdocs/sites/all/modules/civicrm/packages/DB.php:984
  2   DB_Error-&gt;__construct(-3, 16, Array, 'INSERT INTO civi…')   /Applications/MAMP/htdocs/sites/all/modules/civicrm/packages/PEAR.php:575
  3   PEAR-&gt;_raiseError(Object(DB_mysqli), null, -3, 16, Array, 'INSERT INTO civi…', 'DB_Error', true)    /Applications/MAMP/htdocs/sites/all/modules/civicrm/packages/PEAR.php:223
  4   PEAR-&gt;__call('raiseError', Array)   /Applications/MAMP/htdocs/sites/all/modules/civicrm/packages/DB/common.php:1905
  5   DB_common-&gt;raiseError(-3, null, null, 'INSERT INTO civi…', '1452 ** Cannot a…') /Applications/MAMP/htdocs/sites/all/modules/civicrm/packages/DB/mysqli.php:933
  6   DB_mysqli-&gt;mysqliRaiseError()   /Applications/MAMP/htdocs/sites/all/modules/civicrm/packages/DB/mysqli.php:403
  7   DB_mysqli-&gt;simpleQuery('INSERT INTO civi…') /Applications/MAMP/htdocs/sites/all/modules/civicrm/packages/DB/common.php:1216
  8   DB_common-&gt;query('INSERT INTO civi…')   /Applications/MAMP/htdocs/sites/all/modules/civicrm/packages/DB/DataObject.php:2443
  9   DB_DataObject-&gt;_query('INSERT INTO civi…')  /Applications/MAMP/htdocs/sites/all/modules/civicrm/packages/DB/DataObject.php:1068
  10  DB_DataObject-&gt;insert() /Applications/MAMP/htdocs/sites/all/modules/civicrm/CRM/Core/DAO.php:548
  11  CRM_Core_DAO-&gt;save()    /Applications/MAMP/htdocs/sites/all/modules/civicrm/CRM/Core/BAO/Log.php:141
  12  CRM_Core_BAO_Log::register(12985, 'civicrm_contact', 12985) /Applications/MAMP/htdocs/sites/all/modules/civicrm/CRM/Contact/BAO/Contact.php:218
  13  CRM_Contact_BAO_Contact::add(Array) /Applications/MAMP/htdocs/sites/all/modules/civicrm/CRM/Upgrade/Incremental/php/FourThree.php:865
  14  CRM_Upgrade_Incremental_php_FourThree-&gt;createDomainContacts()   /Applications/MAMP/htdocs/sites/all/modules/civicrm/CRM/Upgrade/Incremental/php/FourThree.php:128
  15  CRM_Upgrade_Incremental_php_FourThree-&gt;setPostUpgradeMessage('&lt;span class=&quot;bol…', '4.3.alpha1') /Applications/MAMP/htdocs/sites/all/modules/civicrm/CRM/Upgrade/Form.php:696
  16  CRM_Upgrade_Form::doIncrementalUpgradeStep(Object(CRM_Queue_TaskContext), '4.3.alpha1', '4.2.0', '5.2.2', '/private/var/fol…')  /Applications/MAMP/htdocs/sites/all/modules/civicrm/CRM/Queue/Task.php:88
  17  CRM_Queue_Task-&gt;run(Object(CRM_Queue_TaskContext))  /Applications/MAMP/htdocs/sites/all/modules/civicrm/CRM/Queue/Runner.php:214
  18  CRM_Queue_Runner-&gt;runNext(true) /Applications/MAMP/htdocs/sites/all/modules/civicrm/CRM/Queue/Page/AJAX.php:52
  19  CRM_Queue_Page_AJAX::{closure}()    /Applications/MAMP/htdocs/sites/all/modules/civicrm/CRM/Queue/ErrorPolicy.php:106
  20  CRM_Queue_ErrorPolicy-&gt;call(Object(Closure))    /Applications/MAMP/htdocs/sites/all/modules/civicrm/CRM/Queue/Page/AJAX.php:54
  21  CRM_Queue_Page_AJAX::runNext()  /Applications/MAMP/htdocs/sites/all/modules/civicrm/CRM/Core/Invoke.php:275
  22  CRM_Core_Invoke::runItem(Array) /Applications/MAMP/htdocs/sites/all/modules/civicrm/CRM/Core/Invoke.php:84
  23  CRM_Core_Invoke::_invoke(Array) /Applications/MAMP/htdocs/sites/all/modules/civicrm/CRM/Core/Invoke.php:52
  24  CRM_Core_Invoke::invoke(Array)  /Applications/MAMP/htdocs/sites/all/modules/civicrm/drupal/civicrm.module:445
  25  civicrm_invoke('upgrade', 'queue', 'ajax', 'runNext')   /Applications/MAMP/htdocs/includes/menu.inc:527
  26  menu_execute_active_handler()   /Applications/MAMP/htdocs/index.php:21
  27  {main}   
  </code></pre>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-12-06T20:03:52.713Z
Comments.Text: There are some suggestion about that same step breaking here https://civicrm.stackexchange.com/questions/26561/upgrade-to-civicrm-4-3-failing-on-drop-foreign-key
Comments.UserDisplayName: petednz - fuzion
Tags: <upgrade>
Title: upgrading civicrm 4.2.0 to 5.2.2
ThreadText: # upgrading civicrm 4.2.0 to 5.2.2
  
  (Asked by: username_0 on 2021-12-06)
  
  I am trying to upgrade CiviCRM from 4.2.0 to 5.2.2 and am getting the error below. Whenever the upgrade runs it stops at DB to 4.3.alpha1 and throws up the error. Am on Drupal 7.
  [Error: Upgrade DB to 4.3.alpha1]
  ERROR FIELD ERROR VALUE
  Type    DB_Error
  Code    -3
  Message DB Error: constraint violation
  Mode    16
  UserInfo    INSERT INTO civicrm_log (entity_table , entity_id , data , modified_id , modified_date ) VALUES ('civicrm_contact' , 12985 , 'civicrm_contact,12985' , 2 , 20211206190550 ) [nativecode=1452 ** Cannot add or update a child row: a foreign key constraint fails (`fwcivi`.`civicrm_log`, CONSTRAINT `FK_civicrm_log_modified_id` FOREIGN KEY (`modified_id`) REFERENCES `civicrm_contact` (`id`) ON DELETE CASCADE)]
  DebugInfo   INSERT INTO civicrm_log (entity_table , entity_id , data , modified_id , modified_date ) VALUES ('civicrm_contact' , 12985 , 'civicrm_contact,12985' , 2 , 20211206190550 ) [nativecode=1452 ** Cannot add or update a child row: a foreign key constraint fails (`fwcivi`.`civicrm_log`, CONSTRAINT `FK_civicrm_log_modified_id` FOREIGN KEY (`modified_id`) REFERENCES `civicrm_contact` (`id`) ON DELETE CASCADE)]
  PEAR_Exception: DB Error: constraint violation in /Applications/MAMP/htdocs/sites/all/modules/civicrm/packages/PEAR.php on line 921
  - DB_Error: DB Error: constraint violation in unknown on line unknown
  Exception trace
  #   Function    Location
  0   CRM_Core_Error::exceptionHandler(Object(DB_Error))  /Applications/MAMP/htdocs/sites/all/modules/civicrm/packages/PEAR.php:921
  1   PEAR_Error->__construct('DB Error: constr…', -3, 16, Array, 'INSERT INTO civi…')    /Applications/MAMP/htdocs/sites/all/modules/civicrm/packages/DB.php:984
  2   DB_Error->__construct(-3, 16, Array, 'INSERT INTO civi…')   /Applications/MAMP/htdocs/sites/all/modules/civicrm/packages/PEAR.php:575
  3   PEAR->_raiseError(Object(DB_mysqli), null, -3, 16, Array, 'INSERT INTO civi…', 'DB_Error', true)    /Applications/MAMP/htdocs/sites/all/modules/civicrm/packages/PEAR.php:223
  4   PEAR->__call('raiseError', Array)   /Applications/MAMP/htdocs/sites/all/modules/civicrm/packages/DB/common.php:1905
  5   DB_common->raiseError(-3, null, null, 'INSERT INTO civi…', '1452 ** Cannot a…') /Applications/MAMP/htdocs/sites/all/modules/civicrm/packages/DB/mysqli.php:933
  6   DB_mysqli->mysqliRaiseError()   /Applications/MAMP/htdocs/sites/all/modules/civicrm/packages/DB/mysqli.php:403
  7   DB_mysqli->simpleQuery('INSERT INTO civi…') /Applications/MAMP/htdocs/sites/all/modules/civicrm/packages/DB/common.php:1216
  8   DB_common->query('INSERT INTO civi…')   /Applications/MAMP/htdocs/sites/all/modules/civicrm/packages/DB/DataObject.php:2443
  9   DB_DataObject->_query('INSERT INTO civi…')  /Applications/MAMP/htdocs/sites/all/modules/civicrm/packages/DB/DataObject.php:1068
  10  DB_DataObject->insert() /Applications/MAMP/htdocs/sites/all/modules/civicrm/CRM/Core/DAO.php:548
  11  CRM_Core_DAO->save()    /Applications/MAMP/htdocs/sites/all/modules/civicrm/CRM/Core/BAO/Log.php:141
  12  CRM_Core_BAO_Log::register(12985, 'civicrm_contact', 12985) /Applications/MAMP/htdocs/sites/all/modules/civicrm/CRM/Contact/BAO/Contact.php:218
  13  CRM_Contact_BAO_Contact::add(Array) /Applications/MAMP/htdocs/sites/all/modules/civicrm/CRM/Upgrade/Incremental/php/FourThree.php:865
  14  CRM_Upgrade_Incremental_php_FourThree->createDomainContacts()   /Applications/MAMP/htdocs/sites/all/modules/civicrm/CRM/Upgrade/Incremental/php/FourThree.php:128
  15  CRM_Upgrade_Incremental_php_FourThree->setPostUpgradeMessage('<span class="bol…', '4.3.alpha1') /Applications/MAMP/htdocs/sites/all/modules/civicrm/CRM/Upgrade/Form.php:696
  16  CRM_Upgrade_Form::doIncrementalUpgradeStep(Object(CRM_Queue_TaskContext), '4.3.alpha1', '4.2.0', '5.2.2', '/private/var/fol…')  /Applications/MAMP/htdocs/sites/all/modules/civicrm/CRM/Queue/Task.php:88
  17  CRM_Queue_Task->run(Object(CRM_Queue_TaskContext))  /Applications/MAMP/htdocs/sites/all/modules/civicrm/CRM/Queue/Runner.php:214
  18  CRM_Queue_Runner->runNext(true) /Applications/MAMP/htdocs/sites/all/modules/civicrm/CRM/Queue/Page/AJAX.php:52
  19  CRM_Queue_Page_AJAX::{closure}()    /Applications/MAMP/htdocs/sites/all/modules/civicrm/CRM/Queue/ErrorPolicy.php:106
  20  CRM_Queue_ErrorPolicy->call(Object(Closure))    /Applications/MAMP/htdocs/sites/all/modules/civicrm/CRM/Queue/Page/AJAX.php:54
  21  CRM_Queue_Page_AJAX::runNext()  /Applications/MAMP/htdocs/sites/all/modules/civicrm/CRM/Core/Invoke.php:275
  22  CRM_Core_Invoke::runItem(Array) /Applications/MAMP/htdocs/sites/all/modules/civicrm/CRM/Core/Invoke.php:84
  23  CRM_Core_Invoke::_invoke(Array) /Applications/MAMP/htdocs/sites/all/modules/civicrm/CRM/Core/Invoke.php:52
  24  CRM_Core_Invoke::invoke(Array)  /Applications/MAMP/htdocs/sites/all/modules/civicrm/drupal/civicrm.module:445
  25  civicrm_invoke('upgrade', 'queue', 'ajax', 'runNext')   /Applications/MAMP/htdocs/includes/menu.inc:527
  26  menu_execute_active_handler()   /Applications/MAMP/htdocs/index.php:21
  27  {main}
  
  **Tags:** upgrade
  
  > **Comments:**
  > **username_1**: There are some suggestion about that same step breaking here https://civicrm.stackexchange.com/questions/26561/upgrade-to-civicrm-4-3-failing-on-drop-foreign-key  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_2 on 2021-12-09. Score: 1 | Accepted answer
  
  The correct answer is already given, but I want to add some nuance.
  
  This is actually addressed in the upgrade guide and is expected. As the guide states, it is not generally required to do intermediate version upgrades when making a bug version jump. The issue is that the current upgrader only supports versions starting from 4.7.
  
  So, the issue is not the size of the version bump. You just have to get to 4.7 and then the current installer will work.
  
  * <https://docs.civicrm.org/sysadmin/en/latest/upgrade/>
  * <https://sourceforge.net/projects/civicrm/files/civicrm-stable/4.7.31/>
  
  
  ---
  
  ### Answer by username_3 on 2021-12-06. Score: 3
  
  You're likely making too big of a jump in versions. I try to do it in small jumps, creating a backup after each try. Then I can easily revert to the last one if something breaks.
  
  > **Comments:**
  > **username_0**: Hi Jenni You were so right. All I did was make the small jumps as you advised and I am all smiles again. Thank you so so much really appreciate your advice ;)  
  > **username_3**: Not a problem. I've run into the issue enough times that this has become my standard if I'm upgrading very far.  
  
  ---
  
  