I’ve been spending all of my waking time lately getting a frankensteinishly complicated website all put into a single WordPress install, using it as both as CMS and for posts (as news items). So I’ve managed to combine all of the static pages into the new site, and imported two separate WordPress installs into the single uber-WP (and that included converting all of the posts from one of those smaller WPs into pages).
Btw, I should probably mention that I did all of this development on a completely different domain.
So anyway, as I’m dangerously close to the point where I can flip the switch and turn the new site on, it occured to me that I’m not entirely sure what the best way is to go about doing it… so I’m asking for advice from those of you who know WordPress far better than me.
- Backup existing site
- Rm -rf * the entire directory to make sure it’s good and clean
- Install fresh copy of WordPress with fresh new database
- Export the contents of the development site using WP’s export feature.
- Copy the theme off the development site and upload onto the production server
- Turn theme on
- Import the file created by the export into the production WP.
I *think* that should work. I think.
The problem is that I have a couple of plugins (remnants from one of the two smaller WPs I had been using on the frankenstein site) that lose tables and data everytime I do the export/import thing because they have all sorts of extra tables associated with them. I won’t *die* if I have to start over with no historical data on those few plugins, but I’d like to avoid it.
Hence, option 2…
- Back up existing production site.
- Rm -rf * the whole directory to make sure it’s good and clean for the new WP install.
- Install WordPress fresh, but point the DB at the one currently in use by the development site.
- Copy the theme files from the development site and put them on the production site and turn on.
- Fix whatever is broken in the DB to make it work on the new domain.
I guess my hangup on going with option 2 is the “Fix whatever is broken in the DB to make it work” as I don’t know exactly what will break or how much of a migraine it will cause to try to fix it.
So is there anyone who’s done this before? Advice? Suggestions?
Thanks in advance for the help!
3 thoughts on “Question for WordPress Gurus…”
Option 1 won’t work if you are using ‘plugins’ that required you to make new columns /table in the db. And honestly wp export feature doesn’t always work that well. If you are only dealing with “content” then you can go ahead and use option 1.
Option 2 is going to be a bit complicated, firstly you need to understand that you cant just point your WP to your OLD DB because the OLD DB will reference to your old domain. [Open your wp-posts table using phpmyadmin to see what I’m talking about]. Hint: Look for the column ‘guid’ in the WP-Posts table.
Anywayz So before you can use that DB, you will need to edit/change all those references. Luckily there is a plugin to do that – http://wordpress.org/extend/plugins/search-and-replace/
So this is how I’d do it:
Firstly I’ll copy my whole HOME folder + DB (of the old domain) to the new domain.
Once I have transferred the home folder + Db in my new domain I’ll edit wp-config file and point to the new domain and db that I just copied.
I’ll use the search & replace plugin and do a search and replace for my old URL’s and change them with new ones.
Lastly I’ll do a 301 redirect of my OLD domain to the new domain using .htaccess [ This is only necessary if your Old domain’s content has already been indexed in the SE]
During this entire process, I’ll use robots.txt to block Search engines from my site.
Thats all .. Hope this helps =)
Btw a simmilar tutorial is here: http://archgfx.net/blog/2008/geek/blogging/migrating-a-wordpress-install-to-a-new-domain
The only difference is this guy is using a “Fresh WP install” and only copying the wp-content folder (which contains all your plugins, themes & images). Well this method will work too 🙂
If you’ve made any direct changes to the WP files themselves then it’s worth making a note of what you need to replicate on the new site.
It’s something I’ve had to go through each time I roll out a new WP version…
This is exactly the task I’m about to undertake – my business website is on Drupal which I don’t have time for the learning curve. I’ve been building a website using WordPress as the CMS and a Thesis theme. I’ve been nervous about the switch and this will be really helpful.
Also, you gave a great review of SEO basics and tactis at PubCon in Austin. You led off the Monday SEO Training where I sat front and center. Am putting it all into play now – Thanks!