# Problem when updating from 8.5.12 to 9.2.1

**URL:** <https://forums.concretecms.org/t/problem-when-updating-from-8-5-12-to-9-2-1/5977>\
**Category:** Installation\
**Created:** [August 1, 2023, 12:08pm UTC](https://forums.concretecms.org/t/problem-when-updating-from-8-5-12-to-9-2-1/5977 "2023-08-01T12:08:22Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![mendesknabepr](https://forums.concretecms.org/user_avatar/forums.concretecms.org/mendesknabepr/32/3541_2.png) [@mendesknabepr](https://forums.concretecms.org/u/mendesknabepr)\
**Post date:** [August 1, 2023, 12:08pm UTC](https://forums.concretecms.org/t/problem-when-updating-from-8-5-12-to-9-2-1/5977/1 "2023-08-01T12:08:22Z")

</div>

The following problem or error occurs with the Remote\_Update from 8.5.12 to 9.2.1 (see error message below). Does anyone have an idea what to do?  
Thank you in advance for your help.  
Paulo

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: 1005 Can’t create table `mp_cms`.`oauth2clientscopes` (errno: 150 “Foreign key constraint is incorrectly formed”)

---

<div class="post-metadata">

**Author:** ![hrice88](https://forums.concretecms.org/user_avatar/forums.concretecms.org/hrice88/32/3495_2.png) [@hrice88](https://forums.concretecms.org/u/hrice88)\
**Post date:** [August 10, 2023, 4:49pm UTC](https://forums.concretecms.org/t/problem-when-updating-from-8-5-12-to-9-2-1/5977/2 "2023-08-10T16:49:15Z")

</div>

I get a message that says “Update Strongly Discouraged” when updating from 8.5.12 to 9.2.1, hoping to see some responses to this one.

---

<div class="post-metadata">

**Author:** ![EvanCooper](https://forums.concretecms.org/user_avatar/forums.concretecms.org/evancooper/32/4597_2.png) [@EvanCooper](https://forums.concretecms.org/u/EvanCooper)\
**Post date:** [August 17, 2023, 6:11pm UTC](https://forums.concretecms.org/t/problem-when-updating-from-8-5-12-to-9-2-1/5977/3 "2023-08-17T18:11:34Z")

</div>

Where are you getting this message @hrice88 ?

---

<div class="post-metadata">

**Author:** ![EvanCooper](https://forums.concretecms.org/user_avatar/forums.concretecms.org/evancooper/32/4597_2.png) [@EvanCooper](https://forums.concretecms.org/u/EvanCooper)\
**Post date:** [August 17, 2023, 6:13pm UTC](https://forums.concretecms.org/t/problem-when-updating-from-8-5-12-to-9-2-1/5977/4 "2023-08-17T18:13:18Z")

</div>

Hi @mendesknabepr - do you have any OAuth or secondary authentication services enabled on the site? Just trying to get a sense of what might give rise to something like this issue.

---

<div class="post-metadata">

**Author:** ![mendesknabepr](https://forums.concretecms.org/user_avatar/forums.concretecms.org/mendesknabepr/32/3541_2.png) [@mendesknabepr](https://forums.concretecms.org/u/mendesknabepr)\
**Post date:** [August 21, 2023, 7:41am UTC](https://forums.concretecms.org/t/problem-when-updating-from-8-5-12-to-9-2-1/5977/5 "2023-08-21T07:41:36Z")

</div>

Hello Evan,  
no, nothing like that is activated.

---

<div class="post-metadata">

**Author:** ![EvanCooper](https://forums.concretecms.org/user_avatar/forums.concretecms.org/evancooper/32/4597_2.png) [@EvanCooper](https://forums.concretecms.org/u/EvanCooper)\
**Post date:** [August 24, 2023, 11:01pm UTC](https://forums.concretecms.org/t/problem-when-updating-from-8-5-12-to-9-2-1/5977/6 "2023-08-24T23:01:48Z")

</div>

Also, is this on Windows? I’m seeing the lowercase table names. Might help to know the environment too. I’ll keep digging though.

---

<div class="post-metadata">

**Author:** ![EvanCooper](https://forums.concretecms.org/user_avatar/forums.concretecms.org/evancooper/32/4597_2.png) [@EvanCooper](https://forums.concretecms.org/u/EvanCooper)\
**Post date:** [August 30, 2023, 9:19pm UTC](https://forums.concretecms.org/t/problem-when-updating-from-8-5-12-to-9-2-1/5977/7 "2023-08-30T21:19:28Z")

</div>

All right I think I have a solution:

This comes from the database creating one table with one collation and the other with another. In some sites there’s a difference between the databases created during install and when Concrete adds tables during an upgrade later.

The fix is to make the `OAuth2ClientScopes` and `OAuth2Client` databases tables have the same collation. If they don’t you can use a command like

`ALTER TABLE OAuth2ClientScopes CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;`

to fix one or both of them.

Let me know if that does the trick.

---

<div class="post-metadata">

**Author:** ![mendesknabepr](https://forums.concretecms.org/user_avatar/forums.concretecms.org/mendesknabepr/32/3541_2.png) [@mendesknabepr](https://forums.concretecms.org/u/mendesknabepr)\
**Post date:** [September 8, 2023, 12:10pm UTC](https://forums.concretecms.org/t/problem-when-updating-from-8-5-12-to-9-2-1/5977/8 "2023-09-08T12:10:15Z")

</div>

![image](https://forums.concretecms.org/uploads/default/original/2X/a/aba9344007818827c96baf59918ad06f35238870.png)

Hello Evan, first of all thank you for your feedback on this issue and sorry for taking so long to respond. Unfortunately, I was no longer able to try out or carry out your approach. A friend of mine, who is a “guru” when it comes to SQL databases, has already helped me. He fixed all problems in the database. Unfortunately, I can’t even say exactly what he has changed or fixed. But now the update from 8.5.12 to 9.2.1 worked properly. Unfortunately, there is now another problem that I’m kind of stuck with. As I said, 9.2.1 runs clean. However, this is under PHP 7.4.9. But I have to update to PHP 8.x. I did this and now I have the following problem. (See attached screenshot). While I understand what the problem is here, PHP 8.x no longer supports \_\_autoload() like this, you have to use sql\_autoload\_register() instead. Unfortunately I have no idea “where” I need to adjust this.  
Do you perhaps have an idea?  
Once again, thank you very much in advance for your hard work.  
Paulo…

---

<div class="post-metadata">

**Author:** ![JohntheFish](https://forums.concretecms.org/user_avatar/forums.concretecms.org/johnthefish/32/3767_2.png) [@JohntheFish](https://forums.concretecms.org/u/JohntheFish)\
**Post date:** [November 15, 2023, 12:22pm UTC](https://forums.concretecms.org/t/problem-when-updating-from-8-5-12-to-9-2-1/5977/9 "2023-11-15T12:22:25Z")

</div>

I just came across this issue when updating a site from 9.1.3 to 9.2.2. The site started out way back in v7-point-something and it turned out many tables used outdated character sets and collations which resulted in in the core upgrade to 9.2.2 failing with foreign key errors (I am amazed it got as far as 9.1.3 without this issue showing up)

Rather than fix them all manually, I added a **Database Collation Fixer** to my Extreme Clean addon. This lists database tables with outdated collation and then fixes the collation and character set.

> **[Extreme Clean - Concrete CMS](https://marketplace.concretecms.com/marketplace/addons/extreme-clean1/)**
>
> Streamline your site by scouring obsolete pages, page versions, files and data.
