X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   Change Image locations back and forth many times (https://forum.x-cart.com/showthread.php?t=20980)

jc2002 04-06-2006 11:47 AM

Change Image locations back and forth many times
 
I changed the Image Location from database to file system successfully. But I need to change them back to database. Is this a problem?

What if I want to change them back from database to file system again afterwards? Is there any issue with that?

Thanks

balinor 04-06-2006 12:02 PM

Why would you want the images in the DB?

jc2002 04-06-2006 12:11 PM

I am moving the shop from /shop to the root directory. Based on earlier suggestions, the steps are to move images to DB first, then move all files, then move images back to file system. That is what I am doing, but I am not sure if there is any issue with this.

balinor 04-06-2006 12:14 PM

Ahh. I don't usually recommend that method as it renames all of the files (which will hurt your SEO image names), but if that is the way you want to do it you can switch them back and forth as many times as you wan t.

jc2002 04-06-2006 12:17 PM

What do you recommend to move the store to root?

jc2002 04-06-2006 12:18 PM

I don't like this method either.

balinor 04-06-2006 12:23 PM

Because the root directory is much more search engine friendly and visually appealing.

jc2002 04-06-2006 12:24 PM

Yes, that is why I am moving the store.
But is there a better way to do this?

balinor 04-06-2006 12:28 PM

I just move the files to the root, update config.php and run an SQL query to update the image path in the database, similar to this:

update xcart_thumbnails
set image_path = replace(image_path,'/store/','/')

jc2002 04-06-2006 12:32 PM

thanks!
do I run the sql for icon and detailed image as well?

balinor 04-06-2006 12:35 PM

Yep, same format, just change it to xcart_images and xcart_icons

jc2002 04-06-2006 12:59 PM

Do I need to change the image location in the Admin in X-cart after the DB update?

balinor 04-06-2006 01:26 PM

Change it before...but it usually doesn't make the change to the DB, which is why I used that SQL query :)

Realsecurity 04-10-2006 04:09 AM

image_path = replace(image_path,'/store/','/'
 
image_path = replace(image_path,'/store/','/' i have entered this into sql and it fails with errors is there something else to add or am i just being thick???? i have no idea about sql, i have an image directory i use for icons,thumbnails and detailed images, dont store in database as files is much better. where would one one enter the new details in this query???
any help much appreciated,


darren


realsecurity

balinor 04-10-2006 04:15 AM

You need to enter it exactly as I have posted above:

update xcart_thumbnails
set image_path = replace(image_path,'/store/','/')

Realsecurity 04-10-2006 04:53 AM

Just copied and pasted update xcart_thumbnails set image_path = replace(image_path,'/store/','/') into sql query box run and it didnt change anything stated 0 rows effected ???

balinor 04-10-2006 05:05 AM

Well, are you moving from the store/ directory to the root directory? Because that is what that query is for...

Realsecurity 04-10-2006 05:11 AM

Entered excatly as stated and it hasnt done anything other then state 0 lines effected when run the query!!!! what else can be done to get this resolved???

balinor 04-10-2006 05:15 AM

Yes, but the question is are you moving the site from the store to the root directory? Because you will have to alter that query if you are doing anything other than that.

Realsecurity 04-10-2006 05:22 AM

Basically on the same server using the SAME database i have moved folders, the server i have has upto 6 directories 6 domains. i have treated it as a change server as i have copied and pasted all files from one directory to another, i have changed image loaction in admin, and config is changed to new domain, img src left to "" now when going to realsecurity.co.uk it displays no images other then skin imgs.???? reallybaffled as to whats wrong???

balinor 04-10-2006 05:24 AM

What was the old image location and what is the new one?

Realsecurity 04-10-2006 10:30 AM

The old image location was /hsphere/local/home/realsecu/testxcart.co.uk/images_icons the new location is /hsphere/local/home/realsecu/realsecurity.co.uk/images_icons

so the only part thats changed is the testcart.co.uk to realsecurity.co.uk......

balinor 04-10-2006 11:29 AM

That's why the query didn't work for you. Here's one that should:

update xcart_thumbnails
set image_path = replace(image_path,'testcart.co.uk','realsecurity. co.uk')

See how that works? It is essentially a find and replace query...first one is the old one, second one is the new one.

Realsecurity 04-10-2006 12:21 PM

just ran this and same results 0 lines effected??? really strange, the image source on properties and view source i can see in view source it shows src="/image.php?productid=7" width="80" alt="Epson STYLUS 880/880I Colour" border="0">

when looking at image properties the path is set to http://www.realsecurity.co.uk/image.php?productid=6 whether this helps or not!!!

balinor 04-10-2006 02:00 PM

If you are seeing that as the image source, the images are still in the database.

Realsecurity 04-11-2006 12:31 AM

But in admin i have selected file, and set the location for thumbnails, icons, and detailed images. If i goto products and add image it appears on the site and goes into the foler location!!! but no images, or icons appear on the website, so there is no images in the database, but its calling database as the location then!!!! i have looked into the database for xcart_thummbnails and the location is infact set at testcart.co.uk ??? how can i change this to realsecurity.co.uk,i know this query you have mentioned but its not changing anything??? very strange

balinor 04-11-2006 03:09 AM

The images appear fine to me on your site and the image path appears to be in the file system

Realsecurity 04-11-2006 03:13 AM

hi, gave up with the query idea, ive gone into database and MANUALLY changes each part of the path that had testcart.co.uk with realsecurity.co.uk, it hasnt all changed yet, havnt done detailed images cant find this in the database anywhere>>>> i have found also there is lots of sample database items in there wich wastes space, gona look on the forum to see how to clean all that out!!! many thnks for your help.....

balinor 04-11-2006 03:17 AM

Detailed images are in xcart_images

Realsecurity 04-11-2006 06:13 AM

Hi, yeh i worked that out earlier, it seems to be ok now, although the database as a alot of junk init from the standard xcart installation, is there not a way to clean the database and remove everything thats not needed!!!


All times are GMT -8. The time now is 03:17 PM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.