Answers.Body: <p>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 &amp; failed afterwards, or it might have run some sql &amp; not completed.</p>
  
  <p>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 &amp; figure out which ones it did &amp; didn't complete - eg.</p>
  
  <p><a href="https://github.com/fuzionnz/civicrm-core/blob/4.6/CRM/Upgrade/Incremental/sql/4.6.alpha1.mysql.tpl" rel="noreferrer">https://github.com/fuzionnz/civicrm-core/blob/4.6/CRM/Upgrade/Incremental/sql/4.6.alpha1.mysql.tpl</a></p>
  
  <p>There are also php functions so you need to evaluate those too
  <a href="https://github.com/fuzionnz/civicrm-core/tree/4.6/CRM/Upgrade/Incremental/php" rel="noreferrer">https://github.com/fuzionnz/civicrm-core/tree/4.6/CRM/Upgrade/Incremental/php</a></p>
  
  <p>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 &amp; remove the upgrade &amp; then start the script running again</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-08-25T18:54:28.860Z
Answers.Text: +1 this is an old answer but still works perfectly well - thanks!
Answers.UserDisplayName: Eli Lisseck
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-07-24T02:43:41.050Z
Answers.LastActivityDate: 2015-07-24T02:43:41.050Z
Answers.UserDisplayName: eileen
Answers.Body: <p>You can effectively reset the database structure by following the "Ensuring Schema Integrity" steps.  Instructions are at <a href="http://wiki.civicrm.org/confluence/display/CRMDOC/Ensuring+Schema+Integrity+on+Upgrades" rel="nofollow">http://wiki.civicrm.org/confluence/display/CRMDOC/Ensuring+Schema+Integrity+on+Upgrades</a></p>
  
  <p>This may cure the problems you're experiencing, or it may (via error messages!) illustrate where the database is no longer conforming. </p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-05-27T15:00:54.080Z
Answers.Text: This link is now dead, and I can't find the new location...
Answers.UserDisplayName: thoni56
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-06-27T18:04:11.610Z
Answers.Text: Have this problem updating Civi to 5.50.3 (and 5.51.beta1).   Failure version in database is at 5.48.alpha1.upgrade.   This after doing a manual install of Extended Report    Possibly related?
Answers.UserDisplayName: Dave T
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-06-28T20:42:28.407Z
Answers.Text: It could be related.  You can try disabling the extension before the upgrade and see what happens.  You can also settle for a partial upgrade ... go to v 5.47, make a new set of backups there, flush all the caches, possibly upgrade the extensions and then try again.
Answers.UserDisplayName: Eliot Mason
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-07-24T16:38:40.540Z
Answers.LastActivityDate: 2015-07-24T16:38:40.540Z
Answers.UserDisplayName: Eliot Mason
Body: <p>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."</p>
  
  <p>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?</p>
  
Tags: <upgrade><database>
Title: What can I do to fix my database that has been partially upgraded?
ThreadText: # What can I do to fix my database that has been partially upgraded?
  
  (Asked by: username_0 on 2015-07-23)
  
  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?
  
  **Tags:** upgrade, database
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_1 on 2015-07-24. Score: 6
  
  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
  
  > **Comments:**
  > **username_2**: +1 this is an old answer but still works perfectly well - thanks!  
  
  ---
  
  ### Answer by username_3 on 2015-07-24. Score: 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.
  
  > **Comments:**
  > **username_4**: This link is now dead, and I can't find the new location...  
  > **username_5**: Have this problem updating Civi to 5.50.3 (and 5.51.beta1).   Failure version in database is at 5.48.alpha1.upgrade.   This after doing a manual install of Extended Report    Possibly related?  
  > **username_3**: It could be related.  You can try disabling the extension before the upgrade and see what happens.  You can also settle for a partial upgrade ... go to v 5.47, make a new set of backups there, flush all the caches, possibly upgrade the extensions and then try again.  
  
  ---
  
  