Answers.Body: <p>When you do an import of an previous version of your database, you should first delete all the views / table because newer version of CiviCRM often create new tables that don't get deleted when you put the backup back.</p>
  
  <p>If you do not want to (or can't) start the full update, you should :</p>
  
  <ol>
  <li>look at domain table column version and find the version where it has crashed (e.g. 4.7.beta3)</li>
  <li>go into CRM/Upgrade/Incremental/sql and find the last successful sql query - should be in the version immediately following your current version (e.g. 4.7.beta4.mysql.tpl if your version is 4.7.beta3)</li>
  <li>get all the queries from the file you found and run them (e.g.  4.7.beta4.mysql.tpl) - you might have to change the .sql to change token (e.g. {$domainID} => 1, assuming you only have one domain)</li>
  <li>change the domain::version to the new version (e.g. 4.7.beta4) in your database</li>
  <li>check for any specific code in CRM/Upgrade/Incremental/php/FourXXX.php to check for specific upgrade code</li>
  <li>relaunch the upgrade - it should be able to finish the upgrade</li>
  </ol>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-09-21T18:30:30.223Z
Answers.LastActivityDate: 2016-09-21T18:30:30.223Z
Answers.UserDisplayName: samuelsov
Body: <p>tl;dr: After a failed upgrade, is updating the table structure enough?</p>
  
  <p>I had a failed upgrade due to a mysql crash a few days ago (4.7.6 to 4.7.11). The database worked fine once mysql was back up, but I had a warning about a partial upgrade. Putting the backup back in place and rerunning the upgrade didn't do the trick, so I went table by table, comparing it to a successful upgrade, and updated the table structures accordingly. I then went into the domain table and updated the version number. Assuming the table structures are perfectly updated, are there factors I haven't considered?</p>
  
Tags: <upgrade>
Title: After a failed upgrade, is updating the table structure enough?
ThreadText: # After a failed upgrade, is updating the table structure enough?
  
  (Asked by: username_0 on 2016-09-21)
  
  tl;dr: After a failed upgrade, is updating the table structure enough?
  
  I had a failed upgrade due to a mysql crash a few days ago (4.7.6 to 4.7.11). The database worked fine once mysql was back up, but I had a warning about a partial upgrade. Putting the backup back in place and rerunning the upgrade didn't do the trick, so I went table by table, comparing it to a successful upgrade, and updated the table structures accordingly. I then went into the domain table and updated the version number. Assuming the table structures are perfectly updated, are there factors I haven't considered?
  
  **Tags:** upgrade
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2016-09-21. Score: 2 | Accepted answer
  
  When you do an import of an previous version of your database, you should first delete all the views / table because newer version of CiviCRM often create new tables that don't get deleted when you put the backup back.
  
  If you do not want to (or can't) start the full update, you should :
  
  1. look at domain table column version and find the version where it has crashed (e.g. 4.7.beta3)
  2. go into CRM/Upgrade/Incremental/sql and find the last successful sql query - should be in the version immediately following your current version (e.g. 4.7.beta4.mysql.tpl if your version is 4.7.beta3)
  3. get all the queries from the file you found and run them (e.g. 4.7.beta4.mysql.tpl) - you might have to change the .sql to change token (e.g. {$domainID} => 1, assuming you only have one domain)
  4. change the domain::version to the new version (e.g. 4.7.beta4) in your database
  5. check for any specific code in CRM/Upgrade/Incremental/php/FourXXX.php to check for specific upgrade code
  6. relaunch the upgrade - it should be able to finish the upgrade
  
  
  ---
  
  