I got my first site ported from D7 to Backdrop without too much trouble. But the second site is a lot more complex and it not going as well. After I duplicated my database, I ran the update.php. Of course, there were a bunch of updates. I'm getting the follow error:

user module

Update #1007

  • Failed: PDOException: SQLSTATE[23000]: Integrity constraint violation: 1217 Cannot delete or update a parent row: a foreign key constraint fails: DROP TABLE {role}; Array ( ) in db_drop_table() (line 2884 of /home2/docubrai/public_html/backdrop/core/includes/database/database.inc).

I'm not sure how to get past this or troubleshoot it. Any help would be greatly appreciated!

Accepted answer

Perhaps you have a custom or contrib module with database table the is referencing the role table?

The role table has been removed in Backdrop 1, in fact the Update #1007 from `user` module is trying to delete that table.

Maybe if you have a module that is making use of that table via foreign key you can disable on the D7 side and try the upgrade again with the new database.

Comments

Perhaps you have a custom or contrib module with database table the is referencing the role table?

The role table has been removed in Backdrop 1, in fact the Update #1007 from `user` module is trying to delete that table.

Maybe if you have a module that is making use of that table via foreign key you can disable on the D7 side and try the upgrade again with the new database.

Thanks, the problem was the "Private files download permission" module. I found it with the following Mysql command:

SELECT TABLE_NAME, COLUMN_NAME, CONSTRAINT_NAME, REFERENCED_TABLE_NAME, REFERENCED_COLUMN_NAME FROM INFORMATION_SCHEMA.KEY_COLUMN_USAGE WHERE TABLE_SCHEMA = "my_database_name" AND REFERENCED_TABLE_NAME = "role";

Joe