migrating a wordpress site to a new domain

I previously pointed out the reasons behind needing and wanting to move content from one domain to another.

Moving your wordpress website from one domain to another is a tricky process. Aside from the problems you will have to deal with specifically with your site (links), you don’t want to damage your page rank and all the good SEO work you’ve done not to mention all your external links that have been built up over time.

These are the steps I took towards migrating justinavery.me to javerydesign.com

The overall approach I’m taking here is to install WP on a new server, back up the old site, restore it to the install, do a little dance.

  1. First step was to install WordPress
  2. Next problem was getting access to the wordpress site. Everytime I tried to get to javerydesign.com I was redirected off to the responsivedesign.is website. Once I FTP’d onto the server I noticed that I had previously added a .htaccess file to redirect all traffic. I’ll need another .htaccess file later on, so I just commented that out with # Redirect / http://alpha.responsivedesign.is
  3. Now that I can see the new site, it’s time to take a copy of the old site at justinavery.me. I FTP’d into the site and downloaded all of the content. This takes some time, especially if you’ve got an image rich site.
    Aside from the wordpress content I also had a dev subdomain, dev.justinavery.me, which I wanted to move across as well. This contained a bunch of testing areas I created for clients to demonstrate functionality and features. While that was downloading locally I started on step 4, the database.
  4. After spending 5 minutes trying to find my username and password for myphpadmin I realised that the plesk had a “download database” button. I downloaded the database as a justinavery.gz file. Now I needed to update the new javerydesign.com database with the old justinavery.me database. To avoid any issues, I also took a copy of the existing javerydesign.com database.
  5. Updating the database: Go to the phpmyadmin for javerydesign.com, selected the existing database and exported it for backup. Then head to the import tab and select the justinavery.sql database on you local. This broke my site. Forget the blue screen of death, I got the white screen of nothingness. No source code, no errors, just white. plain simple white. ARRRRGGGHHHH.
  6. Update the wp_options site url to your new URL and all is well again
  7. Next you will need to copy across all of your other wp-content files (your uploads, plugins, themes) and reactivate them all.
  8. Your site should be taking shape now, but you’ll probably find that a lot of the internal links are still pointing back towards the old URL. This is something which I think is a big drawback for wordpress (although easy to get over), realistically it should link to the page/post ID and rewrite to the url when it is processed. Anyway. You need to get the Update URLs plugin and that will give you the ability to update the urls from within wordpress (safer then running database queries)
  9. Finally it’s about sorting out Google and your SEO. You need to set up your new URL with Google Webmaster Tools and redirect your old url to your new one. As part of that they will ask you to include 301 redirects for your site. I’ve gone with the following to achieve the redirect.
    RewriteEngine on
    RewriteRule (.*) http://surfthedream.com.au/$1 [R=301,L]

    I advise you also update your existing Google Analytics settings to point to the new URL rather then recreating another instance and starting your page views all over again.

And that should be it I think.

As soon as Google register the redirects to the new domain I will remove the redirect and replace it with my one page resume.

You should probably note that any external links that are coming into to the old URL will not change and you will need to get in touch with those sites if you want them updated. For me it doesn’t really matter. The links are pointing towards the site and they’ll be able to see who it is and my other available sites.