News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

Product images not showing after migration

Started by fanlokbun, April 25, 2014, 20:06:11 PM

Previous topic - Next topic

fanlokbun

Hi
I have just made a fresh start with Joomla 2.5.19 and Virtuemart 2.6.0.
http://www.staging.fordtractorspares.co.uk/
I have imported all the products in from Joomla 1.5.22 Virtuemart 1.1.4 with help from this feed:
http://forum.virtuemart.net/index.php?topic=113097.msg380510#msg380510

It has all worked ok but none of the images are showing up.

The directories all seem correct and I have checked the permissions are ok

When I manually add a product image it Shows up fine and goes to the same directory as the others. This is the one I uploaded:
http://www.staging.fordtractorspares.co.uk/index.php?option=com_virtuemart&view=productdetails&virtuemart_product_id=74&virtuemart_category_id=35

I am no expert with databases but it adds three lines to the mnoxd_virtuemart_medias database table and changes some parameters in the mnoxd_virtuemart_products table. None of the other products are in the 'medias' table so I am guessing that is where they need to be.

I have thousand of products can anyone point me in the right direction of a quick fix?

Many Thanks
Rob

GJC Web Design

Fixed I assume?  Seems so...

If so please add how you did.. always something for other users to learn from..

(didn't know tractors were so cheap.......)
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

fanlokbun

Sadly no not fixed yet. The tractors you are seeing on the front page have been added recently for testing purposes. If you go to any of the spares categories you will see there are no images.
e.g. http://www.staging.fordtractorspares.co.uk/index.php/tractor-spares-categories/gaskets.

I have tried a few things like tinkering with the database but to no avail. So I am still hoping for someone to come to my rescue.

(also sadly the prices on the tractors were made up by me and the tractors all sold years ago.)

Thanks for the bump anyway

GJC Web Design

Hmmm - can only be a path thing

either the images are in the wrong place or the database entry for the images is pointing to the wrong place

Can you confirm that there are images for the spareparts in /images/stories/virtuemart/product/  ?

If those images are there you should be able to reach them by the url

e.g. http://www.staging.fordtractorspares.co.uk/images/stories/virtuemart/product/ford6810a1.jpg 
(the file name will be the sparepart name)

I can see plenty of images in their but don't know what any particular name should be

http://www.staging.fordtractorspares.co.uk/images/stories/virtuemart/product/

I assume that there is images filled in in the product management?

if these are all good then the paths are wrong in the jos_virtuemart_medias table : look at the file_url column - they may be pointing at the old vm1.1 path

[attachment cleanup by admin]
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

fanlokbun

#4
Many thanks for the help GJC.

QuoteCan you confirm that there are images for the spareparts in /images/stories/virtuemart/product/  ?
Yes

QuoteIf those images are there you should be able to reach them by the url
Yes you can. This is product no 48827 image that is not showing:
http://www.staging.fordtractorspares.co.uk/images/stories/virtuemart/product/48827.jpg
With the spare parts the product sku and the image filename are the same.

QuoteI assume that there is images filled in in the product management?
In virtuemart product info under the image tab the images don't show. If I manualy upload the image it works fine. It adds the image to same directory with the number appended. This is one after I uploaded to product 48827 (it appended a '5' - 488275.jpg - this is my test product and this was the fifth upoad):
http://www.staging.fordtractorspares.co.uk/index.php/search?keyword=48827&limitstart=0&option=com_virtuemart&view=category

In the database this adds this line to the mnoxd_virtuemart_medias table: 


(59, 1, '488275.jpg', '', '', 'image/jpeg', 'product', 'images/stories/virtuemart/product/488275.jpg', '', 0, 0, 0, '', '', 0, 1, '2014-05-06 13:38:18', 436, '2014-05-06 13:38:18', 436, '0000-00-00 00:00:00', 0);


and changes some NULL parameters in the mnoxd_virtuemart_products table:


(74, 1, 0, '48827', '', '', NULL, 'LB', NULL, NULL, NULL, 'IN', '', 0, 0, 0, '2014-04-23 16:15:41', '', 0, 0, 'KG', NULL, 'min_order_level=""|max_order_level=""|step_order_level=""|product_box=""|', NULL, '', '', '', '0', 1, 0, '2009-10-20 19:29:06', 436, '2014-05-06 13:38:18', 436, '0000-00-00 00:00:00', 0),


I have tried tinkering with the database but am not that confident with what I am doing.

Thanks again

Rob


GJC Web Design

yes - but the question is what is the entry for the media id of that product in  mnoxd_virtuemart_medias BEFORE you change anything ?

GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

fanlokbun

No products at all in the mnoxd_virtuemart_medias after migration. It adds that line to the end of the table if I manually upload the image to the product.

The mnoxd_virtuemart_products table changes from this:

(74, 1, 0, '48827', NULL, NULL, NULL, 'LB', NULL, NULL, NULL, 'IN', '', 0, 0, 0, '2014-04-23 16:15:41', '', NULL, 0, NULL, NULL, 'min_order_level=null|max_order_level=null|step_order_level=null|product_box=null|', NULL, '', '', '', '', 1, 0, '2009-10-20 19:29:06', 436, '2014-04-23 16:15:40', 436, '0000-00-00 00:00:00', 0),

To this

(74, 1, 0, '48827', '', '', NULL, 'LB', NULL, NULL, NULL, 'IN', '', 0, 0, 0, '2014-04-23 16:15:41', '', 0, 0, 'KG', NULL, 'min_order_level=""|max_order_level=""|step_order_level=""|product_box=""|', NULL, '', '', '', '0', 1, 0, '2009-10-20 19:29:06', 436, '2014-05-06 13:38:18', 436, '0000-00-00 00:00:00', 0),

There is another table with all the products and the file paths to the images called mnoxd_vm_product:

(38, 1, 0, '48827', 'Fordson 2n/8n/9n oil Fordson 2n/8n/9n oil', 'Fordson 2n/8n/9n oil Fordson 2n/8n/9n oil', 'images/stories/virtuemart/product/thumbs/48827.jpg', 'images/stories/virtuemart/product/48827.jpg', 'Y', NULL, 'pounds.', NULL, NULL, NULL, 'inches', NULL, 0, NULL, '', NULL, NULL, NULL, 1256066946, 1260899436, 'Fordson 2n/8n/9n oil Fordson 2n/8n/9n oil', 0, NULL, '', 0, NULL, NULL, NULL, NULL, NULL, NULL),

The product description must be picked up from here as it isn't anywhere else but it is not picking up the file path for the images.

In short:
mnoxd_virtuemart_medias - Empty after migration but adds a line every image uploaded.
mnoxd_virtuemart_products - Entry changed on first upload as above.
mnoxd_vm_product - Had same entry since migration and does not change when I upload an image. The mnoxd_vm_product table appears to be the same as the jos_vm_product table from the old site running Joomla 1.5.22 and Virtuemart 1.1.4. All the other tables in the db look different.

Thanks

Rob


GJC Web Design

mnoxd_virtuemart_medias - Empty after migration but adds a line every image uploaded.

that is the problem - something went wrong during the migration and the images were never added

I assume all the corresponding entries are missing from  mnoxd_virtuemart_product_medias ? This matches product id to media id

mnoxd_vm_product is just the old products table from VM1.1

in VM admin Tools -> Tools & Migration -> DB Tools there is a Synchronize media to VirtueMart button.
I assume that will only enter the stray images in the mnoxd_virtuemart_medias  and make them available for selecting in the product admin..

Or more drastic steps  - entirely at your own risk - empty the tables and try another migration - "Reset all tables and do a fresh install" - guess its a judgement call on how much work you think it will be...

before doing anything back up!
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

fanlokbun

Yes that is more or less the conclusion I had come to. Perform the migration again. But if I follow the same instructions I will get the same result. The last line was not very informative:
QuoteThen I performed the migration lots of times, until I had it right. The shop config got messed up, had to install demodata first. Had to connect category images to categories adding entries to table through db, but essentially products, categories, and images were migrated
from
http://forum.virtuemart.net/index.php?topic=113097.msg380510#msg380510

If you know of an alternative migration method with more concise instructions please send a link.

I was trying to think of a way of adding the entries to the db tables using anither method like some fancy find and replace in a text editor.

Thanks for all your help.

jenkinhill

Kelvyn
Lowestoft, Suffolk, UK

Retired from forum life November 2023

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

fanlokbun

Thanks Kelvin it is good to know that you have heard good things. I came across it after doing the migration and it looked good but no reviews. It must be a new kid on the block. I might take a punt on that in a day or two and report back.

Cheers

Rob

GJC Web Design

Would only comment that I've done plenty of VM1.1 to VM2x migrations and had problems yes - but never a problem where the image entries weren't made...
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation