1

I have run into this problem on two of my websites that run Civicrm separately. Both are running version 4.5.8. When I run the automatic installer, the update process seems to freeze for an infinite amount of time and quits updating the database and all of the core files. With one of my sites, I was able to make a backup of the database prior to the error and reverted back to version 4.5.8, however, I wasnt able to make a backup of the other and now I am unable to update Civicrm at all, and it gives random errors when running certain tasks. I also am presented with the following error: "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."

What can I do to fix my database so that I can be able to update CiviCRM in the future or is there a way to bypass the database check and have it update CiviCRM without further error?

5

This is a tricky one to resolve yourself. You basically need to identify whereabouts in the upgrade it failed. For example it might have done all the tasks for a particular point version & failed afterwards, or it might have run some sql & not completed.

If you look in the db the civicrm_domain table has a field called version. Once you know where it got to you can go through the sql statements in that version's upgrade & figure out which ones it did & didn't complete - eg.

https://github.com/fuzionnz/civicrm-core/blob/4.6/CRM/Upgrade/Incremental/sql/4.6.alpha1.mysql.tpl

There are also php functions so you need to evaluate those too https://github.com/fuzionnz/civicrm-core/tree/4.6/CRM/Upgrade/Incremental/php

Once you know where it fell over you can evaluate what needs to be applied to get it to the next point version. Once you have done all the things the upgrade script would have done to get to the next point version you can alter the value in civicrm_domain.version to the next point version & remove the upgrade & then start the script running again

2

You can effectively reset the database structure by following the "Ensuring Schema Integrity" steps. Instructions are at http://wiki.civicrm.org/confluence/display/CRMDOC/Ensuring+Schema+Integrity+on+Upgrades

This may cure the problems you're experiencing, or it may (via error messages!) illustrate where the database is no longer conforming.

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.