Body: <p>I've been getting an error when I try and upgrade my database to CiviCRM 4.7.7 I've upgraded civi a few times, this is the first time I have a problem I can't solve when upgrading the database. I followed the directions here: <a href="https://wiki.civicrm.org/confluence/display/CRMDOC/Upgrading+CiviCRM+for+Drupal+7" rel="nofollow">https://wiki.civicrm.org/confluence/display/CRMDOC/Upgrading+CiviCRM+for+Drupal+7</a>
  Hoping someone can help! </p>
  
  <p>This is the error that I get when trying to upgrading my database from 4.6.x to 4.7.7: </p>
  
  <pre><code>drush civicrm-upgrade-db
  PEAR_Exception: "DB Error: not found"
   * ERROR TYPE: DB_Error
   * ERROR CODE: -4
   * ERROR MESSAGE: DB Error: not found
   * ERROR MODE: 16
   * ERROR USERINFO: ALTER TABLE `civicrm_action_schedule` DROP FOREIGN KEY `FK_civicrm_action_schedule_mapping_id` [nativecode=1091 ** Can't DROP 'FK_civicrm_action_schedule_mapping_id'; check that column/key exists]
   * ERROR DEBUGINFO: ALTER TABLE `civicrm_action_schedule` DROP FOREIGN KEY `FK_civicrm_action_schedule_mapping_id` [nativecode=1091 ** Can't DROP 'FK_civicrm_action_schedule_mapping_id'; check that column/key exists]
  #0 [internal function](): CRM_Core_Error::exceptionHandler(Object(DB_Error))
  #1 /usr/share/drupal7/modules/civicrm/packages/PEAR.php(931): call_user_func((Array:2), Object(DB_Error))
  #2 /usr/share/drupal7/modules/civicrm/packages/DB.php(976): PEAR_Error-&gt;PEAR_Error("DB Error: not found", -4, 16, (Array:2), "ALTER TABLE `civicrm_action_schedule` DROP FOREIGN KEY `FK_civicrm_action_sch...")
  #3 /usr/share/drupal7/modules/civicrm/packages/PEAR.php(564): DB_Error-&gt;DB_Error(-4, 16, (Array:2), "ALTER TABLE `civicrm_action_schedule` DROP FOREIGN KEY `FK_civicrm_action_sch...")
  #4 /usr/share/drupal7/modules/civicrm/packages/DB/common.php(1905): PEAR-&gt;raiseError(NULL, -4, NULL, NULL, "ALTER TABLE `civicrm_action_schedule` DROP FOREIGN KEY `FK_civicrm_action_sch...", "DB_Error", TRUE)
  #5 /usr/share/drupal7/modules/civicrm/packages/DB/mysql.php(895): DB_common-&gt;raiseError(-4, NULL, NULL, NULL, "1091 ** Can't DROP 'FK_civicrm_action_schedule_mapping_id'; check that column...")
  #6 /usr/share/drupal7/modules/civicrm/packages/DB/mysql.php(328): DB_mysql-&gt;mysqlRaiseError()
  #7 /usr/share/drupal7/modules/civicrm/packages/DB/common.php(1216): DB_mysql-&gt;simpleQuery("ALTER TABLE `civicrm_action_schedule` DROP FOREIGN KEY `FK_civicrm_action_sch...")
  #8 /usr/share/drupal7/modules/civicrm/CRM/Utils/File.php(332): DB_common-&gt;query("ALTER TABLE `civicrm_action_schedule` DROP FOREIGN KEY `FK_civicrm_action_sch...")
  #9 /usr/share/drupal7/modules/civicrm/CRM/Upgrade/Form.php(196): CRM_Utils_File::sourceSQLFile("mysql://root:asdf@localhost/civicrm?new_link=true", "-- Add new columns for multilingual purpose\nALTER TABLE `civicrm_action_sche...", NULL, TRUE)
  #10 /usr/share/drupal7/modules/civicrm/CRM/Upgrade/Form.php(387): CRM_Upgrade_Form-&gt;source("-- Add new columns for multilingual purpose\nALTER TABLE `civicrm_action_sche...", TRUE)
  #11 /usr/share/drupal7/modules/civicrm/CRM/Upgrade/Form.php(421): CRM_Upgrade_Form-&gt;processLocales("/usr/share/drupal7/modules/civicrm/CRM/Upgrade/Incremental/sql/4.7.alpha1.mys...", "4.7.alpha1")
  #12 /usr/share/drupal7/modules/civicrm/CRM/Upgrade/Incremental/Base.php(80): CRM_Upgrade_Form-&gt;processSQL("4.7.alpha1")
  #13 [internal function](): CRM_Upgrade_Incremental_Base::runSql(Object(CRM_Queue_TaskContext), "4.7.alpha1")
  #14 /usr/share/drupal7/modules/civicrm/CRM/Queue/Task.php(88): call_user_func_array((Array:2), (Array:2))
  #15 /usr/share/drupal7/modules/civicrm/CRM/Queue/Runner.php(214): CRM_Queue_Task-&gt;run(Object(CRM_Queue_TaskContext))
  #16 /usr/share/drupal7/modules/civicrm/CRM/Queue/Runner.php(168): CRM_Queue_Runner-&gt;runNext()
  #17 /usr/share/drupal7/modules/civicrm/CRM/Upgrade/Headless.php(67): CRM_Queue_Runner-&gt;runAll()
  #18 /usr/share/drupal7/modules/civicrm/drupal/drush/civicrm.drush.inc(707): CRM_Upgrade_Headless-&gt;run()
  #19 [internal function](): drush_civicrm_upgrade_db()
  #20 /usr/share/php/drush/includes/command.inc(334): call_user_func_array("drush_civicrm_upgrade_db", (Array:0))
  #21 /usr/share/php/drush/includes/command.inc(208): _drush_invoke_hooks("civicrm-upgrade-db", (Array:0), "civicrm")
  #22 [internal function](): drush_command()
  #23 /usr/share/php/drush/includes/command.inc(175): call_user_func_array("drush_command", (Array:0))
  #24 /usr/share/php/drush/drush.php(92): drush_dispatch((Array:27))
  #25 /usr/share/php/drush/drush.php(61): _drush_bootstrap_and_dispatch()
  #26 /usr/share/php/drush/drush.php(16): drush_main()
  #27 {main}
  WD php: PEAR_Exception: DB Error: not found in CRM_Core_Error::exceptionHandler() (line 913 of                                      [error]
  /usr/share/drupal7/modules/civicrm/CRM/Core/Error.php).
  Cannot modify header information - headers already sent by (output started at                                                       [warning]
  /usr/share/drupal7/modules/civicrm/CRM/Upgrade/Headless.php:72) bootstrap.inc:1232
  PEAR_Exception: DB Error: not found in CRM_Core_Error::exceptionHandler() (line 913 of /usr/share/drupal7/modules/civicrm/CRM/Core/Error.php).
  Drush command terminated abnormally due to an unrecoverable error.                                                                  [error]
  </code></pre>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-05-15T20:31:27.783Z
Comments.Text: may be covered by http://civicrm.stackexchange.com/questions/11522/upgrade-fails-4-7-4-4-7-6-in-wp-4-5-1 or http://civicrm.stackexchange.com/questions/10644/database-error-when-upgrading-4-6-to-4-7-on-drupal-7/11733#11733
Comments.UserDisplayName: petednz - fuzion
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-05-15T21:18:47.450Z
Comments.Text: @petednz-fuzion I wish you'd posted this as an answer, because it's definitely correct!  I'm actually going to mark this as a duplicate.
Comments.UserDisplayName: Jon G - Megaphone Tech
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-05-16T00:45:34.443Z
Comments.Text: Appears to be covered by http://civicrm.stackexchange.com/questions/11522/upgrade-fails-4-7-4-4-7-6-in-wp-4-5-1
Comments.UserDisplayName: petednz - fuzion
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-05-16T00:46:08.630Z
Comments.Text: I wasn't trying to be trivial ;-) - anyhow Jon, gave me vote to close too
Comments.UserDisplayName: petednz - fuzion
Tags: <upgrade>
Title: Trouble upgrading database from civicrm 4.6 to 4.7 on Drupal 7
ThreadText: # Trouble upgrading database from civicrm 4.6 to 4.7 on Drupal 7
  
  (Asked by: username_0 on 2016-05-15)
  
  I've been getting an error when I try and upgrade my database to CiviCRM 4.7.7 I've upgraded civi a few times, this is the first time I have a problem I can't solve when upgrading the database. I followed the directions here: https://wiki.civicrm.org/confluence/display/CRMDOC/Upgrading+CiviCRM+for+Drupal+7
  Hoping someone can help! 
  This is the error that I get when trying to upgrading my database from 4.6.x to 4.7.7: 
  drush civicrm-upgrade-db
  PEAR_Exception: "DB Error: not found"
   * ERROR TYPE: DB_Error
   * ERROR CODE: -4
   * ERROR MESSAGE: DB Error: not found
   * ERROR MODE: 16
   * ERROR USERINFO: ALTER TABLE `civicrm_action_schedule` DROP FOREIGN KEY `FK_civicrm_action_schedule_mapping_id` [nativecode=1091 ** Can't DROP 'FK_civicrm_action_schedule_mapping_id'; check that column/key exists]
   * ERROR DEBUGINFO: ALTER TABLE `civicrm_action_schedule` DROP FOREIGN KEY `FK_civicrm_action_schedule_mapping_id` [nativecode=1091 ** Can't DROP 'FK_civicrm_action_schedule_mapping_id'; check that column/key exists]
  #0 [internal function](): CRM_Core_Error::exceptionHandler(Object(DB_Error))
  #1 /usr/share/drupal7/modules/civicrm/packages/PEAR.php(931): call_user_func((Array:2), Object(DB_Error))
  #2 /usr/share/drupal7/modules/civicrm/packages/DB.php(976): PEAR_Error->PEAR_Error("DB Error: not found", -4, 16, (Array:2), "ALTER TABLE `civicrm_action_schedule` DROP FOREIGN KEY `FK_civicrm_action_sch...")
  #3 /usr/share/drupal7/modules/civicrm/packages/PEAR.php(564): DB_Error->DB_Error(-4, 16, (Array:2), "ALTER TABLE `civicrm_action_schedule` DROP FOREIGN KEY `FK_civicrm_action_sch...")
  #4 /usr/share/drupal7/modules/civicrm/packages/DB/common.php(1905): PEAR->raiseError(NULL, -4, NULL, NULL, "ALTER TABLE `civicrm_action_schedule` DROP FOREIGN KEY `FK_civicrm_action_sch...", "DB_Error", TRUE)
  #5 /usr/share/drupal7/modules/civicrm/packages/DB/mysql.php(895): DB_common->raiseError(-4, NULL, NULL, NULL, "1091 ** Can't DROP 'FK_civicrm_action_schedule_mapping_id'; check that column...")
  #6 /usr/share/drupal7/modules/civicrm/packages/DB/mysql.php(328): DB_mysql->mysqlRaiseError()
  #7 /usr/share/drupal7/modules/civicrm/packages/DB/common.php(1216): DB_mysql->simpleQuery("ALTER TABLE `civicrm_action_schedule` DROP FOREIGN KEY `FK_civicrm_action_sch...")
  #8 /usr/share/drupal7/modules/civicrm/CRM/Utils/File.php(332): DB_common->query("ALTER TABLE `civicrm_action_schedule` DROP FOREIGN KEY `FK_civicrm_action_sch...")
  #9 /usr/share/drupal7/modules/civicrm/CRM/Upgrade/Form.php(196): CRM_Utils_File::sourceSQLFile("mysql://root:asdf@localhost/civicrm?new_link=true", "-- Add new columns for multilingual purpose\nALTER TABLE `civicrm_action_sche...", NULL, TRUE)
  #10 /usr/share/drupal7/modules/civicrm/CRM/Upgrade/Form.php(387): CRM_Upgrade_Form->source("-- Add new columns for multilingual purpose\nALTER TABLE `civicrm_action_sche...", TRUE)
  #11 /usr/share/drupal7/modules/civicrm/CRM/Upgrade/Form.php(421): CRM_Upgrade_Form->processLocales("/usr/share/drupal7/modules/civicrm/CRM/Upgrade/Incremental/sql/4.7.alpha1.mys...", "4.7.alpha1")
  #12 /usr/share/drupal7/modules/civicrm/CRM/Upgrade/Incremental/Base.php(80): CRM_Upgrade_Form->processSQL("4.7.alpha1")
  #13 [internal function](): CRM_Upgrade_Incremental_Base::runSql(Object(CRM_Queue_TaskContext), "4.7.alpha1")
  #14 /usr/share/drupal7/modules/civicrm/CRM/Queue/Task.php(88): call_user_func_array((Array:2), (Array:2))
  #15 /usr/share/drupal7/modules/civicrm/CRM/Queue/Runner.php(214): CRM_Queue_Task->run(Object(CRM_Queue_TaskContext))
  #16 /usr/share/drupal7/modules/civicrm/CRM/Queue/Runner.php(168): CRM_Queue_Runner->runNext()
  #17 /usr/share/drupal7/modules/civicrm/CRM/Upgrade/Headless.php(67): CRM_Queue_Runner->runAll()
  #18 /usr/share/drupal7/modules/civicrm/drupal/drush/civicrm.drush.inc(707): CRM_Upgrade_Headless->run()
  #19 [internal function](): drush_civicrm_upgrade_db()
  #20 /usr/share/php/drush/includes/command.inc(334): call_user_func_array("drush_civicrm_upgrade_db", (Array:0))
  #21 /usr/share/php/drush/includes/command.inc(208): _drush_invoke_hooks("civicrm-upgrade-db", (Array:0), "civicrm")
  #22 [internal function](): drush_command()
  #23 /usr/share/php/drush/includes/command.inc(175): call_user_func_array("drush_command", (Array:0))
  #24 /usr/share/php/drush/drush.php(92): drush_dispatch((Array:27))
  #25 /usr/share/php/drush/drush.php(61): _drush_bootstrap_and_dispatch()
  #26 /usr/share/php/drush/drush.php(16): drush_main()
  #27 {main}
  WD php: PEAR_Exception: DB Error: not found in CRM_Core_Error::exceptionHandler() (line 913 of                                      [error]
  /usr/share/drupal7/modules/civicrm/CRM/Core/Error.php).
  Cannot modify header information - headers already sent by (output started at                                                       [warning]
  /usr/share/drupal7/modules/civicrm/CRM/Upgrade/Headless.php:72) bootstrap.inc:1232
  PEAR_Exception: DB Error: not found in CRM_Core_Error::exceptionHandler() (line 913 of /usr/share/drupal7/modules/civicrm/CRM/Core/Error.php).
  Drush command terminated abnormally due to an unrecoverable error.                                                                  [error]
  
  **Tags:** upgrade
  
  > **Comments:**
  > **username_1**: may be covered by http://civicrm.stackexchange.com/questions/11522/upgrade-fails-4-7-4-4-7-6-in-wp-4-5-1 or http://civicrm.stackexchange.com/questions/10644/database-error-when-upgrading-4-6-to-4-7-on-drupal-7/11733#11733  
  > **username_2**: @petednz-fuzion I wish you'd posted this as an answer, because it's definitely correct!  I'm actually going to mark this as a duplicate.  
  > **username_1**: Appears to be covered by http://civicrm.stackexchange.com/questions/11522/upgrade-fails-4-7-4-4-7-6-in-wp-4-5-1  
  > **username_1**: I wasn't trying to be trivial ;-) - anyhow Jon, gave me vote to close too  
  
  ---
  
  ## 0 answers
  
  