Categories
Technology Weblogging

Tool independence: The export format

The first challenge to moving a weblog is getting a snapshot of your weblog data in a format that can be imported into the new tool. To create an export that works with most tools, at least for moment, you’ll want to export your existing weblog’s data using the Movable Type import/export format.

WordPress doesn’t have a MT export built into the tool (more on this later); as I mentioned in a previous post, I used Scott Hanson’s new WordPress to MT export script to export my posts, categories, comments, and other data. Once I copied his file, I edited the parameters given in the script, providing the same username, password, and database name I added to the wp-config.php file. I also edited the file to use the default line break within Movable Type, __default__ , rather than ‘markdown’, which is the text format tool currently set as default in the import tool. These items are easily found in the script using a text editing tool.

When I load the export script page into a browser, the exported data prints out to the page, in a technique made popular by Movable Type. Once the export is finished (a message displays at the end of the page), I used the browser’s File/Save As functionality to save the page to a local file called bb.export.

(Another approach is to use the Unix wget utility on the command line as follows: wget http://somedom.com/import.php. This saves the exported data as ‘import.php’ and you can the use the data as needed. )

After the file was created, I FTP’d it to a newly created sub-directory, import within the MT cgi-bin directory. All that was needed at that point was to open up my MT installation, select import/export, and pick the import option–choosing to use myself as default author. the default post status of ‘publish’, and since all the entries had categories, I didn’t need the default category. I also have titles for all entries, so didn’t need to fill in the start and end title HTML fields, either. Clicking the link to do the import should load the data, and the data migration of the tool porting is finished.

(See the Movable Type documentation for more information about importing data into a MT weblog.)

A regular WordPress supporter, Carthik also has a version of a WP-to-MT export tool that uses WordPress global variables for the database variables. You can access it here. Carthik had his export tool finished before Scott started working on his, but had withheld publication because he’s now working on what he and Matt Mullenweg, the lead WP developer, are calling a “lossless XML export”–a import/export format that is going to be included with WordPress 1.3, and licensed as GPL for others to use if they wish.

One reason that the WordPress folks are creating this new format is that there has been problems with the existing MT format in the past. I have exported and imported data several times using this format and haven’t had issues recently, but others have had problems, specifically with fairly fragile points of breakage in the scripts such as dependence on a dashed line to separate entries. When I first used the import format to move from Blogger to MT, the import kept stopping as it would run into a sequence of dashed characters and the import functionality thought, “Well, that’s it – she’s done.” Once I edited for this problem, another would surface, making my move from Blogger to MT the most painful tool move I’ve done.

However, there is no denying that the MT export/import format is the most widely supported format in most weblogs. To have tool independence, in this case you need to depend on a specific tool import/export format…at least until enough vendors can support a replacement.

Technical issues of clean transformations aside, a challenge with a new universal format is the underlying data model each tool shares. For instance, a ‘post’, that has 0 or more ‘comments’ and at least one ‘category’ is more or less a standard model of data across all weblogging tools. However, beyond this simple core model, each tool does differ widely.

For instance, Movable Type supports keywords but not key/value pairs. Keywords are just a listing of terms associated as values to the weblog, while key/value pairs have both a term and an associated value. WordPress supports key/value pairs, and I use these in the ‘about this entry’ box in the top-left of the page. When I moved the data to the Movable Type test site, I lost this key/value pairing. Even if a new export format included these key/value pairs, there would be no place to receive it in the target weblogging tool–in this case Movable Type. The most we could do is strip the key portion of the pair and just take the value, and this would defeat the usefulness.

Now, if we use something like RSS or Atom to act as the transport medium, it might seem as if these would then ensure a common data model because most tools support one or more of these these feed syntaxes. The assumption is that if the tool supports the feed, they have to support the data that provides the feed, and therefore a minimum data model is guaranteeed. Right?

Well, not necessarily….

If a syndication feed supports complex or hierarchical categories but these are optional, and one weblog tools supports them, but another doesn’t, using the syndication feed to export the data from one tool to the other will result in loss of data; using XML won’t improve this situation, or prevent the loss of data.

That’s where the MT import/export format comes in handy at this time. The power behind it isn’t in it’s syntax, which is problematical–but in the underlying data model. The MT format has, by virture of it’s wide usage, defined a minimal shared model that most tools support. An XML-based version of this model could then provide a more robust import/export format. This is a win/win for all tools, and one that we as customers should encourage.

However, until a good majority of tools support the use of this XML format, whether it’s based on RSS or Atom or even something entirely new – the de facto standard for most tools now is the existing MT regular text-based format. This is what I will be using for the rest of these writings.

Categories
Critters outdoors Photography

A cat’s perspective

Recovered from the Wayback Machine.

Hi, I’m Zoe. This is my first time writing to a weblog, and I hope I do it right. I’m not sure how many cats write weblogs. I saw a weblog written by a dog today, but all it wrote was variations on feed me and smell my butt. Seems rather limited, somehow.

Shelley is my pet person, though I think she sometimes gets the idea she runs things around here. But as you can see here in my most recent photo, I take my supervision of Mom’s care quite seriously.

cat who means business

Mom was going to write about her road trip yesterday, but she had a complicated day today and was tired; so I sent her to bed and decided to write her post for her.

Yesterday was sunny and Mom decided a walk among the lakes might be nice. She went to Busch Conservation Area, which has 35 lakes– some swampy, some clear and all different sizes. One thing they all have in common is they’re all full of fish. Nice, juicy, tasty fish. Mom said the waterfowl lake was full of ‘fingerlings’, which I guess is a small fish. Just my size, I thought, but did she bring me one? Not a bit of it! Not one lousy, stinking fish.

She did bring home photos, though what good these are, I don’t know. You can see them at Tin Foil Project, if you’re of a mnd for that sort of thing. Mom says a good photograph helps the viewer smell the scents on the air, feel the summer heat against their cheek, and hear the fish jumping in the water. All I can say is Mom must not be a good photographer because it just looked like a bunch of gray stuff to me.

(But I like the cursor. I like to chase the cursor. Wheee…there it goes! Quick, quick before it moves away. Jump! Now! Death to Cursor!)

Mom spent the afternoon driving from lake to lake, getting out at and walking around some of the bigger ones. She said it was a pretty hot day, and she had to keep the windows up and the A/C on to keep the dust of the road out. The road was in bad shape, too, and she thought she would hang her car up a time or two.

“Kitty, Golden Girl might not be an SUV but she can handle rough roads with the best of them”, she said when she got home. Of course, if she’d busted an axle or flattened her tire, she’d be moaning and groaning, and feeling damn sorry for herself today, wouldn’t she?

I crawled up into her lap to get some neck scritches and Mom took this as me wanting to hear more about her trip. No, I just want more neck scritches. However, everything in this house comes with a price tag. if you want your neck scritched, you have to listen to a story. It’s like those places that feed you when you’re poor, but you have to hear a sermon, first.

At one lake Mom had to drive past waist high weeds on a poor track to get to it. As she was moving slowly along, these hard, black things started flying into side windows and windshield. Turns out it was some kind of big, black, shiny bee-like creature, and she figures she must have driven right into some kind of feeding ground, or perhaps even into their nest. She was mighty glad she had those windows, up, she said.

(Yeah, yeah, Mom. It’s just bugs. Who care. More scritches, less chatter. )

When she got back yesterday, she went online to check out the weblogs like she does most days. She’d been following a lot of stuff lately having something to do with being a woman and not being seen or heard or something like that. It doesn’t make sense to me, a cat, but Mom refers to it as being invisible on still water. Must be a human thing.

I kind of wish Mom wouldn’t get involved in this stuff because it upsets her. She ends up writing something here or in other’s comments, but doesn’t feel like she’s heard when she does. Then she gets both angry and sad, and forgets all about my snack.

Today was tech day, though, and Mom was hard at work on code, humming under her breath as she typed away. She was working at something called “Movable Type”, and why it’s called that when the type doesn’t move, not even a wiggle, I don’t know and believe me, I’m an expert on moving things. She was pushing stuff into it from something else called “Wordpress’, and that one makes sense as the words do seem pretty squished and flat on the screen.

Then this evening she read something in another weblog that surprised her and, she said, made her feel invisible again. She was pretty somber for awhile; just sat and stared out the window as it got darker, and I was beginning to worry that I was going to miss out on both evening cuddle and chase the feather-that-is-dead.

But someone else wrote something that also surprised her, but this time it made Mom smile. It was a good smile, too. Sometimes I don’t see enough of it, and I’m not sure all this “Movable Type” and “Wordpress” and ‘asshole-rss’ (what is an ‘asshole-rss’?) and people writing things and doing things that make each other somber is such a good thing.

But then there was that smile at the end. And I got my cuddle, time with the feather-that-is-dead, and even an extra scritch. So maybe this pressed word stuff is okay.