To PHP or not to PHP…
September 9th, 2004I think it’s time to migrate dooce to PHP. I’m conflicted over this like the worst Woody Allen character would be conflicted. I’m starting to utter yiddish and stare at the ground and shake my head.
I think there are some ways to do this less painfully… However, it’s going to involve server buggery and insanity. I’ve used PHP before, to great effect. The issue is that dooce has a TON of links from a TON of people. How then do we migrate without hosing all those incoming links?
It’s not over, baby.
Plus, dynamic archive page generation… mmmm tasty.
We’ll keep you posted on this little adventure. I haven’t even discussed this with Heather yet, but in trying to get the daily photo sidebar widget to show up on every page, updated as often as it needs to be, requires a rebuild that takes on average 20 minutes. It’s time for PHP. Am I ready? In the words of Jon Stewart, “Not so much.” o

“server buggery” makes me think of a little french maid being tickled under her skirts.
good luck with the rebuilding.
Speaking as one of the TON, I for one volunteer to change my own link my own damn self if it would in any way be useful to you guys. Go get ‘em.
“How then do we migrate without hosing all those incoming links?”
-
Maybe I’m missing something here, but if you’re changing servers, wouldn’t a simple, static redirect left behind on the old server do the trick?
Not changing servers. That’s the rub. It’s changing the entire archive structure. And that is a huge deal when you’re talking about such a popular site. You just can’t go willy-nilly changing here and there without major issues. I have nightmares about 404 errors and tears. It’s hurtful.
Now that you have all the weblog data in MySQL, you can programmatically generate the new URLs for redirects. Shouldn’t be too bad, but having that big a config file might put a bit of a load on the web server.
Holla if you need some code.
Try Wordpress.
A little under a year ago, A List Apart underwent a redesign that entailed changing their link structure. They talk about managing the whole system of redirects here: http://www.alistapart.com/articles/tacklingusability/. I haven’t looked at the guts of ALA or dooce enough to know whether this will solve your problem, but mayhap it’ll shed some light.
On another note, all the best to you and your family, and the battle of the snowblower! I’ve been a reader/lurker since before Leta’s birth and you & dooce have never failed to entertain yet.
If you use PHP, I assume you can create custom error pages (like custom 404 pages). You could then write a script that looks at the original request, and if someone were trying to access say “http://www.dooce.com/archives/daily/08_19_2004.html” you should be able to parse out the relevant date information and generate the page the user wanted.
It’s a bit tricky, but you can nicely manage a lot of the external references, and those you can’t figure out, you can always display a friendly “oops” page. Fortunately the site content is in a well organized file structure and naming convention.
Hope this isn’t too geeky a post. Good luck!
I went through a similar issue when I moved to MT from Manila, and ended up writing a PHP page “shell” that was responsible for everything but the central content section of the page (e.g., the sidebars, banner, etc.), and then did all the heavy lifting to figure out what to include in that central content section. The nice thing is that, running on Apache, I was then able to write a few good mod_rewrite rules that let my URLs look normal (e.g., http://server/archives/001234) rather than idiotic (e.g., http://server/index.php?archives/001234.php). And the bonus was that the rewrite step allowed me to make the “public” URL (the /archives/001234 URL) into the same thing as it *had* been, so other people’s links didn’t break.
Again, totally geeky reply, but maybe helpful.
Jon: mishmosh has a good pointer. Also, with mod_rewrite, many / all things are possible.
Hey Jon,
I dont know what your hosting situation is, but if you are running apache you can use mod rewrite to dynamically re-write those urls. If the archive paths are normailized then it wouldnt be to tricky to write an RE to match the url and forward the request to the new dynamic php url. I have done this before for my client who made the switch to dynamic content.
Shoot me a note for more info. Good Luck.
I think I am asleep at the wheel. I wrote that and posted it then somehow magically noticed that two people had already suggested it.
Must be time for a weekend again.
What about htaccess ? When we were going to switch one of our business sites over to 100% php, the programmer suggested htacess files to re-direct people following incoming links.
I say take a look at Textpattern. There are plug-ins to help migrate all MT entries into TXP and the community/forum is great.
At any rate, good luck!
Jon - Off topic comment. Can you and Heather check out how I represented a link to your site on my page. I want to make sure that you are both cool with how I used the logo. If you have any reservations I will take it down immediately. I was going to send an email but you have said in the past that comments get check quicker. Feel free to delete this comment after you read it. Michelle
have you tried using flickr for the images?
not sure how it would work with the daily one, but it might.
The hosting isn’t the issue. It’s just getting out of hand trying to rebuild the site. The redesign has taught me that dynamic pages are the way to go. We must also de-cruft the URLs and figure out the redirects. That will be 5.1.
Thanks for the tips!
“How then do we migrate without hosing all those incoming links?”
It looks like the answer to your question is above and then some. My question/response is: “What does the backend look like?” If it is in MySQL and set up with some kind of sanity then you should be able to write a few SQL scripts to get the desired results.
In my mind PHP with a MySQL backend is a smart choice for blogging because you can do whatever you want however you want. My favourite thing was being able to build a comments section that wasn’t overrun by spam scripts.
cool! with 5.1 you’ll become the dynamic duo! Macromedia’s Cold Fusion is my forte, but I don’t want to debate the merits of one language over another. Dynamic is your key and the other programming tips above should take care of your redirect issues. The migration’s a bear, but well worth it. Good luck.
PHP… shudder. I’ll go along with the ColdFusion suggestion. A nice fusebox4 framework would be tasty, but in lieu of that at least consider Zope and CFM.
this geek-talk really kinda turns me on. like when a guy catters to you in italian or someting. for all i care he could tell me i’m the biggest idiot on earth but it just sounds so sexy and i wouldn’t understand a word anyhow. just like here in the comments. can’t get enough of it ;o)
I await your results with great interest. I have been wondering whether to convert to MT 3.11, but I too am afraid of ruining my sites tha use it. Thanks fro being the guinea pig.
Damn! I was all excited cause I was finally going to be able to post a comment with my expert advice but someone beat me to it… the custom 404 Error method is the way to go.
” I have been wondering whether to convert to MT 3.11, but I too am afraid of ruining my sites tha use it.” If you’re not making extensive changes like a different archive structure or moving to dyanmic pages, most people find the upgrade to 3.11 totally painless.
My own site took about 5 minutes, and I’ve got 5 years’ worth of archives.
That’s a good reason to get rid of the file extentions as discussed here:
Beautification Revisited
errr….
http://www.mikeindustries.com/blog/archive/2004/08/smart-urls-and-smarter-404s
I am continually flip-flopping on this issue myself. I’d like to go to Wordpress (which uses PHP), but I would really miss the Photoblogging capabilities of MT. (Sadly, no one has stepped up to create a nice, easy to use phtooblogging tool for Wordpress. Gallery has problems). Anyway, while I don’t have 20 minute rebuilds, I still can’t decide which way to go. I’m not a programmer and PHP scres the crap out of me.
Charlie has the answer.
I’ve used this method many times in marketing campaigns to gather hitpercampaign stats. It’s also been used in recent site upgrades - even if you can’t parse the exact entry from a url you should be able to direct the browser to a specific category -right?
take it easy.
ju