SQL Error when updating to utf8mb4 I have successfuly followed the instructions on the Drupal page for updating uft8mb4 except for 1 table which is pulling up the below errror:

https://www.drupal.org/node/2754539

Error
SQL query:


ALTER TABLE `file_managed` CONVERT TO CHARACTER SET utf8mb4 COLLATE 
utf8mb4_general_ci
MySQL said: Documentation

#1062 - Duplicate entry 'public://listings/4232.jpg' for key 'uri'


What do I do to be able to complete the updating?
The field uri has to be unique within the file_managed table. Apparently, in your old database (before updating to utf8mb4) this index was not created or not active and so your table got "corrupt".

Fix this by renaming the uri field of one of the records that refer to public://listings/4232.jpg to e.g. public://listings/4232_0.jpg and copying the image /sites/default/files/listings/4232.jpg to /sites/default/files/listings/4232_0.jpg (assuming that public:// refers to /sites/default/files/).

Note: just deleting one of the duplicate records will result in image/file fields pointing to no longer existing managed files, so better duplicate the file as described above.

If, afterwards, you want to get rid of those duplicate images, you can use my module duplicate images :)