Do you use or administer OpenEMR? Take the General Satisfaction Survey to help improve the product

DB Error while trying to install V6 with an existing DB

How would I go about fixing this error. Right now we are running version 5.2 and we are trying to upgrade to version 6. Well more like installing the new version with an existing DB. While trying to do so I get this error.

ERROR. unable to execute SQL: 'DROP TABLE IF EXISTS patient_data’ due to: Cannot delete or update a parent row: a foreign key constraint fails

Process is usually the way to fix something like this. The process I take when upgrading is this.

  1. Export the current database into an SQL file
  2. Do a full install of the newer version and creating a new database
  3. Truncate the new database and import the previous database into the new
  4. Run sql_upgrade.php

This is what I do for a major version upgrade.

Thanks for the step by step process. You wouldn’t happen to know how to reset the TOTP Verification?

1 Like

Thank You! I really appreciate this as I couldn’t find a fix for this anywhere.

all the thanks goes to @joanwilly :slight_smile: