Problems copying image name locations from one database to another

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • chazzy69
    New Member
    • Sep 2007
    • 196

    Problems copying image name locations from one database to another

    This is a little hard to explain but i will try to make it as clear as possible.

    Firstly here's the setup, 2 databases on 2 different servers (databases are identical) now within the first database is a bunch of locations to images, though instead of a full path it only includes the file name not an absolute path( e.g. image.jpg).

    Now im trying to copy the names to another database this is no problem but obviously the the images don't exist on the 2nd server so the file names point to no where.

    So initially what i want to accomplish is to somehow add the absolute/full url to the file name (e.g. http://www.google.com/image.jpg).

    Now because of the system im modifying, it retrieves the file names then adds its own path prefix to the images which is different between both servers),

    i.e. on the first server it will grab the file name (e.g. image.jpg) and add to it "http://www.website1/images/listing_img/" so when display it will look like "http://www.website1/images/listing_img/image.jpg".

    Now on the second server the image location will come out as "http://www.website2/realty/images/listing_img/image.jpg".

    So i thought maybe if i just copied all the images from server to other according to there corresponding directories, followed by copying the names i could get the images displayed on the second website. But upon investigating found the images directory to be overly large making this a bad choice.

    Now any ideas on how to achieve this would be greatly welcome,
  • dlite922
    Recognized Expert Top Contributor
    • Dec 2007
    • 1586

    #2
    Well the answer is simple, either copy the images over, or keep the first website active and put the original prefix in front of the image names.

    If you're switching servers, moving the images is inevitable. start a copy and leave it running overnight.



    Dan

    Comment

    • carmarri
      New Member
      • Dec 2009
      • 5

      #3
      You can copy the images from one server to the other one using and FTP library. If these images are stored on the db, itself it's simpler, just open 2 DB connections and copy the fields.

      I hope it helped


      -------------------------------------
      xatcom.net, diseƱo web

      Comment

      Working...