Answers.Body: <p>When attempting an upgrade, always approach it in many smaller version increments, rather than one large leap.  I wish that this guidance had been provided somewhere.  It would have saved me a lot of grief.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-04-10T05:53:14.013Z
Answers.LastActivityDate: 2021-04-10T05:53:14.013Z
Answers.UserDisplayName: dw861
Answers.Body: <p>I know this isn't helpful for the current issue but when upgrading I create a copy of the database and zip file of the CiviCRM files - both with the version number as part of the file name. That way I can do multiple upgrades in quick succession and step back to specific versions if one of them gets stuck.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-05-10T07:36:07.053Z
Answers.LastActivityDate: 2021-05-10T07:36:07.053Z
Answers.UserDisplayName: Jonathan Richardson
Body: <p>Unfortunately my update/upgrade has failed.</p>
  <p>I've done my best to follow the instructions on this page:
  <a href="https://docs.civicrm.org/sysadmin/en/latest/upgrade/wordpress/" rel="nofollow noreferrer">https://docs.civicrm.org/sysadmin/en/latest/upgrade/wordpress/</a></p>
  <p>Made it as far as the &quot;Upgrade the database&quot; instruction, by pointing my browser to the indicated url:
  <a href="http://example.org/wp-admin/admin.php?page=CiviCRM&amp;q=civicrm/upgrade&amp;reset=1" rel="nofollow noreferrer">http://example.org/wp-admin/admin.php?page=CiviCRM&amp;q=civicrm/upgrade&amp;reset=1</a></p>
  <p>I gave it permission to proceed, and the progress bar began showing progress.  Unfortunately when it hit 5.20 it stalled and sat there for a very long time.</p>
  <p>It finally exited, incomplete.  What was left on the system was not functional.</p>
  <p>I've managed to back out and have reverted to the former system by re-naming my CiviCRM directory.  I never deleted the original, as suggested in the instruction page.   Rather, I renamed it civicrm.bak, in case something bad happened (and it did).</p>
  <p>Where from here?  My CiviCRM system status now indicates:
  Database Partially Upgraded
  Database check failed - the database looks to have been partially upgraded. You must reload the database with the backup and try the upgrade process again.</p>
  <p>Were I to go through the same steps again, should I expect anything different?  Or, will it merely repeat the problem?</p>
  <p>Should I have tried to do this in a greater number of smaller increments?</p>
  <p>Thank you.</p>
  <p>Here is the most recent entry in the ConfigAndLog file.  I've replaced our actual login id with &quot;loginID&quot;:</p>
  <pre><code>Dec 28 12:45:02  [debug] $backTrace = #0 /home/loginID/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/Error.php(915): CRM_Core_Error::backtrace(&quot;backTrace&quot;, TRUE)
  #1 /home/loginID/public_html/wp-content/plugins/civicrm/civicrm/vendor/pear/pear-core-minimal/src/PEAR.php(922): CRM_Core_Error::exceptionHandler(Object(DB_Error))
  #2 /home/loginID/public_html/wp-content/plugins/civicrm/civicrm/packages/DB.php(997): PEAR_Error-&gt;__construct(&quot;DB Error: no such field&quot;, -19, 16, (Array:2), &quot;SELECT `a`.`id` AS `id`, `a`.`form_values` AS `form_values`, `a`.`mapping_id`...&quot;)
  #3 /home/loginID/public_html/wp-content/plugins/civicrm/civicrm/vendor/pear/pear-core-minimal/src/PEAR.php(575): DB_Error-&gt;__construct(-19, 16, (Array:2), &quot;SELECT `a`.`id` AS `id`, `a`.`form_values` AS `form_values`, `a`.`mapping_id`...&quot;)
  #4 /home/loginID/public_html/wp-content/plugins/civicrm/civicrm/vendor/pear/pear-core-minimal/src/PEAR.php(223): PEAR-&gt;_raiseError(Object(DB_mysqli), NULL, -19, 16, (Array:2), &quot;SELECT `a`.`id` AS `id`, `a`.`form_values` AS `form_values`, `a`.`mapping_id`...&quot;, &quot;DB_Error&quot;, TRUE)
  #5 /home/loginID/public_html/wp-content/plugins/civicrm/civicrm/packages/DB/common.php(1925): PEAR-&gt;__call(&quot;raiseError&quot;, (Array:7))
  #6 /home/loginID/public_html/wp-content/plugins/civicrm/civicrm/packages/DB/mysqli.php(935): DB_common-&gt;raiseError(-19, NULL, NULL, &quot;SELECT `a`.`id` AS `id`, `a`.`form_values` AS `form_values`, `a`.`mapping_id`...&quot;, &quot;1054 ** Unknown column 'a.api_entity' in 'field list'&quot;)
  #7 /home/loginID/public_html/wp-content/plugins/civicrm/civicrm/packages/DB/mysqli.php(405): DB_mysqli-&gt;mysqliRaiseError()
  #8 /home/loginID/public_html/wp-content/plugins/civicrm/civicrm/packages/DB/common.php(1231): DB_mysqli-&gt;simpleQuery(&quot;SELECT `a`.`id` AS `id`, `a`.`form_values` AS `form_values`, `a`.`mapping_id`...&quot;)
  #9 /home/loginID/public_html/wp-content/plugins/civicrm/civicrm/packages/DB/DataObject.php(2696): DB_common-&gt;query(&quot;SELECT `a`.`id` AS `id`, `a`.`form_values` AS `form_values`, `a`.`mapping_id`...&quot;)
  #10 /home/loginID/public_html/wp-content/plugins/civicrm/civicrm/packages/DB/DataObject.php(1829): DB_DataObject-&gt;_query(&quot;SELECT `a`.`id` AS `id`, `a`.`form_values` AS `form_values`, `a`.`mapping_id`...&quot;)
  #11 /home/loginID/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/DAO.php(421): DB_DataObject-&gt;query(&quot;SELECT `a`.`id` AS `id`, `a`.`form_values` AS `form_values`, `a`.`mapping_id`...&quot;)
  #12 /home/loginID/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/DAO.php(1463): CRM_Core_DAO-&gt;query(&quot;SELECT `a`.`id` AS `id`, `a`.`form_values` AS `form_values`, `a`.`mapping_id`...&quot;, TRUE)
  #13 /home/loginID/public_html/wp-content/plugins/civicrm/civicrm/Civi/Api4/Query/Api4SelectQuery.php(117): CRM_Core_DAO::executeQuery(&quot;SELECT `a`.`id` AS `id`, `a`.`form_values` AS `form_values`, `a`.`mapping_id`...&quot;)
  #14 /home/loginID/public_html/wp-content/plugins/civicrm/civicrm/Civi/Api4/Generic/DAOGetAction.php(59): Civi\Api4\Query\Api4SelectQuery-&gt;run()
  #15 /home/loginID/public_html/wp-content/plugins/civicrm/civicrm/Civi/Api4/Generic/DAOGetAction.php(50): Civi\Api4\Generic\DAOGetAction-&gt;getObjects()
  #16 /home/loginID/public_html/wp-content/plugins/civicrm/civicrm/Civi/Api4/Provider/ActionObjectProvider.php(68): Civi\Api4\Generic\DAOGetAction-&gt;_run(Object(Civi\Api4\Generic\Result))
  #17 /home/loginID/public_html/wp-content/plugins/civicrm/civicrm/Civi/API/Kernel.php(150): Civi\Api4\Provider\ActionObjectProvider-&gt;invoke(Object(Civi\Api4\Generic\DAOGetAction))
  #18 /home/loginID/public_html/wp-content/plugins/civicrm/civicrm/Civi/Api4/Generic/AbstractAction.php(231): Civi\API\Kernel-&gt;runRequest(Object(Civi\Api4\Generic\DAOGetAction))
  #19 /home/loginID/public_html/wp-content/plugins/civicrm/civicrm/CRM/Contact/BAO/SavedSearch.php(214): Civi\Api4\Generic\AbstractAction-&gt;execute()
  #20 /home/loginID/public_html/wp-content/plugins/civicrm/civicrm/CRM/Contact/BAO/GroupContactCache.php(463): CRM_Contact_BAO_SavedSearch::getSearchParams(&quot;5&quot;)
  #21 /home/loginID/public_html/wp-content/plugins/civicrm/civicrm/CRM/Contact/BAO/Query.php(3192): CRM_Contact_BAO_GroupContactCache::load(Object(CRM_Core_DAO))
  #22 /home/loginID/public_html/wp-content/plugins/civicrm/civicrm/CRM/Contact/BAO/Query.php(3093): CRM_Contact_BAO_Query-&gt;addGroupContactCache((Array:1), &quot;civicrm_group_contact_cache_5fea43ce068b3&quot;, &quot;contact_a&quot;, &quot;IN&quot;)
  #23 /home/loginID/public_html/wp-content/plugins/civicrm/civicrm/CRM/Contact/BAO/Query.php(1820): CRM_Contact_BAO_Query-&gt;group((Array:5))
  #24 /home/loginID/public_html/wp-content/plugins/civicrm/civicrm/CRM/Contact/BAO/Query.php(2058): CRM_Contact_BAO_Query-&gt;whereClauseSingle((Array:5), FALSE)
  #25 /home/loginID/public_html/wp-content/plugins/civicrm/civicrm/CRM/Contact/BAO/Query.php(582): CRM_Contact_BAO_Query-&gt;whereClause(FALSE)
  #26 /home/loginID/public_html/wp-content/plugins/civicrm/civicrm/CRM/Contact/BAO/Query.php(529): CRM_Contact_BAO_Query-&gt;initialize(NULL)
  #27 /home/loginID/public_html/wp-content/plugins/civicrm/civicrm/CRM/Contact/BAO/Query.php(4610): CRM_Contact_BAO_Query-&gt;__construct((Array:1), (Array:1), (Array:131), TRUE, FALSE, 1, TRUE, TRUE, FALSE, NULL, &quot;AND&quot;, NULL, 1)
  #28 /home/loginID/public_html/wp-content/plugins/civicrm/civicrm/CRM/Contact/BAO/GroupContactCache.php(210): CRM_Contact_BAO_Query::apiQuery((Array:1), (Array:1), NULL, NULL, 0, 0, FALSE)
  #29 /home/loginID/public_html/wp-content/plugins/civicrm/civicrm/CRM/Contact/BAO/GroupContactCache.php(192): CRM_Contact_BAO_GroupContactCache::add((Array:9))
  #30 /home/loginID/public_html/wp-content/plugins/civicrm/civicrm/api/v3/Job.php(683): CRM_Contact_BAO_GroupContactCache::loadAll((Array:0), &quot;Number optional-Limit the number of smart groups rebuild&quot;)
  #31 /home/loginID/public_html/wp-content/plugins/civicrm/civicrm/Civi/API/Provider/MagicFunctionProvider.php(89): civicrm_api3_job_group_rebuild((Array:2))
  #32 /home/loginID/public_html/wp-content/plugins/civicrm/civicrm/Civi/API/Kernel.php(150): Civi\API\Provider\MagicFunctionProvider-&gt;invoke((Array:8))
  #33 /home/loginID/public_html/wp-content/plugins/civicrm/civicrm/Civi/API/Kernel.php(81): Civi\API\Kernel-&gt;runRequest((Array:8))
  #34 /home/loginID/public_html/wp-content/plugins/civicrm/civicrm/api/api.php(22): Civi\API\Kernel-&gt;runSafe(&quot;job&quot;, &quot;group_rebuild&quot;, (Array:2))
  #35 /home/loginID/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/JobManager.php(133): civicrm_api(&quot;job&quot;, &quot;group_rebuild&quot;, (Array:2))
  #36 /home/loginID/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/JobManager.php(66): CRM_Core_JobManager-&gt;executeJob(Object(CRM_Core_ScheduledJob))
  #37 /home/loginID/public_html/wp-content/plugins/civicrm/civicrm/api/v3/Job.php(118): CRM_Core_JobManager-&gt;execute(FALSE)
  #38 /home/loginID/public_html/wp-content/plugins/civicrm/civicrm/Civi/API/Provider/MagicFunctionProvider.php(89): civicrm_api3_job_execute((Array:2))
  #39 /home/loginID/public_html/wp-content/plugins/civicrm/civicrm/Civi/API/Kernel.php(150): Civi\API\Provider\MagicFunctionProvider-&gt;invoke((Array:8))
  #40 /home/loginID/public_html/wp-content/plugins/civicrm/civicrm/Civi/API/Kernel.php(81): Civi\API\Kernel-&gt;runRequest((Array:8))
  #41 /home/loginID/public_html/wp-content/plugins/civicrm/civicrm/api/api.php(22): Civi\API\Kernel-&gt;runSafe(&quot;Job&quot;, &quot;execute&quot;, (Array:2))
  #42 /home/loginID/public_html/wp-content/plugins/civicrm/civicrm/bin/cli.class.php(122): civicrm_api(&quot;Job&quot;, &quot;execute&quot;, (Array:2))
  #43 /home/loginID/public_html/wp-content/plugins/civicrm/civicrm/bin/cli.php(32): civicrm_cli-&gt;callApi()
  #44 {main}
  </code></pre>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-12-28T05:32:19.093Z
