Saturday, February 5, 2005

Ch-ch-ch-Changes, Part 2

I mentioned earlier that when I made the move from Blogger to TypePad, there was a lot to do. And there was. It was compounded by the fact that I really don't like to bother people with how to do stuff. Oh, I always want to learn how to do stuff. But I hate having to ask. I feel like I'm intruding. But, if they offer help in some manner, they will be deluged with questions.

I'm not sure what it was that set the wheels in motion of my searching for a new host. But I wanted just a little more than I had. So, I first searched Blogger to see if they had a premium service that offered more features. They didn't. Apparently, they used to. But not now. So, I started looking elsewhere. Some of the blogs I like to read are on mu.nu. Those on that service really seem to like it. A lot. And it looks like it might be alright. But, it wasn't that easy for me to find the information I wanted. And that's a bad sign. To me anyway. So I passed.

A lot of sites run Movable Type. And in all the looking around while setting up the Blogger site, and later, I always saw references to Movable Type. So, it was obviously a major player. And they have their own hosting service, TypePad. And some sites I like are TypePad sites. And it was easy for me to find what I needed. But the cost bothered me. I looked a little more at other places but decided I'd give TypePad a shot, especially with the 30 day free trial. Well, I signed up for the 30 days trial and I was sold. So, I began the process of making the move. So, what are the pieces that have to move? Easy enough, I thought.

The posts. Blogger did a good job of letting me archive them in a format that TypePad could import. TypePad did a good job of walking me through what it needed.

The comments. HaloScan allowed for exporting to CAIF. Only TypePad doesn't import CAIF. Oh, heck. Well, I'm a HaloScan premium member and expect to remain so. Therefore, I'll just leave the old comments where the are, and add links to the old comments at the bottom of the imported posts. That took a while, I'm here to tell you. But, I got it done. And added JavaScript to the TypePad templates that allowed for opening the comments just like on Blogger. I am still looking for a way of importing them into the TypePad commenting system, retaining all data (including date/time). But, I have a workable, if not desirable, solution now.

BlogRolls and such. That's easy enough if you can edit your HTML templates. And that's the service I got. So, I just added the code for the BlogRolls and buttons and stuff.

Links to the old site. That's easy enough. Just include META tag refresh code in the Blogger template, right? Wrong!! That will send every link to every page to the new home page. The problem is, some other sites had links to specific posts. And if you were, say, on the Alliance home page and wanted to link to a Filthy Lie that I had submitted, you'd want to click on that link and see that page, not my home page with an apology saying "Dig down, you'll find it." That's not very user-friendly.

So, I went to the archives pages on both the Blogger and TypePad sites, copied the code, and pasted into HomeSite. Then, using search and replace routines, I segregated the post names and URLs from the rest of the code, then manually deleted the bunches of superfluous code. That left me with a listing of title, URL, title, URL, and so on. Did that for each, then pasted them into Excel, and verified everything matched. The titles, anyway, because the post filenames were different. Then I added some cells to insert If/Then statement and quotation marks and such. Then copied/pasted the whole thing into Word to remove extra spaces and tabs, then back to HomeSite for saving.

My first plan was to create one huge-ass JavaScript routine that read the window.location.href and if I got a match with my if/then statement, execute a location.href to send it to the correct page. But there was one thing I really didn't like. JavaScript is client-side code. The if/then statements would make the code on the page much bigger, then the browser would have to execute it. So I said to myself, "Self," I said, "how can I do this server-side?" And I answered myself by reminding me that I have a couple of other Web sites up that I could use. So, rather than using JavaScript if/then statements, I decided to use ASP If/Then statements.

So, the Blogger page had to call the ASP page on my other server, and pass the requested URL to it for If/Then decisioning. Like

window.location.href="http://myownsite.com/blog/xfer1.asp?refurl=http://basils.blogspot.com/2005/01/one-of-us-one-of-us.html" mce_href="http://myownsite.com/blog/xfer1.asp?refurl=http://basils.blogspot.com/2005/01/one-of-us-one-of-us.html"

Which created a whole new issue.

How to pass a URL as a URL variable. My first test through failed. Troubleshooting, I found that everything failed as soon as the second "/" was reached. That meant I would, on the Blogger template, add a JavaScript routine that replaced "/" with something safer. Like "~" I thought. Well, that worked. I then passed something like:

window.location.href="http://myownsite.com/blog/xfer1.asp?refurl=http:~~basils.blogspot.com~2005~01~one-of-us-one-of-us.html" mce_href="http://myownsite.com/blog/xfer1.asp?refurl=http:~~basils.blogspot.com~2005~01~one-of-us-one-of-us.html"

Then, on the other site, I'd use ASP/VBScript code to translate it back. Then, I'd use ASP/VBScript If/Then to redirect to the new version of the page.

Did it work? Yep. Like a charm. If you don't believe me, try it with this link: http://basils.blogspot.com/2004/12/61.html

And you thought moving a blog would be hard.

5 comments:

  1. but you made it sound so easy... like, what is HTML?
    no prob, you have the solution.
    what a geek!
    LOL!

    ReplyDelete
  2. The Big Sister (who's 5'4")February 5, 2005 at 4:56 AM

    I got lost...but then, you knew I would. I am just confirming your suspicion.

    ReplyDelete
  3. You read part 1, right? I mean, without that, it would be like watching Star Wars for the first time and missing the opening scroll.

    Oh! A new topic for a future post!

    ReplyDelete
  4. The Mean Sister (who is 5'6")February 5, 2005 at 6:17 AM

    I think you need to get your ASP from in front of the computer. I just got lost!! How about this for an if/then statement? If basil keeps posting like this, then The Mean Sister (who is 5'6") will continue to read, but will be SO CONFUSED!!

    ReplyDelete
  5. The Big Sister (who's 5'4")February 5, 2005 at 8:10 AM

    I remember your taking me to see Star Wars because.... OOPS! better not ruin your future post!

    ReplyDelete

Please choose a Profile in "Comment as" or sign your name to Anonymous comments. Comment policy