1

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}
16
  • 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 – dw861 Dec 28 '20 at 5:32
  • 1
    Look in ConfigAndLog and see if there's a more detailed error. Also note civicrm.org/blog/kcristiano/… for 5.26 in between, so if it seems related to that you may want to go to 5.25 first. – Demerit Dec 28 '20 at 14:29
  • Thank you Demerit – dw861 Dec 28 '20 at 19:14
  • 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". – Demerit Dec 28 '20 at 20:41
  • 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. – Demerit Dec 28 '20 at 21:04
0

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.

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.