Ok, god helps those who help themselves!
I fixed the issue and I would suggest that the Magento team takes a note of this for a probable inclusion in subsequent fixes.
Step 1 - The media/upload directory is no longer used. The new version is looking for additional (more view) images in the media/product folder. Therefore I moved all my images in media/upload/0 (main image) folder to media/product folders using the mv command
The new version has created two new entities for media gallery “catalog_product_entity_media_gallery” and “catalog_product_entity_media_gallery_value”. First entity contains list of additional images and second entity contains whether an image is enabled or disabled. Earlier there was only one entity “catalog_product_entity_gallery”
Step 2 - Copy all media table entries from legacy entity “catalog_product_entity_gallery” to new entity “catalog_product_entity_media_gallery” using a command like
. Before doing this, make sure you empty the table “catalog_product_entity_media_gallery” by running
insert into catalog_product_entity_media_gallery (value_id,attribute_id,entity_id,value) select null,attribute_id,entity_id,value from catalog_product_entity_gallery where store_id=0;
- please use this command at your risk and always backup your database before such hacks. Also note that I only copied the rows where store id is 0 otherwise additional images will appear as many times as there are stores in your web site.
delete from catalog_product_entity_media_gallery
Step 3 - The new version has a new attribute set called media gallery whose attribute_id is 987. Legacy attribute_id for additional images was 271. Therefore I changed the attribute_id value in the newly filled “catalog_product_entity_media_gallery” entity by running
update catalog_product_entity_media_gallery set attribute_id=987 where attribute_id=271;
After these changes, all my additional images of the products were restored. The product details pages was showing all additional images and the backed admin started working fine as well.
Comments of whether this was right approach or not are solicited.