Support » Fixing WordPress » Will images be broken once I update DNS?

  • I’m currently building a site on a new host while the old site is running on it’s current host provider. So, to admin it I’m going to ip address/~username. I have never done this before so I’m just trying to anticipate any problems and one of them I’m wondering about is what happens to my images once I update the DNS? Is there an outlined process for doing this? I’ve got a week to sort it out…



Viewing 5 replies - 1 through 5 (of 5 total)
  • The process I normally take is this:

    Main website:
    Temp Site: (ip address etc..)

    Change your home & main website url to the ip address in WP. RE-upload or adjust all of your images if you are doing that, if you have already backedup and moved your images then no need to re-upload.

    Make your adjustments being careful NOT to hard code the ip address within the template files of WP.

    Right before you are ready to change the DNS I go into WP and alter my settings from the IP to the real website domain name. Next I open PHPMyAdmin and go to the table “wp_posts”.

    I then run a replace command and replace ALL ip addresses with the real website:

    UPDATE wp_posts SET post_content = REPLACE(post_content, '', '')

    This will replace all hard coded links to images or url’s you have in your content to the new site.

    Then alter your DNS and you should be fine. 🙂

    Awesome…I will give that a shot. I’m actually starting with a fresh install of WP and all fresh content (as per my clients request) so I’m not importing anything. This site should be easy based on your instructions but I have another client site that we’re doing the same thing but there will be hundreds of images so I’m concerned with that one.

    If its fresh then even easier – just make sure you do a replace (BACKUP BEFORE YOU DO ANYTHING THOUGH HAHA) on the content and you will be all set.

    With your other client, backup everything then do a replace for the domain so the images will load.

    Remember though, ALWAYS backup your database before doing a replace like that, if you mess up it can mean hours of work – or a quick import from a file. 😉

    So, just run that replace command and disregard the first steps you outlined in your first comment?

    In theory yes.

    Once you have the NEW fresh one ready to go right before you swap DNS make sure you go into WP and adjust your general site settings. Then do a replace on post_content to get all those nasty hard coded urls out of there. 🙂

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Will images be broken once I update DNS?’ is closed to new replies.