Upgrade from 9.1.3 to 9.2.0 fails in hosted Testing Environment

Hi there,

Getting this error when trying to upgrade to 9.2.0 from 9.1.3 in a hosted Environment PHP 7.4:

Exception Occurred: /home/ifiv5be6/public_html/updates/concrete-cms-9.2.0/concrete/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php:128 An exception occurred while executing ‘ALTER TABLE OAuth2ClientScopes ADD CONSTRAINT FK_497E26F39ECFF1A8 FOREIGN KEY (clientIdentifier) REFERENCES OAuth2Client (identifier) ON DELETE CASCADE’:

SQLSTATE[HY000]: General error: 1215 Cannot add foreign key constraint (0)

Has anyone encountered this issue ?

Thanks & regards,


Just an update to this - which seems a bit strange.
Thinking that one or more past upgrades (from early V8 versions to 9.1.3) had led to DB problems with the OAuth* tables (which we haven’t utilized in a functional sense), I dropped the OAuth tables in our 9.1.3 environment and replaced them with the OAuth* tables from a fresh concrete install instance of 9.1.3. The same FK related error occurred on the same table OAuth2ClientScopes when I tried to the upgrade to 9.2.0.
However, I was able to upgrade to 9.2.0 successfully if I replaced our 9.1.3 OAuth* tables with those extracted from a fresh concrete 9.2.0 instance (which presumably already includes the FK entry mentioned in the error message).
So far all looks good with this upgraded 9.2.0 Test site. Are we likely to have problems with future upgrades, if we did follow the same procedure updating our Production site to 9.2.0 ?

Thanks & regards,


I reckon I’ve done something very similar myself to solve a problem once.

I’d be surprised if you hit any issues - if the database schema is exactly as would be expected by the currently installed version, there’s no actual difference for it to trip up on.

You can always try doing a Doctrine refresh via the dashboard - if that works fine, then all the doctrine entities match with their database mappings.

1 Like

Thanks @mesuva for your advice.