Answers.Body: <p>This error relates to the fact that there used to be payment processor code in CiviCRM core to support the Moneris payment processor.  If you don't interact with Moneris, this is fairly safe to ignore.  However, I suspect the error may mean you use Moneris, in which case I would NOT follow the instructions below.</p>
  
  <ul>
  <li>In your CiviCRM folder, find the file located at <code>CRM/Upgrade/Incremental/php/FourSeven.php</code>. </li>
  <li>Delete line 193.  Confirm it matches the <a href="https://github.com/civicrm/civicrm-core/blob/master/CRM/Upgrade/Incremental/php/FourSeven.php#L193" rel="nofollow noreferrer">line 193 linked here</a>.</li>
  <li>Run the upgrade again.</li>
  </ul>
  
  <p>Note that it's common to experience upgrade errors because you have a partially upgraded database - so be sure to restore the pre-upgrade database backup to minimize your upgrade pain.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-10-03T19:52:59.423Z
Answers.Text: See edit to question - we did as advised, but got a new error. The upgrade script appears to want to still remove Moneris even if Moneris no longer exists.
Answers.UserDisplayName: Alex Katayama
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-10-03T20:03:36.340Z
Answers.Text: Edit: it appears we forgot to delete line 193 in CRM/Upgrade/Incremental/php/FourSeven.php when refreshing the site and trying to re-run the upgrade.
Answers.UserDisplayName: Alex Katayama
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-10-03T21:47:27.077Z
Answers.Text: Hi Alex! I think from your second comment your upgrade was successful; please comment again if that's not the case.
Answers.UserDisplayName: Jon G - Megaphone Tech
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-09-27T22:54:11.843Z
Answers.LastActivityDate: 2018-09-27T22:54:11.843Z
Answers.UserDisplayName: Jon G - Megaphone Tech
Body: <p>This is a Drupal 7+CiviCRM deployment. Trying to upgrade to 5.5.3 - we're getting this error that stops the upgrade script. Is there a database value I can edit to skip over this to proceed with the upgrade?</p>
  
  <pre><code>[Error: Remove Moneris]
  CiviCRM_API3_Exception: "Could not delete payment processor type"
  
  #0 X:\test\temp\sites\all\modules\civicrm\CRM\Upgrade\Incremental\Base.php(129): civicrm_api3("PaymentProcessorType", "delete", (Array:1))
  #1 [internal function](): CRM_Upgrade_Incremental_Base::removePaymentProcessorType(Object(CRM_Queue_TaskContext), "Moneris")
  #2 X:\test\temp\sites\all\modules\civicrm\CRM\Queue\Task.php(88): call_user_func_array((Array:2), (Array:2))
  #3 X:\test\temp\sites\all\modules\civicrm\CRM\Queue\Runner.php(214): CRM_Queue_Task-&gt;run(Object(CRM_Queue_TaskContext))
  #4 X:\test\temp\sites\all\modules\civicrm\CRM\Queue\Page\AJAX.php(52): CRM_Queue_Runner-&gt;runNext(TRUE)
  #5 X:\test\temp\sites\all\modules\civicrm\CRM\Queue\ErrorPolicy.php(106): CRM_Queue_Page_AJAX::{closure}()
  #6 X:\test\temp\sites\all\modules\civicrm\CRM\Queue\Page\AJAX.php(54): CRM_Queue_ErrorPolicy-&gt;call(Object(Closure))
  #7 [internal function](): CRM_Queue_Page_AJAX::runNext()
  #8 X:\test\temp\sites\all\modules\civicrm\CRM\Core\Invoke.php(275): call_user_func((Array:2))
  #9 X:\test\temp\sites\all\modules\civicrm\CRM\Core\Invoke.php(84): CRM_Core_Invoke::runItem((Array:13))
  #10 X:\test\temp\sites\all\modules\civicrm\CRM\Core\Invoke.php(52): CRM_Core_Invoke::_invoke((Array:5))
  #11 X:\test\temp\sites\all\modules\civicrm\drupal\civicrm.module(445): CRM_Core_Invoke::invoke((Array:5))
  #12 [internal function](): civicrm_invoke("upgrade", "queue", "ajax", "runNext")
  #13 X:\test\temp\includes\menu.inc(527): call_user_func_array("civicrm_invoke", (Array:4))
  #14 X:\test\temp\index.php(21): menu_execute_active_handler()
  #15 {main}
  </code></pre>
  
  <p>----- UPDATE -------</p>
  
  <p>So we restarted the entire upgrade - manually deleted Moneris, and commented out line 193 as suggested by Jon G, but the script seems to stubbornly want to do its own thing. This is the error now:</p>
  
  <pre><code>[Error: Remove Moneris]
  CiviCRM_API3_Exception: "Unexpected result from getcountArray ( [error_field] =&gt; payment_processor_type_id [error_code] =&gt; 2001 [entity] =&gt; PaymentProcessor [action] =&gt; get [is_error] =&gt; 1 [error_message] =&gt; 'Moneris' is not a valid option for field payment_processor_type_id ) "
  
  0 X:\test\temp\sites\all\modules\civicrm\CRM\Upgrade\Incremental\Base.php(122): civicrm_api3("PaymentProcessor", "getcount", (Array:1))
  1 [internal function](): CRM_Upgrade_Incremental_Base::removePaymentProcessorType(Object(CRM_Queue_TaskContext), "Moneris")
  2 X:\test\temp\sites\all\modules\civicrm\CRM\Queue\Task.php(88): call_user_func_array((Array:2), (Array:2))
  3 X:\test\temp\sites\all\modules\civicrm\CRM\Queue\Runner.php(214): CRM_Queue_Task-&gt;run(Object(CRM_Queue_TaskContext))
  4 X:\test\temp\sites\all\modules\civicrm\CRM\Queue\Page\AJAX.php(52): CRM_Queue_Runner-&gt;runNext(TRUE)
  5 X:\test\temp\sites\all\modules\civicrm\CRM\Queue\ErrorPolicy.php(106): CRM_Queue_Page_AJAX::{closure}()
  6 X:\test\temp\sites\all\modules\civicrm\CRM\Queue\Page\AJAX.php(54): CRM_Queue_ErrorPolicy-&gt;call(Object(Closure))
  7 [internal function](): CRM_Queue_Page_AJAX::runNext()
  8 X:\test\temp\sites\all\modules\civicrm\CRM\Core\Invoke.php(275): call_user_func((Array:2))
  9 X:\test\temp\sites\all\modules\civicrm\CRM\Core\Invoke.php(84): CRM_Core_Invoke::runItem((Array:13))
  10 X:\test\temp\sites\all\modules\civicrm\CRM\Core\Invoke.php(52): CRM_Core_Invoke::_invoke((Array:5))
  11 X:\test\temp\sites\all\modules\civicrm\drupal\civicrm.module(445): CRM_Core_Invoke::invoke((Array:5))
  12 [internal function](): civicrm_invoke("upgrade", "queue", "ajax", "runNext")
  13 X:\test\temp\includes\menu.inc(527): call_user_func_array("civicrm_invoke", (Array:4))
  14 X:\test\temp\index.php(21): menu_execute_active_handler()
  15 {main}
  </code></pre>
  
