Two clients have moved from flat-file sites to WordPress sites this week, and I’ve moved them both. Coincidentally, both were on GoDaddy, which presents its own challenges doesn’t it. But here are the steps that worked for me in moving their ready-to-publish sites from my staging server to their production servers.
- Go into phpmyadmin and export the staging site. Use the methods adequately covered elsewhere (such as here for which options to check. GoDaddy doesn’t play nicely with zip files, no matter what they imply, so just get a .sql file. Hang on to this for step 3.
- Copy over the whole wp-content directory from your staging site into Dropbox or a local drive. Get all your plugins, uploads and themes, along with any other files that plugins you’ve installed have put there.
- On the new host, create a new database. For some reason, GoDaddy applies its own special rules to MySQL, so if you use an underscore character in your database name, or the wrong kind of character in the password, you’ll need to change it.
- And then use the phpmyadmin “import” tab to upload the .sql script you downloaded in step 1. This will port all your settings, posts, pages and so on into a database at the new host. Later on we’ll set up the new blog to use this resource, so keep track of the database name, username and password.
- Open the wp_options table (or whatever you call it, hopefully you’ve changed the table prefix) and find the rows for “home,” “siteurl,” and possibly “admin_email” and update them to the new values.
- Take the old site files from the new production server, and move them into a backup directory. If you don’t do this, and you have an old file called “events.htm” and a new WordPress resource http://myblog.com/events, you may have problems.
- Run the WordPress installation script from the control panel. You’ll need to create a database, which you won’t actually use, but there’s no way around it.
- Copy all the files you downloaded in step 2 into the wp-content directory of the new site.
- Open the new wp-config.php file and make these changes:
- set the correct value for $table_prefix. GoDaddy doesn’t make this excellent security precaution available on their auto-installations.
- While you’re at it, add settings such as
for added security
- You’re also going to need to change the line for DB_HOST. Replace the chunk up to the first ‘.’ with the DB_NAME value.
- Fix all the internal links. Images and other links are going to be in the form of “http://mystagingsite.com/” instead of “http://mynewsite.com”. I like to use the “Search Regex” plugin. Install it, activate it, and find it under the Tools menu. Enter the search pattern “staging.mysite.com” and the replace pattern “www.netsite.com” and click “replace.” Study the results shown. Do they make sense? Click “search and replace.” You can then disable the plugin.
At this point, you should be good to go. You can then add other features, like security plugins, Google Analytics, or whatever else is required for final production.
Can I complain more?
GoDaddy is running PHP 5.2 by default, and one of my plugins won’t work. Fortunately, there’s an easy switch to 5.3.