# Migration error for site with no members

**URL:** <https://forum.ghost.org/t/migration-error-for-site-with-no-members/21424>\
**Category:** Developer help\
**Created:** [March 31, 2021, 5:18pm UTC](https://forum.ghost.org/t/migration-error-for-site-with-no-members/21424 "2021-03-31T17:18:26Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ScottSmith95](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/scottsmith95/32/4850_2.png) [@ScottSmith95](https://forum.ghost.org/u/ScottSmith95)\
**Post date:** [March 31, 2021, 5:18pm UTC](https://forum.ghost.org/t/migration-error-for-site-with-no-members/21424/1 "2021-03-31T17:18:26Z")

</div>

My Ghost blogs fail to migrate and all have no members/subscribers. When migrating to ghost v4 via the latest cli, they fail to migrate and are left in an unusable state, forcing me to reinstall.

### To Reproduce

1. Have a ghost blog with no members on the latest Ubuntu, Node, etc.
2. Upgrade from Ghost v3.42.4

```auto
Ghost was able to start, but errored during boot with: alter table `members_subscribe_events` add constraint `members_subscribe_events_member_id_foreign` foreign key (`member_id`) references `members` (`id`) on delete CASCADE - UNKNOWN_CODE_PLEASE_REPORT: Referencing column 'member_id' and referenced column 'id' in foreign key constraint 'members_subscribe_events_member_id_foreign' are incompatible.
Help: Error occurred while executing the following migration: 05-add-members-subscribe-events-table.js

```

Any other info e.g. Why do you consider this to be a bug? What did you expect to happen instead?

### Technical details:

````auto
OS: Ubuntu, v20.04.2 LTS
Node Version: v14.16.0
Ghost Version: 4.1.2
Ghost-CLI Version: 1.16.3
Environment: production
Command: 'ghost upgrade'
```v
````

---

<div class="post-metadata">

**Author:** ![Hannah](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/hannah/32/22_2.png) [@Hannah](https://forum.ghost.org/u/Hannah)\
**Post date:** [April 6, 2021, 9:20am UTC](https://forum.ghost.org/t/migration-error-for-site-with-no-members/21424/3 "2021-04-06T09:20:32Z")

</div>

UNKNOWN\_CODE\_PLEASE\_REPORT is usually caused by mixed collation across your database tables in MySQL. Did you upgrade MySQL or otherwise change collation?

This issue rears its head differently depending on what migration you run after changing collations, but there is a similar issue here:

> [@Ghost 4.1.0 errored during boot](https://forum.ghost.org/t/ghost-4-1-0-errored-during-boot/21006):
>
> Hi, folks, I’ve had a glitch on upgrading to 4.1.0. I got the following message. Message: Ghost was able to start, but errored during boot with: alter table members\_login\_events add constraint members\_login\_events\_member\_id\_foreign foreign key (member\_id) references members (id) on delete CASCADE - UNKNOWN\_CODE\_PLEASE\_REPORT: Referencing column ‘member\_id’ and referenced column ‘id’ in foreign key constraint ‘members\_login\_events\_member\_id\_foreign’ are incompatible. Help: Error occurred whil…

and here

> [@Migration error after upgrading from 3.32.2 to 3.33.0](https://forum.ghost.org/t/migration-error-after-upgrading-from-3-32-2-to-3-33-0/17104/3):
>
> Hi @Kevin, Thanks for your reply! I changed the database setup and tried again without success. I think it’s not so relevant since all updates worked fine until this release and I’m using this setup from some time ago.

Both of which have suggestions for how to diagnose and resolve the issue.