Comments.Text: I should add that WordPress has sent me an error email.  In part, it reads: An error of type E_ERROR was caused in line 832 of the file
  /home/[loginid]/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/Error
  .php. Error message: Maximum execution time of 300 seconds exceeded
Comments.UserDisplayName: dw861
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-12-28T14:29:14.843Z
Comments.Text: Look in [ConfigAndLog](https://civicrm.stackexchange.com/questions/15931/where-are-the-configandlog-and-templates-c-directories) and see if there's a more detailed error. Also note https://civicrm.org/blog/kcristiano/civicrm-526-and-wordpress-important-notice for 5.26 in between, so if it seems related to that you may want to go to 5.25 first.
Comments.UserDisplayName: Demerit
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-12-28T19:14:41.107Z
Comments.Text: Thank you Demerit
Comments.UserDisplayName: dw861
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-12-28T19:20:35.213Z
Comments.Text: Hmm that error message about mailboxes doesn't seem related to an upgrade. It's from cron where you have bounce processing or the email processor scheduled. Anything else that looks upgrade related?
Comments.UserDisplayName: Demerit
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-12-28T19:56:04.957Z
Comments.Text: My ConfigAndLog directory has 25 files.  When I view the one with a ".log" extension, it is over 1000 pages long (when opened by LibreOffice).  Granted, I'm not sure what I'm looking for, but there doesn't seem to be anything related to my attempted upgrade.
Comments.UserDisplayName: dw861
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-12-28T20:16:02.517Z
Comments.Text: Unfortunately, now I face a significant problem.  When trying to perform a less ambitious upgrade, to 5.25, I find that when I point my browser to the upgrade url I get the error:  "Sorry, due to an error, we are unable to fulfill your request at the moment. You may want to contact your administrator or service provider with more details about what action you were performing when this occurred.
  Database check failed - the database looks to have been partially upgraded. You may want to reload the database with the backup and try the upgrade process again"
Comments.UserDisplayName: dw861
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-12-28T20:41:22.353Z
Comments.Text: Do you have a backup of your mysql database? If so then if you can restore that you would want to do that before re-starting the upgrade. If you don't, your best bet would be to manually update the version field in civicrm_domain, e.g. `UPDATE civicrm_domain SET version='5.16.2';`, or maybe 5.19.0 since you said it stopped around 5.20. For the log file, I'd search for the word "upgrade" - somewhere it should say something like "starting upgrade".
Comments.UserDisplayName: Demerit
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-12-28T20:57:51.837Z
Comments.Text: I do have a backup file created by cpanel: loginID_civicrm_wp.  I used cpanel to restore this file, but unfortunately Wordpress still won't allow the upgrade url to function.  Possibly your "UPDATE" command is executed at the prompt?  I will find tutorials to help me learn more about that.  Thanks for your continued assistance.  I've updated my original post with a more recent log entry.
Comments.UserDisplayName: dw861
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-12-28T21:04:28.627Z
Comments.Text: I don't recommend running the update command, it's just as a last resort if you can't restore. Restoring should allow you to try the upgrade again so I'm not sure why it won't.
Comments.UserDisplayName: Demerit
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-12-28T21:13:57.073Z
Comments.Text: Demerit, you have been very kind.  Inside CiviCRM, the status page indicates that I am running version 5.16.2, and that there are many patches available.  BUT, at the bottom of the page, there is a message indicating "Powered by 5.25.0", with a red system status alert.  If I might ask.  Is the "UPDATE" command above, performed at the main system prompt?  When I type "update" at the bash prompt, I am told that the command is not found.
Comments.UserDisplayName: dw861
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-12-28T22:47:23.390Z
Comments.Text: I misread your comment so am deleting my old comment and re-commenting: Right the one at the bottom is coming from the code files, and the one on the status page comes from the database. That's how civi knows you need to run the upgrade. But I'm not sure why it won't let you then just run the upgrade from the status page. The UPDATE command would be something you type into phpmyadmin or mysql, it's a SQL command not a shell command. But if you're seeing 5.16.2 on the status page then that's not the problem.
Comments.UserDisplayName: Demerit
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-12-28T23:11:22.823Z
Comments.Text: Thank you, again, Demerit.   I did find phpadmin in cpanel, but selecting the database and running your command only gave errors.  I don't know how to use the tool, so best to back out and not wreck more destruction. :)  As you can tell I am a volunteer with limited expertise.  I think that I've messed things up quite badly.
Comments.UserDisplayName: dw861
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-12-28T23:34:56.557Z
Comments.Text: Good luck. Yes if you can do a full restore then you can always try again some other day. That's how everyone learns! Or maybe someone else will see something obvious here.
Comments.UserDisplayName: Demerit
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-12-31T17:35:33.243Z
Comments.Text: Getting back to an earlier version is your best bet for moving forward. When you try to upgrade again, I would ensure that logging is disabled (Administer->System Settings->Misc) and that InnoDB fulltext search is also disabled (Administer->Customize Data->Search Prefs) before you do the upgrade. I have found both options can trigger the kind of DB upgrade failure you saw at first. I have never found a recovery path that didn't involve going back to the earlier working version in it's entirety.
  
  You can re-enable either or both after the upgrade.
Comments.UserDisplayName: kapn
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-01-03T20:35:52.007Z
Comments.Text: Thank you, kapn.  With the help of our hosting company, I have managed to get back to where we started via backups.  When I make another attempt at the upgrade, I will follow your kind suggestions and let you know how it went.  All of our memberships renew on Dec 31, so the database is being updated with some frequency.  I will wait a bit for others to finish their work, before making another upgrade attempt.
Comments.UserDisplayName: dw861
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-04-10T05:50:25.567Z
Comments.Text: Upgrade began at New Years, finally completed over Easter.  Rather than one large step, I began the update this time, in many small steps.  As many as I could tolerate.  These smaller changes all took place without incident.  Whatever the issue may have been, isn't duplicated when the changes are more conservative.  Thank you to all who offered help above.
Comments.UserDisplayName: dw861
Tags: <wordpress><upgrade>
Title: Wordpress upgrade from 5.16.12 to 5.32.0 fails
ThreadText: # Wordpress upgrade from 5.16.12 to 5.32.0 fails
  
  (Asked by: username_0 on 2020-12-28)
  
  Unfortunately my update/upgrade has failed.
  I've done my best to follow the instructions on this page:
  https://docs.civicrm.org/sysadmin/en/latest/upgrade/wordpress/
  Made it as far as the "Upgrade the database" instruction, by pointing my browser to the indicated url:
  http://example.org/wp-admin/admin.php?page=CiviCRM&q=civicrm/upgrade&reset=1
  I gave it permission to proceed, and the progress bar began showing progress.  Unfortunately when it hit 5.20 it stalled and sat there for a very long time.
  It finally exited, incomplete.  What was left on the system was not functional.
  I've managed to back out and have reverted to the former system by re-naming my CiviCRM directory.  I never deleted the original, as suggested in the instruction page.   Rather, I renamed it civicrm.bak, in case something bad happened (and it did).
  Where from here?  My CiviCRM system status now indicates:
  Database Partially Upgraded
  Database check failed - the database looks to have been partially upgraded. You must reload the database with the backup and try the upgrade process again.
  Were I to go through the same steps again, should I expect anything different?  Or, will it merely repeat the problem?
  Should I have tried to do this in a greater number of smaller increments?
  Thank you.
  Here is the most recent entry in the ConfigAndLog file.  I've replaced our actual login id with "loginID":
  Dec 28 12:45:02  [debug] $backTrace = #0 /home/loginID/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/Error.php(915): CRM_Core_Error::backtrace("backTrace", TRUE)
  #1 /home/loginID/public_html/wp-content/plugins/civicrm/civicrm/vendor/pear/pear-core-minimal/src/PEAR.php(922): CRM_Core_Error::exceptionHandler(Object(DB_Error))
  #2 /home/loginID/public_html/wp-content/plugins/civicrm/civicrm/packages/DB.php(997): PEAR_Error->__construct("DB Error: no such field", -19, 16, (Array:2), "SELECT `a`.`id` AS `id`, `a`.`form_values` AS `form_values`, `a`.`mapping_id`...")
  #3 /home/loginID/public_html/wp-content/plugins/civicrm/civicrm/vendor/pear/pear-core-minimal/src/PEAR.php(575): DB_Error->__construct(-19, 16, (Array:2), "SELECT `a`.`id` AS `id`, `a`.`form_values` AS `form_values`, `a`.`mapping_id`...")
  #4 /home/loginID/public_html/wp-content/plugins/civicrm/civicrm/vendor/pear/pear-core-minimal/src/PEAR.php(223): PEAR->_raiseError(Object(DB_mysqli), NULL, -19, 16, (Array:2), "SELECT `a`.`id` AS `id`, `a`.`form_values` AS `form_values`, `a`.`mapping_id`...", "DB_Error", TRUE)
  #5 /home/loginID/public_html/wp-content/plugins/civicrm/civicrm/packages/DB/common.php(1925): PEAR->__call("raiseError", (Array:7))
  #6 /home/loginID/public_html/wp-content/plugins/civicrm/civicrm/packages/DB/mysqli.php(935): DB_common->raiseError(-19, NULL, NULL, "SELECT `a`.`id` AS `id`, `a`.`form_values` AS `form_values`, `a`.`mapping_id`...", "1054 ** Unknown column 'a.api_entity' in 'field list'")
  #7 /home/loginID/public_html/wp-content/plugins/civicrm/civicrm/packages/DB/mysqli.php(405): DB_mysqli->mysqliRaiseError()
  #8 /home/loginID/public_html/wp-content/plugins/civicrm/civicrm/packages/DB/common.php(1231): DB_mysqli->simpleQuery("SELECT `a`.`id` AS `id`, `a`.`form_values` AS `form_values`, `a`.`mapping_id`...")
  #9 /home/loginID/public_html/wp-content/plugins/civicrm/civicrm/packages/DB/DataObject.php(2696): DB_common->query("SELECT `a`.`id` AS `id`, `a`.`form_values` AS `form_values`, `a`.`mapping_id`...")
  #10 /home/loginID/public_html/wp-content/plugins/civicrm/civicrm/packages/DB/DataObject.php(1829): DB_DataObject->_query("SELECT `a`.`id` AS `id`, `a`.`form_values` AS `form_values`, `a`.`mapping_id`...")
  #11 /home/loginID/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/DAO.php(421): DB_DataObject->query("SELECT `a`.`id` AS `id`, `a`.`form_values` AS `form_values`, `a`.`mapping_id`...")
  #12 /home/loginID/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/DAO.php(1463): CRM_Core_DAO->query("SELECT `a`.`id` AS `id`, `a`.`form_values` AS `form_values`, `a`.`mapping_id`...", TRUE)
  #13 /home/loginID/public_html/wp-content/plugins/civicrm/civicrm/Civi/Api4/Query/Api4SelectQuery.php(117): CRM_Core_DAO::executeQuery("SELECT `a`.`id` AS `id`, `a`.`form_values` AS `form_values`, `a`.`mapping_id`...")
  #14 /home/loginID/public_html/wp-content/plugins/civicrm/civicrm/Civi/Api4/Generic/DAOGetAction.php(59): Civi\Api4\Query\Api4SelectQuery->run()
  #15 /home/loginID/public_html/wp-content/plugins/civicrm/civicrm/Civi/Api4/Generic/DAOGetAction.php(50): Civi\Api4\Generic\DAOGetAction->getObjects()
  #16 /home/loginID/public_html/wp-content/plugins/civicrm/civicrm/Civi/Api4/Provider/ActionObjectProvider.php(68): Civi\Api4\Generic\DAOGetAction->_run(Object(Civi\Api4\Generic\Result))
  #17 /home/loginID/public_html/wp-content/plugins/civicrm/civicrm/Civi/API/Kernel.php(150): Civi\Api4\Provider\ActionObjectProvider->invoke(Object(Civi\Api4\Generic\DAOGetAction))
  #18 /home/loginID/public_html/wp-content/plugins/civicrm/civicrm/Civi/Api4/Generic/AbstractAction.php(231): Civi\API\Kernel->runRequest(Object(Civi\Api4\Generic\DAOGetAction))
  #19 /home/loginID/public_html/wp-content/plugins/civicrm/civicrm/CRM/Contact/BAO/SavedSearch.php(214): Civi\Api4\Generic\AbstractAction->execute()
  #20 /home/loginID/public_html/wp-content/plugins/civicrm/civicrm/CRM/Contact/BAO/GroupContactCache.php(463): CRM_Contact_BAO_SavedSearch::getSearchParams("5")
  #21 /home/loginID/public_html/wp-content/plugins/civicrm/civicrm/CRM/Contact/BAO/Query.php(3192): CRM_Contact_BAO_GroupContactCache::load(Object(CRM_Core_DAO))
  #22 /home/loginID/public_html/wp-content/plugins/civicrm/civicrm/CRM/Contact/BAO/Query.php(3093): CRM_Contact_BAO_Query->addGroupContactCache((Array:1), "civicrm_group_contact_cache_5fea43ce068b3", "contact_a", "IN")
  #23 /home/loginID/public_html/wp-content/plugins/civicrm/civicrm/CRM/Contact/BAO/Query.php(1820): CRM_Contact_BAO_Query->group((Array:5))
  #24 /home/loginID/public_html/wp-content/plugins/civicrm/civicrm/CRM/Contact/BAO/Query.php(2058): CRM_Contact_BAO_Query->whereClauseSingle((Array:5), FALSE)
  #25 /home/loginID/public_html/wp-content/plugins/civicrm/civicrm/CRM/Contact/BAO/Query.php(582): CRM_Contact_BAO_Query->whereClause(FALSE)
  #26 /home/loginID/public_html/wp-content/plugins/civicrm/civicrm/CRM/Contact/BAO/Query.php(529): CRM_Contact_BAO_Query->initialize(NULL)
  #27 /home/loginID/public_html/wp-content/plugins/civicrm/civicrm/CRM/Contact/BAO/Query.php(4610): CRM_Contact_BAO_Query->__construct((Array:1), (Array:1), (Array:131), TRUE, FALSE, 1, TRUE, TRUE, FALSE, NULL, "AND", NULL, 1)
  #28 /home/loginID/public_html/wp-content/plugins/civicrm/civicrm/CRM/Contact/BAO/GroupContactCache.php(210): CRM_Contact_BAO_Query::apiQuery((Array:1), (Array:1), NULL, NULL, 0, 0, FALSE)
  #29 /home/loginID/public_html/wp-content/plugins/civicrm/civicrm/CRM/Contact/BAO/GroupContactCache.php(192): CRM_Contact_BAO_GroupContactCache::add((Array:9))
  #30 /home/loginID/public_html/wp-content/plugins/civicrm/civicrm/api/v3/Job.php(683): CRM_Contact_BAO_GroupContactCache::loadAll((Array:0), "Number optional-Limit the number of smart groups rebuild")
  #31 /home/loginID/public_html/wp-content/plugins/civicrm/civicrm/Civi/API/Provider/MagicFunctionProvider.php(89): civicrm_api3_job_group_rebuild((Array:2))
  #32 /home/loginID/public_html/wp-content/plugins/civicrm/civicrm/Civi/API/Kernel.php(150): Civi\API\Provider\MagicFunctionProvider->invoke((Array:8))
  #33 /home/loginID/public_html/wp-content/plugins/civicrm/civicrm/Civi/API/Kernel.php(81): Civi\API\Kernel->runRequest((Array:8))
  #34 /home/loginID/public_html/wp-content/plugins/civicrm/civicrm/api/api.php(22): Civi\API\Kernel->runSafe("job", "group_rebuild", (Array:2))
  #35 /home/loginID/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/JobManager.php(133): civicrm_api("job", "group_rebuild", (Array:2))
  #36 /home/loginID/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/JobManager.php(66): CRM_Core_JobManager->executeJob(Object(CRM_Core_ScheduledJob))
  #37 /home/loginID/public_html/wp-content/plugins/civicrm/civicrm/api/v3/Job.php(118): CRM_Core_JobManager->execute(FALSE)
  #38 /home/loginID/public_html/wp-content/plugins/civicrm/civicrm/Civi/API/Provider/MagicFunctionProvider.php(89): civicrm_api3_job_execute((Array:2))
  #39 /home/loginID/public_html/wp-content/plugins/civicrm/civicrm/Civi/API/Kernel.php(150): Civi\API\Provider\MagicFunctionProvider->invoke((Array:8))
  #40 /home/loginID/public_html/wp-content/plugins/civicrm/civicrm/Civi/API/Kernel.php(81): Civi\API\Kernel->runRequest((Array:8))
  #41 /home/loginID/public_html/wp-content/plugins/civicrm/civicrm/api/api.php(22): Civi\API\Kernel->runSafe("Job", "execute", (Array:2))
  #42 /home/loginID/public_html/wp-content/plugins/civicrm/civicrm/bin/cli.class.php(122): civicrm_api("Job", "execute", (Array:2))
  #43 /home/loginID/public_html/wp-content/plugins/civicrm/civicrm/bin/cli.php(32): civicrm_cli->callApi()
  #44 {main}
  
  **Tags:** wordpress, upgrade
  
  > **Comments:**
  > **username_0**: I should add that WordPress has sent me an error email.  In part, it reads: An error of type E_ERROR was caused in line 832 of the file /home/[loginid]/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/Error .php. Error message: Maximum execution time of 300 seconds exceeded  
  > **username_1**: Look in [ConfigAndLog](https://civicrm.stackexchange.com/questions/15931/where-are-the-configandlog-and-templates-c-directories) and see if there's a more detailed error. Also note https://civicrm.org/blog/kcristiano/civicrm-526-and-wordpress-important-notice for 5.26 in between, so if it seems related to that you may want to go to 5.25 first.  
  > **username_0**: Thank you username_1  
  > **username_1**: Hmm that error message about mailboxes doesn't seem related to an upgrade. It's from cron where you have bounce processing or the email processor scheduled. Anything else that looks upgrade related?  
  > **username_0**: My ConfigAndLog directory has 25 files.  When I view the one with a ".log" extension, it is over 1000 pages long (when opened by LibreOffice).  Granted, I'm not sure what I'm looking for, but there doesn't seem to be anything related to my attempted upgrade.  
  > **username_0**: Unfortunately, now I face a significant problem.  When trying to perform a less ambitious upgrade, to 5.25, I find that when I point my browser to the upgrade url I get the error:  "Sorry, due to an error, we are unable to fulfill your request at the moment. You may want to contact your administrator or service provider with more details about what action you were performing when this occurred. Database check failed - the database looks to have been partially upgraded. You may want to reload the database with the backup and try the upgrade process again"  
  > **username_1**: Do you have a backup of your mysql database? If so then if you can restore that you would want to do that before re-starting the upgrade. If you don't, your best bet would be to manually update the version field in civicrm_domain, e.g. `UPDATE civicrm_domain SET version='5.16.2';`, or maybe 5.19.0 since you said it stopped around 5.20. For the log file, I'd search for the word "upgrade" - somewhere it should say something like "starting upgrade".  
  > **username_0**: I do have a backup file created by cpanel: loginID_civicrm_wp.  I used cpanel to restore this file, but unfortunately Wordpress still won't allow the upgrade url to function.  Possibly your "UPDATE" command is executed at the prompt?  I will find tutorials to help me learn more about that.  Thanks for your continued assistance.  I've updated my original post with a more recent log entry.  
  > **username_1**: I don't recommend running the update command, it's just as a last resort if you can't restore. Restoring should allow you to try the upgrade again so I'm not sure why it won't.  
  > **username_0**: username_1, you have been very kind.  Inside CiviCRM, the status page indicates that I am running version 5.16.2, and that there are many patches available.  BUT, at the bottom of the page, there is a message indicating "Powered by 5.25.0", with a red system status alert.  If I might ask.  Is the "UPDATE" command above, performed at the main system prompt?  When I type "update" at the bash prompt, I am told that the command is not found.  
  > **username_1**: I misread your comment so am deleting my old comment and re-commenting: Right the one at the bottom is coming from the code files, and the one on the status page comes from the database. That's how civi knows you need to run the upgrade. But I'm not sure why it won't let you then just run the upgrade from the status page. The UPDATE command would be something you type into phpmyadmin or mysql, it's a SQL command not a shell command. But if you're seeing 5.16.2 on the status page then that's not the problem.  
  > **username_0**: Thank you, again, username_1.   I did find phpadmin in cpanel, but selecting the database and running your command only gave errors.  I don't know how to use the tool, so best to back out and not wreck more destruction. :)  As you can tell I am a volunteer with limited expertise.  I think that I've messed things up quite badly.  
  > **username_1**: Good luck. Yes if you can do a full restore then you can always try again some other day. That's how everyone learns! Or maybe someone else will see something obvious here.  
  > **username_2**: Getting back to an earlier version is your best bet for moving forward. When you try to upgrade again, I would ensure that logging is disabled (Administer->System Settings->Misc) and that InnoDB fulltext search is also disabled (Administer->Customize Data->Search Prefs) before you do the upgrade. I have found both options can trigger the kind of DB upgrade failure you saw at first. I have never found a recovery path that didn't involve going back to the earlier working version in it's entirety.  You can re-enable either or both after the upgrade.  
  > **username_0**: Thank you, username_2.  With the help of our hosting company, I have managed to get back to where we started via backups.  When I make another attempt at the upgrade, I will follow your kind suggestions and let you know how it went.  All of our memberships renew on Dec 31, so the database is being updated with some frequency.  I will wait a bit for others to finish their work, before making another upgrade attempt.  
  > **username_0**: Upgrade began at New Years, finally completed over Easter.  Rather than one large step, I began the update this time, in many small steps.  As many as I could tolerate.  These smaller changes all took place without incident.  Whatever the issue may have been, isn't duplicated when the changes are more conservative.  Thank you to all who offered help above.  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_0 on 2021-04-10. Score: 1
  
  When attempting an upgrade, always approach it in many smaller version increments, rather than one large leap. I wish that this guidance had been provided somewhere. It would have saved me a lot of grief.
  
  
  ---
  
  ### Answer by username_3 on 2021-05-10. Score: 0
  
  I know this isn't helpful for the current issue but when upgrading I create a copy of the database and zip file of the CiviCRM files - both with the version number as part of the file name. That way I can do multiple upgrades in quick succession and step back to specific versions if one of them gets stuck.
  
  
  ---
  
  