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
- 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.
- Run EasyPHP. It will start the Apache and MySQL servers all ready to go at http://127.0.0.1.
- Enable Curl.
- Right click on the “e” icon in the system tray and select Configuration->PHP Extention.
- Check “php_curl”
- Create the MySQL database. You have to do this regarless of whether you will be importing existing tables or starting from scratch.
- Right click the EasyPHP system tray icon and selecting Configuration->MyPhpAdmin.
- Under “Create new database” enter the name of your database and click Create.
Install WordPress on your local PHP server
- 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.
- See “Moving WordPress to a New Server” for a detailed description of the moving process.
- Define DB_NAME to be the name of the database you created earlier.
- Define DB_USER to ‘root’.
- Keep DB_PASSWORD empty.
- 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.
Importing your Blogger Blog into your local WordPress Server
- 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.
- Once this has successfully completed you should now have a WordPress server on your PC with all your Blogger posts imported.
- 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.
- 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
- 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.
- 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 *.
- 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.
- 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)
- Rename the folder where you copied your imported server files to the original blog folder name.
- If all went well then you should have a completed import.
- 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.