Migrate from Blogger to WP – Advanced Tutorial

If you depend on your blog for income, do not attempt to migrate from blogger to self-hosted WordPress by yourself. If you hire someone, make sure they are able to follow these directions. Too many people are selling migration services when the only thing they do is click the ‘import’ button. That will break every single link.

Blogger to Self Hosted Migration (Developer Notes)

Note: These are directly from my developer manual. I won’t expand too much on our lists, as these are meant for advanced WP users

Info needed:

  • google logins
  • host company logins
  • theme choice
  • registrar logins
  • check email choice if entire NS are changing

Prepare Blogger Site

1.  Take screenshots of home page, archives, single page, and sidebars

2.  Copy all sidebar content into text document/ new widgets

3.  Copy random page urls to text doc, include archives, tag archive, single post for testing later

4.  Check logins for: blogger, domain registrar, hosting, RSS / Feedburner, google analytics, WordPress.com if using jetpack

5.  Check links for Facebook, twitter, feed & any other networks from sidebar

Prepare WordPress Site

  1. add theme
    1. configure with layout similar to blogger (main column, sidebars)
    2. add widgets as close as possible to original locations
  2. add plugins & configure as per All in One Package
  3. add redirection plugin (John Godley) & blogger to WP by Rtcamp, Cache images by Matt Mullenweg, Search Replace by Inpsyde GmbH
  4. change permalinks WP General setting to /%year%/%monthnum%/%postname%.html

NOTE:  search & replace plugin will erase sidebar widgets!!!  do the internal link search/ replace first(below), then edit the sidebars.

Migrate All Blogger the Content

  • Import  – yep, press the button.
  • Copy/Paste Blogger pages to new WP pages

Import Images

  • Run Image Caching plugin (Cache Images)

Fix Imported Permalinks

This shortens the imported permalinks to 39 characters (Blogger’s default). Create new file: fix.php, add to root directory. Run. Remove!

<?php
require_once('wp-load.php');
$res = $wpdb->get_results("SELECT post_id, meta_value FROM $wpdb->postmeta WHERE meta_key = 'blogger_permalink'");
$wpdb->print_error();
foreach ($res as $row){
$slug = explode("/",$row->meta_value);
$slug = explode(".",$slug[3]);
$wpdb->query("UPDATE $wpdb->posts SET post_name ='" . $slug[0] . "' WHERE ID = $row->post_id");
$wpdb->print_error();
}
echo "DONE";
?>

ERASE this script from the directory immediately following running.

Fix Internal Links

The biggest risk and most difficult fix is that blogger cuts off permalinks at 39 characters. And WP doesn’t. If the content was imported directly and the permalinks were converted. You’ll need to remove those.

NOTE:  search & replace plugin will erase sidebar widgets!!!  Do THIS replace first, then edit the sidebars.

Use search replace plugin. Search:

@^\/?([\w-]{2,39})(?<!-).*@

This finds all links and replaces with first 39 CHARACTERS. Some of those links stopped mid-word.

  • You need to manually review and remove extra characters: I know, I know.

Fix Extra Code: Post Footer

Use search regex plugin:

  • Search for:
    @<div class="blogger-post-footer">(.*)</div>@

    Leave replacement empty / null

Add redirects

  • Change NS & reset defaults on host records. or change A records to leave email in place

Next: After above is complete, set the 301 redirect script (from Blogger to WordPress redirection plugin – thank you rtcamp!) in Blogger classic theme editor

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" dir="<$BlogLanguageDirection$>">
<head> <title>  <$BlogPageTitle$> </title> 
<script type="text/javascript"> <MainorArchivePage>window.location.href="http://www.site.com/"</MainOrArchivePage>
  <Blogger><ItemPage>window.location.href="http://www.site.com/blogger/?q=<$BlogItemPermalinkURL$>"</ItemPage>
</Blogger> </script> <MainPage><link rel="canonical" href="http://www.site.com/" /></MainPage>  
<Blogger><ItemPage><link rel="canonical" href="http://www.site.com/blogger/?q=<$BlogItemPermalinkURL$>" />
</ItemPage></Blogger></head><body> 
<div style="border: #ccc 1px solid; background: #eee; padding: 20px; margin: 80px;">  
<p>This page has moved to a new address.</p>   
<h1>     <MainOrArchivePage><a href="http://www.site.com/"><$BlogTitle$></a>
</MainOrArchivePage>     <Blogger>       
<ItemPage><a href="http://www.site.com/blogger/?q=<$BlogItemPermalinkURL$>"><$BlogItemTitle$></a></ItemPage>    
 </Blogger>    </h1>  </div>  </body>  </html>

Redirect pages:

 /p/(.*).html to redirect to /$1

Redirect comment pages:

/(.*?)\?commentPage=(\d*) redirect to /$1

Redirect Feeds via .htaccess:

#ATOM Feeds
RewriteRule atom.xml feed/atom/ [L,R=301]
RewriteRule feeds/posts/default feed/atom/ [L,R=301]

#RSS FEEDS
RewriteRule feeds/posts/default?alt=rss feed/ [L,R=301]
RewriteRule rss.xml feed/ [L,R=301]

#Comments Feed
RewriteRule /feeds/comments/default  comments/feed/  [L,R=301]
RewriteRule /feeds/comments/default?alt=rss comments/feed/ [L,R=301]
RewriteRule ^/feeds/([0-9]{1,24})/comments/default$ comments/feed/ [L,R=301]

#Redirect archives
RewriteRule ^([0-9]{4})_([0-9]{1,2})_([0-9]{1,2})_archive\.html$ $1/$2/ [L,R=301]

#Redirect labels/categories
RewriteRule ^search/label/(.*)$ category/$1/ [L,R=301]

Keep Redirects Working without a Plugin

Add this to .htaccess or redirection and remove the Blogger to WP plugin.

blogger/\?q=http\:\/\/BLOGGER BLOGSPOT NAME\.blogspot.com\/(.*?) to $1

 Loose Ends

  • change Feedburner source url
  • in Blogspot settings, remove custom domain mapping
  • in Blogspot settings, click the box to prevent search engines crawling

QA Checklist

  • check random links from step 1
  • check images’ source code for the actual links
  • check that Google Analytics is installed and working

Custom Domains

You may run into issues if your custom domain mapping isn’t correctly installed. To test for this:

Go to http://yourdomain.com (no www) and if it results in an error, the custom domain was NOT set up, it was just redirected. You MUST set it up first before you can migrate.

Limousine Service

On a regular basis we are hired to fix migrations gone wrong. And usually 6 months or more after the fact. If you need help, get it right away! Once the database is full of new information the scripts above won’t work. They will ‘fix’ the Blogger content, and break your new content! It’s a far more manual process, and costs a lot more than our flat rate Limousine Service. Plus, who wouldn’t want a limousine service? 🙂

Fees for the limousine service = $490. Interested? Just contact us and we’ll help you out!