From Movable Type To WordPress

by on September 20, 2010


Do you like my new blog look?

This journey started months ago when I decided that my blog needed a redesign. Like any nagging thought slipping in and out of one’s consciousness, it just festered until suddenly last Sunday night, after watching two episodes of Mad Men, I did a trial run-though of moving my blog out of Movable Type and into WordPress.

Let me back up a bit here. I have NOT become a WordPress groupie who believes only in WordPress. I still have most of my big traffic sites on Movable Type, and don’t see moving them any time soon. But BarbaraFeldman.com is a blog, and when it comes down to it, WordPress is a great blogging platform. And there is dearth of themes for Movable Type, meaning a redesign would involve a graphic designer and a programmer. WordPress, on the other hand, has thousands of themes, including the premium Thesis theme that I own a Developer’s License for (meaning I can use it on any of my sites for one low price.)

Now, that I have that little rant out of the way, I want to outline the move, in case anyone else could benefit from my experience.

Step One: I installed WordPress on a sub-folder of my blog site. This way, I could have a fully-functional copy of my blog in WordPress without taking down my Movable Type site. For the purposes of this discussion, let’s call that sub-folder “wordpress”, so my new install was at:

http://www.barbarafeldman.com/wordpress/

Step Two: Check the WordPress box that says “I would like to block search engines, but allow normal visitors.” This will give you easy access to your new install, but keep the search engine robots out, so you don’t end up with TWO copies of your blog in Google. You’ll be asked this question during a standard WordPress install, but if you miss it, it resides under Settings/Privacy.

Step Three: Create an export file from Movable Type. You’ll find this under System Overview/Tools.

Step Four: Import this file into WordPress using Tools/Import. If you don’t have the Movable Type importer plugin installed, WordPress will prompt you to install it.

Step Five: Take a look around at your new blog. Mine looked pretty good. All the posts, comments, tags and categories looked pretty good. The truth is I could have taken it live at this point, but there were two issues that needed resolving.

Your mileage may differ, but here were my two problems. First, posts that used the “Convert Line Break” format in Movable Type were missing the blank lines between paragraphs. For me, this was most of my posts. I found a php script that solved that problem. I simply ran my exported file through the converter script. If my file had been smaller, I could have used a text editor to do global search-and-replace. But I didn’t have a text editor that could handle a file that size.

Problem two was that WordPress was using the Movable Type BASENAME field as the post permalink. This might have been okay, EXCEPT that in my MT install, my basename had been set to a limit of 15 characters AND I hadn’t used the BASENAME for my MT permalink. I had been using a “dirified” post title. This means that my MT permalinks looked like this (with underscores):

http://www.barbarafeldman.com/facebook_ban_for_middle_school_students.html

But the BASENAME field (limited to 15 characters, just because that’s the way I had left it) was:
facebook_ban_fo

Since I was making the switch to WordPress anyway, I decided to change from the underscore to the dash, so I wanted the new WordPress permalink to be:

http://www.barbarafeldman.com/facebook-ban-for-middle-school-students/

I solved this problem by hiring a programmer to write a script to modify the BASENAME, so that it used dashes (not underscores) and it was based on the full title (not limited to 15 characters).

So now, my BASENAME field would look like this:
facebook-ban-for-middle-school-students

This will give me complete compatibility of permalink styling between my old posts and my new posts, as I set up my WordPress permalinks to be %postname%.

Step Six: Long story short, step six was getting the php script written to solve the above BASENAME problem. This is a very easy task if you happen to be a PHP programmer. I’m not.

Step Seven: Now that I have the perfect import file, I need to remove the first round of posts from my database. If you are a MyPHPAdmin whiz, you might feel comfortable going into the database and deleting the posts there. I’m not. So I found a plugin that did it for me. Did it perfectly, I might add. Another option would be to just re-install WordPress, but that seemed silly. Plugin is called Bulk Delete.

Step Eight: Import the modified export file into WordPress and look around. Everything looked GREAT!

Step Nine: Ninth step is to create and test the .htaccess that would 301 redirect all my old links to the new links. I had four kinds of links to convert: single posts, category archives, monthly archives, and rss feeds. I got the basic RewriteRule for converting the underscores to dashes from someone’s blog, but I can NOT find them. If I stumble across them later, I will add their link here.

For reference, here’s what the old and new links looked like:

Posts
Old: http://www.barbarafeldman.com/facebook_ban_for_middle_school_students.html
New: http://www.barbarafeldman.com/facebook-ban-for-middle-school-students/

Categories
Old: http://www.barbarafeldman.com/cat_site_seeing.html
New: http://www.barbarafeldmanc.om/category/site-seeing/

Monthly Archives
Old: http://www.barbarafeldman.com/2009_08.html
New: http://www.barbarafeldman.com/2009/08/

Here is the exact .htaccess code I used. IT IS IMPORTANT to put these rules BEFORE the WordPress rules.

