News:

Support the VirtueMart project and become a member

Main Menu

Moved servers, media files have old path

Started by GooRu, November 21, 2012, 02:33:57 AM

Previous topic - Next topic

GooRu

Hi...

I developed a site on my servers with downloadable products and everything tested well. I moved to the new server and now the media files that were associated with the downloads still have the old path in it. How can I can change it to the new?
Joomla Web Development, Hosting and site management

moe455

#1
I know this is an old post however I have just experienced the same thing. I check the Template safe path and it is correct however when a customer purchases a downloadable product the error message received states a different path. It happens to be the path that was on the old server. Is there a setting or cache that has to be set/reset?
Also I noticed that the product ID did not lign up with the product in the database. Here is the message I received after purchasing a downloadable product via PayPal and clicking on the download link in the invoice.

"Media file is not available (ID=68, path=/home/oldhost/vmfiles/in-him.mp3)"

Can someone please advise?

VirtueMart 2.6.14
PHP - 5.3.29
Joomla - Joomla! 2.5.14

jenkinhill

Use phpMyAdmin to check the product paths in the database.
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

Milbo

As far as I know, just edit your safepath and it should still work.
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

moe455

Milbo, I tried to change the safepath but got an error when I did, so I left it the same as the Global Config server setting for the Temp file with the suffix of vmfiles/ in stead of temp/

Jenkinhill, I looked in the virtumart_medias table and noticed that the path is incorrect in the field "file_url". It states "/home/oldhost/vmfiles/in-him.mp3". I take it that I will have to manually update this field in all the products. Its a variable - varchar(900) - so I guess there is no other place to update it. I will also try to re upload the mp3 file and see if that fixes the path.

Thanks

Milbo

You must set the safepath to your new correct path. then you must copy the files into your new path of course.

Then it should work, because I rewrote it so, that it just takes the filename and tries it with the new safepath. Could be also interesting to provide a slq here. I could also add a tool for it.
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

jenkinhill

Yes you will have to update the fields in the db. If you have a lot of products you could do it using SQL, or export a copy of the table and do a search and replace for oldhost/newhost then reimport. I alwayus take a backup copy of a db before making any edits.
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

moe455

Yes Milbo I have the files in the location of the new correct path. Any new product I upload works ok as the file_url in the table is updated with the new path. All the existing products still have the old path pre the migration. So I take it that by changing the safepath the products field "file_url" does not get updated. I'll try and remove the path and just leave the filename to see if it works.

moe455

Thanks Kelvyn, I don't have that many so a manual change is ok.

Rather than me purchasing the item again so I can test the path change, is there a counter somewhere that is incremented each time I download a paid product? I just want to click on the same invoice link of the same purchase for testing purposes.

jenkinhill

I have no idea. I'd guess some d/l plugins could do that, but none of the sites I have worked on are for downloadable products.
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

Milbo

In case you are using the virtual shipment plugin of istraxx, I can help you. If you are using another download software you must ask there.
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/