Migration owncloud 10.2.1 to NC 12.0.12 An exception occurred while executing 'DROP TABLE oc_accounts'

hello everyone,

I’m trying to switch from Owncloud to NC right now.
I loaded and executed Nextcloud migration tool.
No problems

/occ upgrade
error

Exception: Updates between multiple major versions and downgrades are unsupported.
Update failed

Cange in config my version 10.2.1 to 10.0.0.12

ok get it ,)
New error
/occ upgrade

Doctrine\DBAL\Exception\ForeignKeyConstraintViolationException: An exception occurred while executing ‘DROP TABLE oc_accounts’:

SQLSTATE[23000]: Integrity constraint violation: 1451 Cannot delete or update a parent row: a foreign key constraint fails
Update failed

I’ve been looking for a solution for two days now.
but nothing brings me further ,((
I hope you can help me.

Thank you very much

I think, Nextcloud needs to review the migration scripts again. This is due after major upgrades on either side, perhaps @jospoortvliet can tell when this is scheduled for the next time.

oh ok, then it’s the script.
that’s good to know, because i already tried everything.
with no success ,(

Then I hope for a fix ;))
Many thanks

I’ve got the same error :slight_smile: You are not alone :smiley:

OK i found A way in :wink:

Find the foreign keys

SELECT CONSTRAINT_NAME FROM INFORMATION_SCHEMA.KEY_COLUMN_USAGE WHERE REFERENCED_TABLE_SCHEMA = 'YOURDATABASENAME'

This will give you the key of the foreign key to delete.
Then remove the keys

ALTER TABLE oc_persistent_locks DROP FOREIGN KEY FK_foreignkey

Then run your upgrade and it should be Good :smiley:

2 Likes

oh nice :wink:

Then remove the keys

ALTER TABLE oc_persistent_locks DROP FOREIGN KEY FK_foreignkey

Then run your upgrade and it should be Good

how i make this?
many thanks

Hi, simply put it in your phpmyadmin ( if you have one), in the SQL query tabs. Or connect to your sql server and enter the 2 sql query :slight_smile: It’s pretty simple :slight_smile:

1 Like

many many many thanks it´s works ;)))

Have you any idea.
as I already have with a shared folder
see all admins — with if the folder was shared (name)
here is the problem https://stackoverflow.com/questions/57536512/show-shares-for-all-admins