Notes on switching hosts

It has been about 24 hours since I initiated the process of switching web hosting companies. That I have done before. However, for the first time I was attempting to also bring over a WordPress database as well. Obviously the most important thing was to get my posts over. Secondary (although just about as important) were the comments. Settings and stuff can be easily replaced, posts and comments cannot.

So in this post I am going to write about why I am switching web hosting companies, what I did to export my WordPress database, and finally, what did I do to import it.

First off, I should comment about why I switched web hosting companies. Quite simply, my previous host is going under. Literally:

Several technical problems with our backend have corrupted critical portions of our billing and support databases. While we have tried to recover this data several times and enlisted the help of an outside agency our efforts have been in vain. Although security has been very good we’ve found several discrepancies in our logs indicating the damage may have been intentional. For these reasons we have decided to stop taking new orders and will eventually cease operation altogether.

All servers will be monitored and remain online until January 1, 2005. At this time each server will be shut down. Henceforth orders for new service will not be accepted and current customers will not have their credit cards charged for these final two months. We regret this decision but after putting our best resources to work it has become obvious that the damage caused by the corruption is irreversible.

We would like to thank everyone that has made the last year and a half a great one.

So obviously, I needed to switch hosting companies ASAP. Enter in Dreamhost. $9.99 a month is what I paid with Bloghosts, so that was good that I was jumping ship without paying extra. However, even better was clearly much better support and hopefully reliability compared to Bloghosts. Best of all, 800 MB of storage (300 MB increase if I remember right over Bloghosts) and 40 GB bandwidth per month (double I believe over Bloghosts). More for the same price is quite nice.

Within hours I was able to FTP everything to the new web server and configuring everything on Dreamhost’s panel. That part was easy. I couldn’t install WordPress however until my domain name’s DNS servers updated themselves completely to point to the new web host. That took until this morning (quite fast!). Once I could access my domain directly, installing WordPress was as easy as that 5-minute install WordPress is famous for.

Next to exporting and importing my WordPress database. The process of switching servers with WordPress needs to be improved big time to say the least.

I could use phpMyAdmin to export the database into a text file. Literally took minutes to do that That part was relatively easy.

However, importing this data was a source of frustration for me. Seemed like Bloghosts’ version of phpMyAdmin had a few bugs that introduced some weird characters into random lines of the exported data. So phpMyAdmin on the new server would choke when it hit those lines. So I had to manually go into the exported file, find these lines, take out the character that was choking (hoping that I don’t delete any other characters), and then try to reimport it. Sometimes I had to delete entire posts and/or comments because of this. Luckly, these random bad characters appeared only in a few test posts/comments, so I lost none of my important posts and comments.

That is the good news. The bad news? I had no clue how to read, write, and edit SQL to begin with. Being a geek, I was able to follow logic and trial/error to get it right. However, the non-geek or a geek who hasn’t been around as much as I have would trip up for sure on this.

Then I got errors with phpMyAdmin about duplicate post and comment numbers (I think). More posts and comments deleted (thankfully nothing important).

Oh and apparently phpMyAdmin imports everything up to the error. Of course there is no mention of this on the error screen. So I had to delete any lines that I could reasonably assume were imported, crossing my fingers that I was right. Then try to reimport again. Repeat after next error 20-100 lines down.

So here is my WordPress rant: why isn’t there an easy way to export/import the WordPress database built-in by default? Easy as in any fool can use it. Easy as in it could intelligently navigate errors. Easy that you can access it from the WordPress admin screen. Easy that you don’t have to go into the SQL dump and delete a character/line by hand when something chokes.

WordPress has done wonders in the usability department for blogs, but to have no easy method to export/import the database is just asking for troubles for experienced and especially inexperienced users. I might have been able to waste a hour hacking things together with glue and string while crossing my fingers, but I don’t know many others that can and will do it.

So ok, finally everything is imported. My blog appears to work, nothing is broken (as far as I can tell). The database is hopefully fully intact and functional after about 50 import attempts. I love WordPress. Just make export/import a tad easier next time, ok? Pretty please?

4 thoughts on “Notes on switching hosts

  1. It does surprise me considering that WordPress’ success is partly down to Movable Type offering an export mechanism 🙂 .

    I believe that a better export tool is in the works though, but don’t quote me on that.

  2. I’m in the process of moving my wordpress blog and yes, it SUCKS. I was really surprised that there was no easy way of exporting and importing my posts. I can’t get the database to import, and I don’t know a thing about mysql that I didn’t learn last night trying to read tutorials.


  3. I too am in the process of trying to move my blog to a new server. Exporting went just fine, but now I cant import on my new host. If I use the built in phpmyadmin import thing I get an error like:

    SQL-query :
    CREATE DATABASE `d60155072`
    MySQL said:
    Can’t create database ‘d60155072’. Database exists

    And if I try importing with a .sh file in my cgi-bin, I dont get any error at all, but it simply does not work.

    This is truly a pain…

Comments are closed.