Trouble with migration when updating a site 2.3 -> 3.0

Hi all,

I am in an upgrade process for a Neos site from 2.2 to 3.0. The step 2.2 -> 2.3 went fine, all migrations succeeded. I am currently stuck in ./flow doctrine:migrate and am facing errors as such, all were errors of being unable to drop foreign keys or indexes:

An exception occurred while executing 'ALTER TABLE  neos_media_domain_model_adjustment_abstractimageadjustment DROP FOREIGN KEY FK_84416FDCA76D06E6':

SQLSTATE[42000]: Syntax error or access violation: 1091 Can't DROP 'FK_84416FDCA76D06E6'; check that column/key exists

I already tried fiddling arround with adding the missing indexes and keys manually by hand but that seems not the right approach. Also fiddling with the packages migration files is definitely not the right way.

Is there any best practice of how to resolve inconsistencies of the DB?

Best
Robert.

1 Like

Hi Robert,
sorry I don’t have a solution yet, but I’m facing almost the same problem:

An exception occurred while executing ‘ALTER TABLE neos_media_domain_model_asset_tags_join RENAME INDEX idx_daf7a1eb48d8c57e TO IDX_915BC7A248D8C57E’:

SQLSTATE[42000]: Syntax error or access violation: 1176 Key ‘idx_daf7a1eb48d8c57e’ doesn’t exist in table ‘neos_media_domain_model_asset_tags_join’

thanks for any help
robby

Hi,

remembering my problems on migrating from 2.2 to 3.3 …

  • there was a doctrine migration Version20160212111357 introduced in one of last 2.3 update in the Flow package, which adjusted some indexes …

NOT migrating this migration Version20160212111357 (delete it before migrating from 2.3 to 3.0) solved my problem :slight_smile:

(apparently these adjusted indexes did not match any more with the corresponding typo3.media package ? )

people who did migrate before this 2.3.13 (?) version or who did not have the Media package involved did not have this problem, - I guess …

Hope this helps
Christoph

1 Like

Hi Christoph,

thanks for your hint. Neos.Media is also involved in my case and I can confirm removing Version20160212111357 as also solving my issue.

Best
Robert.

I had a very similar issue when I tried to upgrade from Neos 2.3 to 3.0 with the doctrine:migrate
I got strange index and foreign key errors.

I couldn’t find the migration Version20160212111357 so I had to find a different way.

I was starting from Neos 2.2 so I upgrade first to 2.3 without any issue.

My solution to upgrade from 2.3 to 3.0:

  1. Make sure all 2.3 migrations are applied
  2. Not sure if necessary, but I removed all thumbnails with ./flow media:clearthumbnails
  3. Made a MySQL Dump with the content only, no structure or something. Just the content.
  4. Delete all tables in your database
  5. Make a ./flow doctrine:migrate still with Neos 2.3. All tables etc. will be created again
  6. Deactivate foreign_key_check in your MySQL database SET foreign_key_checks=0
  7. Import your exported content dump again
  8. Activate foreign_key_check in your MySQL database SET foreign_key_checks=1
  9. Update to Neos 3.0 and make the ./flow doctrine:migrate

This worked for me, and migration has been successfully completed.

Hope this helps someone else as well

1 Like