Saturday, August 6, 2011

Moving Wordpress to a different domain—What I've learned!

Ok, a little background on what I'm up to: I've been designing websites using Wordpress. I love how customizable it is once you find a good theme and play with the code and images, and how easy it is to add plugins like a simple "Contact Us" page. And I also love that I only have to bother my developer brother a little (instead of relying on him completely) to get my sites up and running.

Check out the latest Wordpress page that I designed here: http://www.vesselhead.com.

As a designer, i always try to put websites up on a temporary page to finalize the design, before publishing them to their true domain. However, moving the sites from their test location to their final one is always a struggle. I've tried 3 different lists of instructions: one from Wordpress, one from godaddy, and one from Webhostingpad; and have only ended up with broken pages, until last night.

Last night, this is what I attempted, this time trying webhostingpad instructions—DON'T try to do this since it's going to end badly. I copied all Wordpress files from the host page to the new page location on my server. It was quick since I'm using the same host. I went to myPHP, exported my testing site database called dverbels90. Then I created a new database in mySQL called dverbels300. I told the dvervels90 backup that it was now dverbels300, and uploaded the file. I then told my wp-config the name of the new database. I put this on the server hoping everything would magically work and...it didn't!

Something that the Wordpress instructions tell you to do, is go to your test admin page, and in settings, point it towards a new URL. I thought, this will either fix the new site, or leave me with 2 broken sites. The latter occurred (of course)! This is when I started getting creative.

First, I had to get my test admin page working again, and with an adjustment to the wp-content page, I fixed it. Ok, if you're following my instructions, this is where you should start:

I began by creating a couple different backups of my blog. I created a database backup by visiting the software installer that I’d used to install Wordpress on the test page, and clicking backup. Then I selected “Backup Database,” and saved that file to my computer. Then, I went to the test site under Tools / Export, and exported all the contents of the test site. Last, I made notes of any customization I had done to the test page.

So in total, to create my new site, I have:
  • A backup created in the Wordpress Admin page (xml file). Happily, any images you’ve uploaded as part of your posts will be saved. 
  • A backup created by my hosting service software installation page (sql file) 
  • Screenshots of my plugins, theme options, users, and widgets. If you use Akismet, take note of your API key. 
The trick is to use the Wordpress installation feature provided by your host (all the hosting services I've used so far have had this option). Install Wordpress onto your new domain as if it were a brand new site. Now, you should either copy the file "wp-content" from your current site’s FTP to your computer and then to the new site, or just drag it straight into your new site’s FTP, replacing the file that was installed automatically. Now you’ll have access to all the themes and plugins that you had selected previously.

On your new site, visit your host’s control panel under phpMyAdmin and import the sql file. Then, go to your Wordpress admin page and import the Wordpress xml file. Take a look at your site. Although the actual page will look really plain still, you have successfully imported all posts, pages, and menus.

Now you just need to to activate your theme, and redo all the theme customization options. Then activate the proper plugins. Your menus will be saved, so just put them in position.


All in all, bringing the new site "up to speed" on my customization choices took about 20 minutes, and this process will definitely become my new standard when putting Wordpress sites live.

No comments:

Post a Comment