From Blogger To WordPress


How I imported my Blogger blog to WordPress.

I, like many people, had trouble importing my Blogger blog to my hosted WordPress server. There are many different errors in the process that people describe. I couldn’t even get the import script to login to Blogger and retrieve the list of my blogs.

The solution that I found on the WordPress.org forums was to install a PHP server and WordPress on my PC, import the Blogger blog to that server, and export the DB to my public WordPress server. It wasn’t until recently that I finally decided to complete the process so I have decided to write it down. One main difference is that I avoid the DB merge step by migrating the DB in both directions.

This is inspired by a post by sueeeus that was inspired by a post by me. Sueeeus’ post if very helpful and I recommend a read – it is very similar to my own experience. I have decided to describe the process from my perspective for my own reference.

Setting up your local PHP server

  1. Install EasyPHP. It is a complete Apache+PHP+MySQL server package with a nice Windows installer. Just run the installer and follow the directions. Very easy.
  2. Run EasyPHP. It will start the Apache and MySQL servers all ready to go at http://127.0.0.1.
  3. Enable Curl.
    1. Right click on the “e” icon in the system tray and select Configuration->PHP Extention.
    2. Check “php_curl”
  4. Create the MySQL database. You have to do this regarless of whether you will be importing existing tables or starting from scratch.
    1. Right click the EasyPHP system tray icon and selecting Configuration->MyPhpAdmin.
    2. Under “Create new database” enter the name of your database and click Create.

Install WordPress on your local PHP server

  1. If you have already got a WordPress Blog started then copy all the files from that server to the “www” folder where you have installed EasyPHP, this is the default server root. The quickest way to open that folder is to right click on the EasyPHP system tray icon and select Explore.
  2. If you do not yet have a WordPress blog or want to replace it then start a fresh one on your local server following the directions at WordPress.org. See the next step for how to edit your wp_config.php file.
  3. Edit the wp_config.php
    1. Define DB_NAME to be the name of the database you created earlier.
    2. Define DB_USER to ‘root’.
    3. Keep DB_PASSWORD empty.
    4. Set $table_prefix to something other than ‘wp_’ if you want to create the tables with a different prefix or you are integrating a database that was using a different prefix.
  4. Once the database construction/copy is complete you should now have a WordPress blog on your PC that is either empty or matches your public blog.

Importing your Blogger Blog into your local WordPress Server

  1. Run the Blogger Import script on your local WordPress server. This can be found in the Admin interface under the Import tab. Make sure you backup your Blogger template before you start since the import script changes the template and it is not always restored correctly.
  2. Once this has successfully completed you should now have a WordPress server on your PC with all your Blogger posts imported.
  3. I have written some WordPress plugins to help finish where the import script left off http://notions.okuda.ca/wordpress-plugins/. The Blogger Image Import will copy any Blogger hosted images to your server. The Blogger Title Fix will fix the ugly titles created by the importer for those Blogger posts that did not have a title.
  4. You should do whatever cleanup is required and install whichever plugins you need before you migrate the Database back to your public server.

Copying your local server to your hosted server

  1. Copy the files from your local server to a new directory on your public server. This is so that you can switch the server quickly or go back to your old server if there is a problem.
  2. Move the database tables from the local blog to your live public blog. See “Moving WordPress to a New Server” for more information about moving the DB tables. If you are replacing an existing WordPress blog you may want to insert the tables into a new database. This will allow you to keep your old blog in its current state for recovery in case anything goes wrong. Another alternative is to rename the tables in the SQL File by replacing the prefix (for example “wp_new_” instead the default “wp_” prefix), this is what I did to avoid creating a new database. Be careful, there are some entries in the usermeta table that use the same prefix as the tables so you will need to update those to match the new prefix (”wp_capabilities” becomes “wp_new_capabilities” and “wp_user_level” becomes “wp_new_user_level”). I had some other problems with my database import, see the notes below *.
  3. Edit your wp_config.php in the new directory to match the database, name, and password of your hosted database. Also update the prefix if you changed it from the default “wp_” in the previous step.
  4. Now the moment of truth. Rename your old WordPress install folder as a backup (if it was in the root of your server then you should still be able to move the contents to a new folder)
  5. Rename the folder where you copied your imported server files to the original blog folder name.
  6. If all went well then you should have a completed import.
  7. If anything goes wrong then swap the directories back to restore your previous blog and investigate the problem. I had a few problems because I renamed the tables but didn’t update the usermeta entries correctly. It was good that I made all the backups so I could restore my original blog while I worked out the problems.

Copying the Database from one server to another
To copy your WordPress DB tables from one server to another you can follow the directions for Moving WordPress to a New Server.

* When I exported the table from my local EasyPHP server it was formatted a bit wrong, but I’m not sure why. I had to manually edit the sql files and change CREATE TABLE commands. The originals from my public server export had a line TYPE=MyISAM but the local export said ENGINE=MyISAM. The import didn’t like that so I manually changed them to TYPE.