scriptygoddess

18 Jun, 2004

Import MT bug fix

Posted by: Jennifer In: WordPress

A HUGE HUGE thank you to Carthik who made a fix to the current import-mt for me because of some issues I had when I imported my MT entries. (I've since deleted all the imported entries – and used his new version to re-import them and now everything is beautiful again!) 😀

The only drawback is that any "new" comments/trackbacks on those old posts have been lost. I apologize for the inconvenience of that. I don't think there were all that many. It was either that or have two years worth of scripts be very messed up.

Until the fix is included in a specific release – here is the fixed import-mt.php that Carthik sent me.

22 Responses to "Import MT bug fix"

1 | Deepest Red, Darkest Blue » Moving from Movable Type

August 25th, 2004 at 1:29 am

Avatar

[…] ously. If you're thinking of migrating to WordPress, a fixed script can be found on Scriptygoddess. After running the script, the 200+ entries […]

2 | bhw

June 19th, 2004 at 7:02 am

Avatar

What does the bug fix fix? Is it the import issue where your entries get renumbered and screws up your archives and internal/external links to them?

3 | Jennifer

June 19th, 2004 at 7:13 am

Avatar

This new version has the bug fix where if you have a lot of dashes in a post "——–" it will NOT see that as a break in the comment or post. (This is already fixed in the next version, but you can't use that import-mt.php version unless you upgrade your whole blog – and I would like to wait until it's confirmed stable before doing that).

As well – and this was a BIG one – when I imported my entries – WordPress ATE all backslashes "\" (As in completely removed them) Probably not a big deal for most people – but I had posted a lot of scripts with backslashes in them. We're talking possibly hundreds of posts.

This is still an issue in 1.2 when creating new posts. It completely removes them. If you want to keep the backslash in your post – you'll need to use the ascii equivalent.

So what the bug fix does is search through the entries you're importing and swaps out the backslash for "\"

4 | Meredith

June 19th, 2004 at 8:24 am

Avatar

Carthik is pretty darn cool, and not just for this fix. :)

6 | pericat

June 23rd, 2004 at 2:45 pm

Avatar

And a big thank-you to both you and Carthik! I ran into that one trying to record a search/replace command for vi; had the devil of a time with it until I finally threw in the towel and looked up the ascii equivalent for backslash. Now I don't have to worry about it anymore.

7 | Kathy K

June 23rd, 2004 at 4:28 pm

Avatar

Wonderful!! I've been doing a search and replace to change dashes to underscores where people use them to separate things.
Now I'll have to re-hack the new mt-import to add post id's that make permalink redirects from MT possible. But that's way easier than search/replace every time I move someone!
:)

8 | Carthik

June 23rd, 2004 at 4:35 pm

Avatar

Hi Kathy,

The bug fix version does nothing about dashes and underscores.
There is already a solution to redirect from MT blogs with post ids in the URLs. You should find that at my blog entry which deals with moving from MT to wP, either in the post or in the comments.
(http://blog.carthik.net/vault/movabletype-to-wordpress )

9 | Kathy K

June 23rd, 2004 at 4:56 pm

Avatar

Carthik, I don't care if it doesn't change them to underscores, as long as it doesn't see it as a break in the comment or post!

None of the redirect solutions allows for a simple .htaccess redirect from the MT individual page to the new WP individual page. Which keeping the same does allow. The first one prints out static pages with redirects. The second one prints out a huge list to cut and paste into .htaccess (or would if I modified it for individual pages) and the third one is to redirect category and date archives for the underscore to dashes problem (and I do use his plugin for that).

10 | Carthik

June 23rd, 2004 at 5:15 pm

Avatar

My bad, Kathy, I thought you were talking about the dashes and underscores in the URLs…

Well, MT uses the post ids to generate URLs for the posts. THere was a user that wrote an import-mt.php that assigns the same post ids as the mt post id, so that everthing is smooth, or something of that sort.

11 | Kathy K

June 23rd, 2004 at 5:19 pm

Avatar

Yep. That was me. I wrote an export template to export post ids and then hacked the mt-import slightly to import them.

12 | Carthik

June 23rd, 2004 at 5:21 pm

Avatar

D'uH!!!

I'm sorry, I am out of my mind, of course it was you KathyK, I remember seeing you on #wordpress.

Have a great day!

13 | Jennifer

June 23rd, 2004 at 5:22 pm

Avatar

Kathy – There is a script that Alex King created that you paste into your MT individual templates (then rebuild your site in MT) – and (based on the title) will guess what the WP url (with post slugs) will be and redirects (directly in the html pages) to the appropriate WP page.

I'm running it on this site and it's working perfectly.

I'm having trouble finding the script though… I'll keep looking if you're interested.

14 | Kathy K

June 23rd, 2004 at 5:46 pm

Avatar

I've seen that one. My original pages were shtml; though, so I can't use the PHP script (which does permanent redirects) and I didn't want to use the one with meta redirects. I can't use my .htaccess to parse shtml as php because I still have active .shtml pages.
I will take a look at it for others though (if I can find it — I did find it once)!

15 | Kathy K

June 23rd, 2004 at 5:49 pm

Avatar

P.S. You were smart to have gone with PHP to start! I knew Perl and SSI and didn't want to use PHP and have to learn something new. And now I am learning it anyway. 😉

16 | Kathy K

June 23rd, 2004 at 5:53 pm

Avatar

That's it.
That's the one I mentioned above on the list of three (I had forgotten about the php version because I couldn't use it.)

17 | Jennifer

June 23rd, 2004 at 9:59 pm

Avatar

Kathy – couldn't you just change your htaccess file to process shtml like php?

18 | Kathy K

June 23rd, 2004 at 10:16 pm

Avatar

Not without changing all my static (non-MT) .shtml pages to PHP.

19 | Kathy K

June 24th, 2004 at 7:37 am

Avatar

They are in several directories. Unfortunately one of those is my main directory.

20 | chartoo

June 24th, 2004 at 7:45 pm

Avatar

A big heartfelt thanks to you both.
The script worked like a charm.

😉

21 | Ruby Sinreich

July 25th, 2004 at 11:15 pm

Avatar

This definitely helped me with those errant dashes in the MT export. (Too bad I spent an hour yesterday trying to manually edit out the dashes in a 4MB text file!)

But my posts are still coming through as the wrong author and not even consistently. ie: sometimes A shows up as B, and sometime A shows up as C. Any ideas what might be causing this?

22 | Kathy K

July 26th, 2004 at 6:22 am

Avatar

Try splitting up the import into smaller files. Then see where the error first appears. Split it into four 1MB files, for instance, and importone at a time until you get an error. Then take the one you got an error on, and split it in half, etc… (requires clearing out the db each time). It's a pain but it works.
That was how I was doing it before Carthik did his new import.

I did find one thing that messed up authors, besides dashes, was a bug coming out of the MT export that was giving me blank authors on some posts. Seemed to be caused by things like using the trademark or a Euro in a post, without using the proper hex code.

Featured Sponsors

Genesis Framework for WordPress

Advertise Here


  • Scott: Just moved changed the site URL as WP's installed in a subfolder. Cookie clearance worked for me. Thanks!
  • Stephen Lareau: Hi great blog thanks. Just thought I would add that it helps to put target = like this:1-800-555-1212 and
  • Cord Blomquist: Jennifer, you may want to check out tp2wp.com, a new service my company just launched that converts TypePad and Movable Type export files into WordPre

About


Advertisements