Tags: <drupal><upgrade><4.6>
Title: Upgrading from 4.6 to 5.5.3 - [Error: Remove Moneris] CiviCRM_API3_Exception: "Could not delete payment processor type"
ThreadText: # Upgrading from 4.6 to 5.5.3 - [Error: Remove Moneris] CiviCRM_API3_Exception: "Could not delete payment processor type"
  
  (Asked by: username_0 on 2018-09-27)
  
  This is a Drupal 7+CiviCRM deployment. Trying to upgrade to 5.5.3 - we're getting this error that stops the upgrade script. Is there a database value I can edit to skip over this to proceed with the upgrade?
  [Error: Remove Moneris]
  CiviCRM_API3_Exception: "Could not delete payment processor type"
  
  #0 X:\test\temp\sites\all\modules\civicrm\CRM\Upgrade\Incremental\Base.php(129): civicrm_api3("PaymentProcessorType", "delete", (Array:1))
  #1 [internal function](): CRM_Upgrade_Incremental_Base::removePaymentProcessorType(Object(CRM_Queue_TaskContext), "Moneris")
  #2 X:\test\temp\sites\all\modules\civicrm\CRM\Queue\Task.php(88): call_user_func_array((Array:2), (Array:2))
  #3 X:\test\temp\sites\all\modules\civicrm\CRM\Queue\Runner.php(214): CRM_Queue_Task->run(Object(CRM_Queue_TaskContext))
  #4 X:\test\temp\sites\all\modules\civicrm\CRM\Queue\Page\AJAX.php(52): CRM_Queue_Runner->runNext(TRUE)
  #5 X:\test\temp\sites\all\modules\civicrm\CRM\Queue\ErrorPolicy.php(106): CRM_Queue_Page_AJAX::{closure}()
  #6 X:\test\temp\sites\all\modules\civicrm\CRM\Queue\Page\AJAX.php(54): CRM_Queue_ErrorPolicy->call(Object(Closure))
  #7 [internal function](): CRM_Queue_Page_AJAX::runNext()
  #8 X:\test\temp\sites\all\modules\civicrm\CRM\Core\Invoke.php(275): call_user_func((Array:2))
  #9 X:\test\temp\sites\all\modules\civicrm\CRM\Core\Invoke.php(84): CRM_Core_Invoke::runItem((Array:13))
  #10 X:\test\temp\sites\all\modules\civicrm\CRM\Core\Invoke.php(52): CRM_Core_Invoke::_invoke((Array:5))
  #11 X:\test\temp\sites\all\modules\civicrm\drupal\civicrm.module(445): CRM_Core_Invoke::invoke((Array:5))
  #12 [internal function](): civicrm_invoke("upgrade", "queue", "ajax", "runNext")
  #13 X:\test\temp\includes\menu.inc(527): call_user_func_array("civicrm_invoke", (Array:4))
  #14 X:\test\temp\index.php(21): menu_execute_active_handler()
  #15 {main}
  
  ----- UPDATE -------
  So we restarted the entire upgrade - manually deleted Moneris, and commented out line 193 as suggested by Jon G, but the script seems to stubbornly want to do its own thing. This is the error now:
  [Error: Remove Moneris]
  CiviCRM_API3_Exception: "Unexpected result from getcountArray ( [error_field] => payment_processor_type_id [error_code] => 2001 [entity] => PaymentProcessor [action] => get [is_error] => 1 [error_message] => 'Moneris' is not a valid option for field payment_processor_type_id ) "
  
  0 X:\test\temp\sites\all\modules\civicrm\CRM\Upgrade\Incremental\Base.php(122): civicrm_api3("PaymentProcessor", "getcount", (Array:1))
  1 [internal function](): CRM_Upgrade_Incremental_Base::removePaymentProcessorType(Object(CRM_Queue_TaskContext), "Moneris")
  2 X:\test\temp\sites\all\modules\civicrm\CRM\Queue\Task.php(88): call_user_func_array((Array:2), (Array:2))
  3 X:\test\temp\sites\all\modules\civicrm\CRM\Queue\Runner.php(214): CRM_Queue_Task->run(Object(CRM_Queue_TaskContext))
  4 X:\test\temp\sites\all\modules\civicrm\CRM\Queue\Page\AJAX.php(52): CRM_Queue_Runner->runNext(TRUE)
  5 X:\test\temp\sites\all\modules\civicrm\CRM\Queue\ErrorPolicy.php(106): CRM_Queue_Page_AJAX::{closure}()
  6 X:\test\temp\sites\all\modules\civicrm\CRM\Queue\Page\AJAX.php(54): CRM_Queue_ErrorPolicy->call(Object(Closure))
  7 [internal function](): CRM_Queue_Page_AJAX::runNext()
  8 X:\test\temp\sites\all\modules\civicrm\CRM\Core\Invoke.php(275): call_user_func((Array:2))
  9 X:\test\temp\sites\all\modules\civicrm\CRM\Core\Invoke.php(84): CRM_Core_Invoke::runItem((Array:13))
  10 X:\test\temp\sites\all\modules\civicrm\CRM\Core\Invoke.php(52): CRM_Core_Invoke::_invoke((Array:5))
  11 X:\test\temp\sites\all\modules\civicrm\drupal\civicrm.module(445): CRM_Core_Invoke::invoke((Array:5))
  12 [internal function](): civicrm_invoke("upgrade", "queue", "ajax", "runNext")
  13 X:\test\temp\includes\menu.inc(527): call_user_func_array("civicrm_invoke", (Array:4))
  14 X:\test\temp\index.php(21): menu_execute_active_handler()
  15 {main}
  
  **Tags:** drupal, upgrade, 4.6
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2018-09-27. Score: 2 | Accepted answer
  
  This error relates to the fact that there used to be payment processor code in CiviCRM core to support the Moneris payment processor. If you don't interact with Moneris, this is fairly safe to ignore. However, I suspect the error may mean you use Moneris, in which case I would NOT follow the instructions below.
  
  * In your CiviCRM folder, find the file located at `CRM/Upgrade/Incremental/php/FourSeven.php`.
  * Delete line 193. Confirm it matches the [line 193 linked here](https://github.com/civicrm/civicrm-core/blob/master/CRM/Upgrade/Incremental/php/FourSeven.php#L193).
  * Run the upgrade again.
  
  Note that it's common to experience upgrade errors because you have a partially upgraded database - so be sure to restore the pre-upgrade database backup to minimize your upgrade pain.
  
  > **Comments:**
  > **username_0**: See edit to question - we did as advised, but got a new error. The upgrade script appears to want to still remove Moneris even if Moneris no longer exists.  
  > **username_0**: Edit: it appears we forgot to delete line 193 in CRM/Upgrade/Incremental/php/FourSeven.php when refreshing the site and trying to re-run the upgrade.  
  > **username_1**: Hi Alex! I think from your second comment your upgrade was successful; please comment again if that's not the case.  
  
  ---
  
  