I have transfered my database from my webhost and loaded it to localhost on my WAMP server. I first cleared the caches and emptied the watchdog table, then exported.
Imported OK and all my nodes appear but no pictures. If I look at the image path in firefox firebug for the webhost it is /sites/default/files/images/... as normal but on my localhost the image does not appear in a node until I prepend /foldername, then it appears. I have tried uncommenting the path in the settings file and adding the extra level for the localhost but the images do not appear. I have also tried setting the Drupal Administration File system path from sites/default/files to foldername/sites/default/files but it says the path does not exist.
I have cleared the cache during these operations.
Does anyone know how this can be resolved?
Comments
hi, i had this same problem
hi,
i had this same problem going from a localhost to a live server - the issue is that the database is looking in the wrong folder. I don't really know php coding so couldnt' tell you how to alter the database but I think a rookie way to fix this would be to create the file structure on your local host that the database is looking in (i.e. create the specific folders your database is looking for and move your pictures there...).
I solved my problem by reuploading all my images (luckily there was only 10....)
If you search the forums, there is a thread where someone discussed this and posted some php code to change the database. sorry i don't have the time to send you the link, i'd have to search for it as well. As an aside, the user said the code worked for them but it only worked to get my thumbnails working...
what module are you using for your images? I was using imachecache...
pete
Toronto Website Developer
Thanks Pete, I see tht when
Thanks Pete, I see that when the images are inserted with FCKEditor the path is inserted in the DB as a local URL. This presumably is not be intepreted then and any prefix added. So I have to go through the DB and insert the extra bit (/wlvh) being the folder they are in on the localhost.
I could do with a DB SQL that does a one pass replace of "/sites/default/files/images" with "/wlvh/sites/default/files/images". Any offers?
Or I could patch the .htaccess in the local site which adds that to any URL as above. Again I'm not any expert here so any suggestions welcome.
Hi Two extensions that might
Hi
Two extensions that might help are http://drupal.org/project/scanner or http://drupal.org/project/pathologic.
Thanks I'll look at these
Thanks I'll look at these although I am looking for a DB script that will replace part of a URL as one of the problems is a slight path change needed for images in nodes.
other thread
here is the link to the other thread i used. you'll see in the second comment it talks the query to run in phpmyadmin.
http://drupal.org/node/628130
i'm not too familiar with databases and queries so i could only get it to work for thumbnails...
Hope this helps. if you are able to get your images working, it would be awesome if you can post your solution here...
pete
Toronto Website Developer