This is for anyone having difficulties upgrading.

I spent a LONG time trying to upgrade the Wordpress version 4.4.4 of CiviCRM and had many problems.

I tried upgrading in small steps e.g. 4.4.4 > 4.5 > 4.6 > 4.7 but I could only get as far as 4.4.9.

I tried following the guide to rebuild a fresh database schema and import a data dump, but that failed.

When I used the built in upgrade facility I got errors such as:

ALTER TABLE civicrm_case DROP FOREIGN KEY FK_civicrm_case_case_type_id

So, here's what I had to do...

  1. Follow the CiviCRM upgrade guide to BACKUP YOUR DATABASE, upload the latest version of Civi and your settings file.
  2. Start the upgrade process by going to: admin.php?page=CiviCRM&q=civicrm/upgrade&reset=1
  3. If the upgrade process throws an error, note which process was being done when the error happened. In my case it looked like this: [Error: Upgrade DB to 4.7.18: SQL]. This tells you which sql file has the error.
  4. Find the corresponding sql file in civicrm/civicrm/CRM/Upgrade/Incremental/sql/ - in my case above it was: 4.7.18.mysql.sql
  5. Back on the error page, copy the offending SQL code. In my case it was: ALTER TABLE civicrm_case DROP FOREIGN KEY FK_civicrm_case_case_type_id
  6. Find that line of code in the sql file and comment it out.
  7. Upload the file
  8. Revert your database to your previous version and run the updater again

I had to repeat this process when upgrading from 4.4.4 > 4.5.0 and then from 4.6.31 > 4.7.23

I don't know if removing this step in the upgrade has any bad effects on CiviCRM but all seemed to work for me.

Could an expert let me know if this was an ok thing to do?

  • This also worked for me under Drupal. – Eric H Aug 22 '17 at 18:00

Your Answer

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

Browse other questions tagged or ask your own question.