1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Replace info in mySQL

Discussion in 'Databases' started by thecubehost, Jun 7, 2014.

  1. #1
    Hi there,

    I duplicated a wordpress site on another domain name. And I want to go into the database and change everything which contains "website1surl.com" to "secondnewwebsitesurl.com" so that all the images and what not are not being fed from the site at the previous domain.
    SEMrush
     
    thecubehost, Jun 7, 2014 IP
    SEMrush
  2. Nei

    Nei Well-Known Member

    Messages:
    106
    Likes Received:
    3
    Best Answers:
    1
    Trophy Points:
    170
    #2
    And what is the question? How to make these changes?
    Create the dump of site's database, manually replace "website1surl.com" to "secondnewwebsitesurl.com" and load the dump to the server.
     
    Last edited: Jun 7, 2014
    Nei, Jun 7, 2014 IP
  3. benaya

    benaya Well-Known Member

    Messages:
    97
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    131
    Digital Goods:
    1
    #3
    For wordpress you have option to dump as xml, in xml you can replace and import it. It will work
     
    benaya, Jun 25, 2014 IP
  4. chrislim2888

    chrislim2888 Active Member

    Messages:
    46
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    53
    #4
    Not only the image path in the database need to change, the posts path also need to reconfigure pointing to a new domain name. The easier way that I can think of is to export out the existing database, search and replace the domain name using any editor of your like, and then import it back to a new domain server.
     
    chrislim2888, Jun 25, 2014 IP
  5. benaya

    benaya Well-Known Member

    Messages:
    97
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    131
    Digital Goods:
    1
    #5
    Hey Chris, you can export the data from wordpress and replace with the domain name, I have done this one from wordpress.org to my domain its worked well
     
    benaya, Jun 25, 2014 IP
  6. crazy4warez

    crazy4warez Well-Known Member

    Messages:
    624
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    130
    #6
    crazy4warez, Jun 28, 2014 IP
  7. bellcom

    bellcom Active Member

    Messages:
    181
    Likes Received:
    29
    Best Answers:
    0
    Trophy Points:
    70
    #7
    That one is great and you can use on any site with mysql.
    I have found that using wordpress backup plugins don't always work 100% so its faster for me to move everything and use the above script to update the paths.

    Another good plugin that is just for updating paths is Velvet Blues
    https://wordpress.org/plugins/velvet-blues-update-urls/
     
    bellcom, Jun 28, 2014 IP
  8. Krellen

    Krellen Greenhorn

    Messages:
    38
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    18
    #8
    Or if you're a badass, you can just use SQL. Something like:

    UPDATE your_table SET your_field = REPLACE(your_field, 'website1surl.com', 'secondnewwebsitesurl.com') WHERE your_field LIKE '%website1surl.com%'
     
    Krellen, Sep 17, 2014 IP