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

db crash and now images are on wrong products

Started by bunglehaze, May 27, 2014, 19:49:14 PM

Previous topic - Next topic

bunglehaze

HI guys, I had a server/db outage yesterday and when it came back up again I have none of the product images linked to the products at all - they are all "no image available"

I have done the usual, repair and optimise db, backend of VM click tools and synchronise images but nothing has worked. I looked in the db and the product_media table seems to be the same as the last backup I managed to take though so I cannot see where the links between the product and the images in the products/categories folder etc is made.

The only thing that I can now see to change this is to go through each product and upload a new image manually which is really not something I wish to be doing.

Any other tips on where the product and image is linked up in the db so I can try and put this right again? It seems a very weak system if it can lose product images through a crash.

GJC Web Design

the images are linked to products in  `jos_virtuemart_product_medias`
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

bunglehaze

Hi GJC, that's what I thought. Something must be screwy with my VM2 if that is the case as I have used a slightly older backup with the SQL intact, emptied the table and then run the query to restore the data but the situation is still the same. To be honest it has me baffled as I know VM2 well enough to work this out but every avenue I explore seems to lead nowhere..

Is there any other place that the images are sym linked?

GJC Web Design

nope - even multiple images for one product are held there  - just with a different order id
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

bunglehaze

Very strange indeed... Well I guess all I can do is re-upload each image for each product again (yet another thing that has gone wrong with VM2 for me)

GJC Web Design

what is in the jos_virtuemart_product_medias table?

if the imgs are on the server and entered in the media table wouldn't a manual edit of the jos_virtuemart_product_medias be quicker?
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

bunglehaze

I ended up just reuploading them all, the images were there and there were numbers in the jos_virtuemart_product_medias table but from what I could tell there were not enough associations and the ones I checked were not linking to the right product id's.

It took a few hours but needed doing

AH

Not sure why shop owners never expect stuff to go wrong and then have nothing in place to resolve an issue

On the premise that you probably don't add products everyday

I recommend an automated database backup strategy

Use a cron job to backup and archive the database

Akeeba can be used to achieve this and can archive the backup to your preferred location

Note that I recommend a database backup only on this frequency

At least minimum of daily is a useful place to start
Regards
A

Joomla 4.4.5
php 8.1

jenkinhill

#8
I definitely agree with this. Regular backups are an important part of maintaining a business. My host runs a full backup of every site, including all mail on the site at that time. They do this every 6 hours. The backups are stored off site at another datacenter and kept for a minimum of 2 weeks. They are exact mirror copies so restoration is accurate and for an average site takes about 5 minutes.

Add in my weekly Akeeba backups stored in my office and on dropbox and I have most possibilities covered.
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

bunglehaze

Quote from: Hutson on May 31, 2014, 13:06:32 PM
Not sure why shop owners never expect stuff to go wrong and then have nothing in place to resolve an issue

On the premise that you probably don't add products everyday

I recommend an automated database backup strategy

Use a cron job to backup and archive the database

Akeeba can be used to achieve this and can archive the backup to your preferred location

Note that I recommend a database backup only on this frequency

At least minimum of daily is a useful place to start

Honestly, the reason for not having a backup was that I had just finished adding a load of new products and images when the crash happened so in this case I had not had a chance to do a backup of the new changes. That being said I understand the sentiment, orders could have been manually sorted out if I needed to restore and old backup (which I had done on a test domain, with the exact same problem returning again)

I don't understand the way the images are linked up though in the db, it is not as though the image name was listed anywhere I could see and numbers mean nothing when you are trying to fix an issue like this - surely using image names would be a much more robust system?

AH

The image is listed in the

db_virtuemart_medias

and linked in

db_virtuemart_product_medias

Regards
A

Joomla 4.4.5
php 8.1

bunglehaze

Aah, that's what I had asked for but only saw the product_medias table. That makes much more sense now, thanks

AH

Regards
A

Joomla 4.4.5
php 8.1