luceos if your own plan implies upgrading one version at a time, I think you will face so many troubles.
That's not what I did. I installed a fresh Flarum v1.6.2 without third party extensions and connected it to my old database (which includes tables for my third party extensions of course).
The migration process got interupted at this stage:
Cannot add foreign key constraint (SQL
: alter table `posts` add constraint `posts_user_id_foreign` foreign key (`
user_id`) references `users` (`id`) on delete set null)
This, it seems to me, is not related to third party extensions.
But I noticed something else: In my old database my tables where of the type MyISAM
whereas the new installation came with the InnoDB
type for all tables. So I tried to convert all my tables to InnoDB
. However, some tables could not be converted due to wrong default values for the created_at
field: auth_tokens
, email_tokens
, flagrow_files
, password_tokens
, recipients
. In the case of flagrow_file_downloads
it was the downloaded_at
field.
In these cases I had to change the affected field type to datetime
with the dafult value of NULL
, e.g.
ALTER TABLE `email_tokens` CHANGE `created_at` `created_at` DATETIME NULL DEFAULT NULL;
After that I could change these table types to InnoDB
too.
Now the migration process went further including adding foreign keys to the posts
table but it stopped at another point:
In Connection.php line 712:
SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '2-vi
ewForum' for key 'PRIMARY' (SQL: update `group_permission` set `permission`
= REPLACE(permission, 'viewDiscussions', 'viewForum') where `permission`
LIKE %viewDiscussions)
In Exception.php line 18:
SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '2-vi
ewForum' for key 'PRIMARY'
In PDOStatement.php line 117:
SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '2-vi
ewForum' for key 'PRIMARY'
Unfortunately I don't know what to do here. Strange enough, the table permissions
from the old forum database is now removed but the table group_permission
as to be expected in the new database structure has not been created yet either.
How could I solve that step (I have a database copy from the previous step)?