#for categories, converting underscores to dashes, and changing cat_ to /category/ and removing .html
rewriteRule ^cat_([^_]*)_([^_]*)_(.*)\.html$ http://www.barbarafeldman.com/category/$1-$2-$3/ [R=301,L]
rewriteRule ^cat_([^_]*)_(.*)\.html$ http://www.barbarafeldman.com/category/$1-$2/ [R=301,L]
rewriteRule ^cat_([^_]*)\.html$$ http://www.barbarafeldman.com/category/$1/ [R=301,L]

#for single posts, converting underscores to dashes and removing .html
rewriteRule ^([^_]*)_([^_]*)_([^_]*)_([^_]*)_([^_]*)_([^_]*)_([^_]*)_([^_]*)_(.*)\.html$ http://www.barbarafeldman.com/$1-$2-$3-$4-$5-$6-$7-$8-$9/ [R=301,L]
rewriteRule ^([^_]*)_([^_]*)_([^_]*)_([^_]*)_([^_]*)_([^_]*)_([^_]*)_(.*)\.html$ http://www.barbarafeldman.com/$1-$2-$3-$4-$5-$6-$7-$8/ [R=301,L]
rewriteRule ^([^_]*)_([^_]*)_([^_]*)_([^_]*)_([^_]*)_([^_]*)_(.*)\.html$ http://www.barbarafeldman.com/$1-$2-$3-$4-$5-$6-$7/[R=301,L]
rewriteRule ^([^_]*)_([^_]*)_([^_]*)_([^_]*)_([^_]*)_(.*)\.html$ http://www.barbarafeldman.com/$1-$2-$3-$4-$5-$6/ [R=301,L]
rewriteRule ^([^_]*)_([^_]*)_([^_]*)_([^_]*)_(.*)\.html$ http://www.barbarafeldman.com/$1-$2-$3-$4-$5/ [R=301,L]
rewriteRule ^([^_]*)_([^_]*)_([^_]*)_(.*)\.html$ http://www.barbarafeldman.com/$1-$2-$3-$4/ [R=301,L]
rewriteRule ^([^_]*)_([^_]*)_(.*)\.html$ http://www.barbarafeldman.com/$1-$2-$3/ [R=301,L]
rewriteRule ^([^_]*)_(.*)\.html$ http://www.barbarafeldman.com/$1-$2/ [R=301,L]
rewriteRule ^([^_]*)\.html$ http://www.barbarafeldman.com/$1/ [R=301,L]

#for monthlies
rewriteRule ^([0-9]{4})_([0-9]{2})\.html$ http://www.barbarafeldman.com/$1/$2/[R=301,L]

# for feeds
rewriteRule ^index.rdf$ http://www.barbarafeldman.com/feed/ [R=301,L]
rewriteRule ^index2.xml$ http://www.barbarafeldman.com/feed/?cat=-22 [R=301,L]

#for comment feeds
rewriteRule ^([^_]*)_([^_]*)_([^_]*)_([^_]*)_([^_]*)_([^_]*)_([^_]*)_([^_]*)_(.*)_comments.xml$ http://www.barbarafeldman.com/$1-$2-$3-$4-$5-$6-$7-$8-$9/feed/ [R=301,L]
rewriteRule ^([^_]*)_([^_]*)_([^_]*)_([^_]*)_([^_]*)_([^_]*)_([^_]*)_(.*)_comments.xml$ http://www.barbarafeldman.com/$1-$2-$3-$4-$5-$6-$7-$8/feed/ [R=301,L]
rewriteRule ^([^_]*)_([^_]*)_([^_]*)_([^_]*)_([^_]*)_([^_]*)_(.*)_comments.xml$ http://www.barbarafeldman.com/$1-$2-$3-$4-$5-$6-$7/[R=301,L]
rewriteRule ^([^_]*)_([^_]*)_([^_]*)_([^_]*)_([^_]*)_(.*)_comments.xml$ http://www.barbarafeldman.com/$1-$2-$3-$4-$5-$6/feed/ [R=301,L]
rewriteRule ^([^_]*)_([^_]*)_([^_]*)_([^_]*)_(.*)_comments.xml$ http://www.barbarafeldman.com/$1-$2-$3-$4-$5/feed/ [R=301,L]
rewriteRule ^([^_]*)_([^_]*)_([^_]*)_(.*)_comments.xml$ http://www.barbarafeldman.com/$1-$2-$3-$4/feed/ [R=301,L]
rewriteRule ^([^_]*)_([^_]*)_(.*)_comments.xml$ http://www.barbarafeldman.com/$1-$2-$3/feed/ [R=301,L]
rewriteRule ^([^_]*)_(.*)_comments.xml$ http://www.barbarafeldman.com/$1-$2/feed/ [R=301,L]
rewriteRule ^([^_]*)_comments.xml$ http://www.barbarafeldman.com/$1/feed/ [R=301,L]

#for category feeds
rewriteRule ^cat_([^_]*)_([^_]*)_(.*)\.rdf$ http://www.barbarafeldman.com/category/$1-$2-$3/feed/ [R=301,L]
rewriteRule ^cat_([^_]*)_(.*)\.rdf$ http://www.barbarafeldman.com/category/$1-$2/feed/[R=301,L]
rewriteRule ^cat_([^_]*)\.rdf$$ http://www.barbarafeldman.com/category/$1/feed/ [R=301,L]

