Unable to update from v4.2.1 to 4.3.1 or 4.3.2

A GhostError occurred.

Message: Ghost was able to start, but errored during boot with: alter table `members_products` add constraint `members_products_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_products_member_id_foreign' are incompatible.
Help: Error occurred while executing the following migration: 02-add-members-products-table.js
Suggestion: journalctl -u ghost_hansendong-me -n 50

Debug Information:
OS: Ubuntu, v20.04.2 LTS
Node Version: v12.16.1
Ghost Version: 4.3.1
Ghost-CLI Version: 1.16.3
Environment: production
Command: 'ghost restart'

Additional log info available in: /home/blog/.ghost/logs/ghost-cli-debug-2021-04-22T15_14_23_687Z.log

Try running ghost doctor to check your system for known issues.

You can always refer to https://ghost.org/docs/ghost-cli/ for troubleshooting.

How can this problem be solved? What code should I execute to fix this problem

Please tell me how to roll back the old version

Thank you!

mysql> show variables like '%character%';
+--------------------------+----------------------------+
| Variable_name            | Value                      |
+--------------------------+----------------------------+
| character_set_client     | utf8mb4                    |
| character_set_connection | utf8mb4                    |
| character_set_database   | utf8mb4                    |
| character_set_filesystem | binary                     |
| character_set_results    | utf8mb4                    |
| character_set_server     | utf8mb4                    |
| character_set_system     | utf8                       |
| character_sets_dir       | /usr/share/mysql/charsets/ |
+--------------------------+----------------------------+
8 rows in set (0.05 sec)

mysql> 
mysql> show variables like 'collation%';
+----------------------+--------------------+
| Variable_name        | Value              |
+----------------------+--------------------+
| collation_connection | utf8mb4_0900_ai_ci |
| collation_database   | utf8mb4_0900_ai_ci |
| collation_server     | utf8mb4_0900_ai_ci |
+----------------------+--------------------+
3 rows in set (0.02 sec)
A GhostError occurred.

Message: Ghost was able to start, but errored during boot with: alter table `members_products` add constraint `members_products_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_products_member_id_foreign' are incompatible.
Help: Error occurred while executing the following migration: 02-add-members-products-table.js
Suggestion: journalctl -u ghost_hansendong-me -n 50

Debug Information:
    OS: Ubuntu, v20.04.2 LTS
    Node Version: v14.16.1
    Ghost Version: 4.3.1
    Ghost-CLI Version: 1.16.3
    Environment: production
    Command: 'ghost restart'

Additional log info available in: /home/blog/.ghost/logs/ghost-cli-debug-2021-04-22T19_34_36_395Z.log

Try running ghost doctor to check your system for known issues.

You can always refer to https://ghost.org/docs/ghost-cli/ for troubleshooting.
A GhostError occurred.

Message: Ghost was able to start, but errored during boot with: alter table `members_products` add constraint `members_products_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_products_member_id_foreign' are incompatible.
Help: Error occurred while executing the following migration: 02-add-members-products-table.js
Suggestion: journalctl -u ghost_hansendong-me -n 50

Debug Information:
    OS: Ubuntu, v20.04.2 LTS
    Node Version: v14.16.1
    Ghost Version: 4.3.2
    Ghost-CLI Version: 1.16.3
    Environment: production
    Command: 'ghost restart'

Additional log info available in: /home/blog/.ghost/logs/ghost-cli-debug-2021-04-22T19_49_09_660Z.log

Try running ghost doctor to check your system for known issues.

You can always refer to https://ghost.org/docs/ghost-cli/ for troubleshooting.

I think this is the same error people are reporting in this thread.

I saw it and tried to restore it all but couldn’t fix it…

My problem was solved.

1、Export database SQL file
2、Reinstall VPS system Ubuntu 20.04 LTS, and install the latest Ghost version
3、Temporarily set up a new VPS, install system Ubuntu 18.04 LTS, and install version 4.2.1. Import the SQL file. Go to the backend to export the data file and return to the second step to import.