How do you move a website to a new domain?

Welcome to my blog, please feel free to subscribe to my RSS feed, join me on Twitter or leave a comment.

“… changing your IP address, webhost, domain name, blog template, and blog version all at the same time is the exact opposite of what you should normally do. It’s better to change only one thing at a time so that if something goes horribly wrong, you can trace what caused it.”

 - Matt Cutts (http://www.dullest.com/blog/switching-things-around/)

Why move a website?

First and foremost, why would you move a website? Well there’s a few reasons that I can think of right off the top of my head:

  • Your old domain name was inappropriate
  • You lost your old domain
  • You decided to change focus
  • You started on a sub domain and related to a full

What ever the reason, sometimes we have to move domains so the real question is … how do you do it right?

How to move a domain properly

Moving WordPress

First, lets assume that you’re using WordPress.

  1. Log into your phpMyAdmin or control panel and export the WordPress database to an SQL file.
  2. Save the SQL to your hard drive and open it in a text editor
  3. Search for the path of your old domain (i.e. thisismyurl.com) and replace it with your new domain (i.e. getawaygraphics.com) If you’re changing the path, (/blog/) to the root or something as well please make sure to search for the whole string!
  4. Search again! 
  5. Change your server paths. This is a UNIX friendly path that the server uses to identify where you are on that hard drive. For example it may look like /var/www/t/thisismy/public_html/. If you don’t know your server path use my phpinfo() plugin for WordPress to find it.

Installing WordPress on a new domain

Now that you’ve altered your SQL for your old WordPress website,

  1. Install a copy of WordPress on your new domain
  2. Open your phpMyAdmin or control panel and paste the edited SQL into your SQL query box
  3. Wait …
  4. Open your new website in a separate web browser. Assuming everything worked, you should be up and running.

One final note, I always like to re-save my permalink options at this point to ensure the server writes a proper .htaccess file as sometimes it seems to act up.

Search Engine Optimization for the new domain

Next, you’ll want to make sure that the search engines know that you’re new domain is the correct domain and that your old domain is no longer active. You can do this using what is called a 302 redirect. Pretty fancy right? Not really, we’re geeks but … it’s important and that’s where Matt’s post Switching things around comes in handy.

10 Responses to “How do you move a website to a new domain?”

  1. Peter says:

    I am glad I found your website. I have been procrastinating moving one of my websites, but now I think I have no reason to delay it anymore

    portable color scanners’s last blog post..What to Look at When Buying a Portable Color Scanner

  2. Andrey says:

    Sometimes it is necessary to transfer /wp-content/uploads folder from your old domain.

  3. Chris Monty says:

    I just did this not too long ago when we moved Monty’s Mega Marketing over to Blippitt.com. It’s really not that bad once you know what to do.

    Chris Monty’s last blog post..Swine Flu Hits Middle East, Asia Pacific

  4. Brett says:

    do people still abuse the 302 redirect for pagerank gain? google must be onto that by now?

    Brett’s last blog post..Threat Level raised to 5

  5. personal Injury Lawyer says:

    It may take several weeks or months for the old rankings
    to be passed on to the new site. Therefore don’t remove
    your old domain name, web site or web pages just yet.

  6. Mike Collins says:

    One more thing is to test everything out once the switch is complete. Make sure you didn’t miss anything like broken links or missing images.

  7. game-girl says:

    It is a very nice description of solving a great problem ,now I know what to do in a problem situation.

    game-girl’s last blog post..Любовники скачать фильм онлайн

  8. I simple guide Chris, but the phpadmin area might be confusing for those who are not to familiar with databases. I think are more in-depth guide would be worth alot. (No I’m not going to write it:))

    Casper @mymoneyblog.info’s last blog post..Japanese Candlesticks – Part Two: Doji

  9. RichardMoog says:

    Thanks for sharing this useful information.
    Great post,I will have a look at your other posts and add your blog to my favorites.

    RichardMoog’s last blog post..Yes, You Can Make Money With Parked Domain Names – Find Out How

  10. Rather superb post, definitely helpful stuff. Never thought I’d discover the info I want in this article. I have been looking all around the internet for a while now and had been starting to get discouraged. Thankfully, I stumbled onto your blog and got precisely what I was browsing for.

Leave a Reply