Step Ten: After testing the .htaccess file, we are almost there! To make the new site live, is so, so simple. We are going to leave the actual blog files in the subfolder “/wordpress/” but change blog url to the root. So, on the General Settings page I changed the Site address (URL) to http://www.barbarafeldman.com. And left the WordPress address (URL) as http://www.barbarafeldman.com/wordpress/.

Step Eleven: Then I copied /wordpress/index.php to my root folder, along with my newly tested .htacess. Then I opened the index.php file and did one small edit. Change the line that says:
require(‘./wp-blog-header.php’);
to the following, using your directory name for the WordPress files:
require(‘./wordpress/wp-blog-header.php’);

You’ll find a write-up on this process here.

Step Twelve: Ta dah! You should now see your new WordPress blog in your root directory, and be able to login to your dashboard at “/wordpress/wp-admin.” So look around, test your new redirects, and if everything looks fabulous, go into WordPress Privacy Settings and select:

I would like my site to be visible to everyone, including search engines (like Google, Bing, Technorati) and archivers

P.S. If you (like me) are keeping the MT install running at the same domain as your new WordPress blog, you will need (as I just discovered) an additional .htaccess file for your /mt-static/ folder so that the files there (such as the MT editor) do NOT get redirected to the WordPress blog in your root. Here’s the .htaccess I used for the /mt-static/ folder:

RewriteEngine On
RewriteRule ^mt-static/([[:print:]]+)$ http://www.barbarafeldman.com/mt-static/$1 [R=301,L]

melody August 22, 2011 at 7:32 am

Nice blog post you have here Barbara, thank you for your useful tips.. I’m using WordPress for a while too..

Andy S December 13, 2010 at 7:06 am

So this is pretty cool and all.. but I’ve hit a roadblock that I can’t seem to find any answers for… how do you export your Pages out of MT? The export tools exports Entries, comments, tags, categories, etc.. but all the Pages are left behind.

Is there a way to handle bringing them over as well? I definitely need to because there are like 130+ pages in the MT blog I’m trying to migrate to Wordpress.

Barbara Feldman December 13, 2010 at 11:26 am

Well, I didn’t have any Pages in MT. What I had were index pages (since my old MT habits didn’t die easily, and I was using MT before MT even had Pages.)

So I had to bite the bullet, and just manually create the pages in WordPress. Great question, though. Maybe someone else has an answer?

Andy S December 13, 2010 at 1:14 pm

I think this is the best chance right now: http://mt-hacks.com/entrytopageconverter.html

Allows you to convert pages to entries (and vice versa).. but for exporting, you’d need to convert pages to entries and then use the export tool. Once they’re in the Wordpress DB you’d be able to reorganize them as you need.

Hans Mestrum September 29, 2010 at 9:07 am

Wew, this is great! One or two questions:
- tags in MT were the in the tags field or keywords?
- how did you run the convert line break script?

regards
Hans

barbara September 29, 2010 at 11:29 am

Hans,

Tags came from the tag field. I ran the convert line break script in a browser. In other words, I uploaded it to a “secret location” on my site, along with the input and output files (named as they are in the script.) I know this is a tad technical. But if you are attempting to do this conversion yourself, you already are “a tad technical!”

Hans Mestrum September 29, 2010 at 1:04 pm

Hi Barbara,

ok. Thx for your quick response. I did not know the MT tags were directly imported in WP.
I will try to do the conversion.

Hans

barbara September 30, 2010 at 3:13 pm

Hans,

Regarding the tags and the keywords, you are RIGHT. It’s the MT keywords that are imported as WP tags. My keywords and tags are so similar, that I didn’t notice it until now.

Barbara

shahnaz September 25, 2010 at 10:03 pm

dear Barbara, your new site is marvelous. i liked it so much. i’m so interested to be in touch with you more. your site and your tips helped me a lot because i’m a teacher and an educational expert. so i need to be updated and to know about the education all around the world. so your site is very useful for me. but most of the articles and tests or every printable materials in your site are not free and they are unaccessable. therefore i am obliged to use the other educational sites. anyway thank you so much for your kindness. hope the best for you

ann mason September 22, 2010 at 6:31 am

OH MY!
I knew I was in the company of a great mind when I first stumbled on your site at least 10 yrs. ago. MY GRAND SON has grown up with your many wonderful ideas and printed educational lessons. We would never have found the many websites you have directed us to. I must Thank You for your Quest to bring so much to your readers. You say it all to All that have come after Elizabeth Cady Stanton. Go Girl

ann mason

barbara September 22, 2010 at 8:19 am

Oh, gosh! Thanks so much for the kind words. I love hearing about the different ways families benefit from my work.

Ken Westgate September 22, 2010 at 5:07 am

Like your new site a lot. Thanks for the tips on moving site from Moveable Type to Word Press. I’ve been using Word Press for a while and really like it. I think you’ll find it will enhance the effectiveness of your blog and content.

Comments on this entry are closed.

{ 2 trackbacks }

Previous post:

Next post: