Friday, January 30, 2009

Converting a WordPress blog to a 'One-Click Install' on DreamHost

We set up a WordPress blog on DreamHost a while ago for a client. It was a custom install due to a bunch of craziness related to him getting booted from his old hosting setup. It all worked fine, and then DreamHost sent me a "nag email" (their term) asking me to upgrade because the old version had security issues. Fair enough.

I had another site to upgrade, but it had been installed as a one-click install. The upgrade for that was one click (plus some backing up). I could have manually upgraded this custom install, but if I did that, I knew I'd have to continue doing manual upgrades. Therefore, I wanted to convert this custom WP install to a one-click install.

DreamHost didn't seem to have any instructions, but how hard could it be? Basically, the procedure was pretty similar to what you'd go through to move a WP from one server to another.

  1. Backup the database and the old site: I backed up the old DB using mysqldump, and I tarred up the old site.
  2. Export the old site: from the WP admin page, select Export and dump all authors.
  3. Create a new database in the DreamHost control panel. In theory, you could drop all the tables in the old DB and re-use it, but I was being paranoid, which paided off later.
  4. Move old site out of the way: just move the old site directory to a new name - e.g., mv site.com save.site.com.
  5. Create a new 'One-Click Install' WordPress site using Advanced Mode, since we had a custom theme and a bunch of other content (pictures). This was put in the new database. After DreamHost emailed me to tell me that was done, I logged in and changed the admin password.
  6. Import the old content from the Admin Import function. Actually, DreamHost's email included the URL for that page. One issue I ran into was the "user name" for the old posts: WP thought the old posts by admin were from some other user because in the old blog, the admin user had a different display name.
  7. Copy in the custom theme and other content from the old saved directory into the new blog site. Enable the theme. Set up Akismet - this is where having the old DB around was useful; I just looked in the wp_options table to find the API key instead of having to dig around for it.

enjoy,
Charles.

3 comments:

thinkahead said...

Hi Charles,

Thanks for this step-by-step guide, it'll prove very handy indeed!

Best Wishes,

John
web design hull

Jasper said...

The directory attached to the domain needs to be preserved I would say. So that I can select it under one click install in Dreamhost. So would it not be better not to move/rename the site, but empty the directory?

Charles Anderson said...

It's been forver since I did this, so I don't know for sure. But, I would think you're referring to step #4 in my instructions. Anyway, if these directions don't work any long on DreamHost, or if DH has posted such a tutorial, feel free to leave follow up info here.