www.nickhodge.com

microsoft, munging and on being a mercurial iconoclastic professional geek.

De-commissioning old Content Management System

with 3 comments

Notes from De-commissioning old Con­tent Man­age­ment Sys­tem: The Mun­gen­etEn­gine. The engine has rendered 10 mil­lion image views and 2.5 mil­lion page views from hand­coded MySQL and PHP.

  1. cod­ing” in PHP feels wrong, wrong, wrong. A little dirty. After 6 months, I feel I should be writ­ing in C#, Iron­Py­thon; at least some­thing decent. Not PHP. It’s too lose. Like Visual Basic. Sadly, this will prob­ably the last time I use PHP for a sig­ni­fic­ant amount of time as I move to CLR/DLR style lan­guages and platforms.
  2. The code to com­plete the trans­ition was a mere 138 lines of PHP; ref­er­en­cing some open­source XML-RPC lib­rar­ies (to insert blog entries over the wire), and 2110 lines in the base lib­rary that acts as the old engine.
  3. Turn­ing off http://twitter.com/nickhodge for a few days helped pro­ductiv­ity. Also work­ing at home dur­ing the shenanigans of APEC 2007 helped pro­ductiv­ity, too.  I also stopped being as respons­ive on email, voice­mail etc to get some good “focus” time to get this happening.
  4. The code I am put­ting out to pas­ture was largely writ­ten in 2001–2. Small pieces were tweaked through 2002–7. It has sur­vived PHP 4.0.x to 5.2.x pretty unscathed. http://nickhodge.com/mn8/section/23/ details the his­tory and philo­sophy of the self-written and main­tained CMS.
  5. Word­Press is not the final step. It is just a good time to move a plat­form I trans­ition to other places in the future, some­where in the cloud.
  6. As Joel Pobar says, “hav­ing no policy on cache is a memory leak”. In my instance, the smart­ness of a cache for pro­duc­tion use to reduce hits on MySQL res­ul­ted in a bug that took 45 minutes to track down. Not as a memory leak, just unex­pec­ted behavior.
  7. Strategy: get images from the data­base into a fixed file sys­tem under http://media.nickhodge.com/. As per the wise guid­ance of UncleMike, this future­proofs my data. A part of the strategy is to move the rss feeds to a local feed sys­tem as I am not trust­ing feed­burner and feed­jum­bler for stats right now.
  8. Rendered pages: best thing to do is “wrap” what is con­tent with mark­ers, render the page via CURL, and per­sist what is wrapped into the Word­Press CMS. The how came to me in an after­noon nana nap. Con­scious brain was on hold, and the real smarts came to the fore. 
  9. Reg­u­lar Expres­sions. Why-oh-why where they inven­ted to make my brain explode? Thank­fully, the intar­webs helps.
  10. A shim of the Mun­gen­etEn­gine will remain in place to “301″ old URLs to new URLs. Full page ren­der­ing and image/binary ren­der­ing will be turned off. There­fore, the import mode will not be Word­Press RSS style import. Using http://www.dentedreality.com.au/bloggerapi/ to post via XML-RPC
  11. Mangling dates, and doing hand-crafted fixes to my Word­Press XML-RPC (note: this is patched for 2.3, evid­ently) took some hours.
  12. There are 761 blog entries prior to trans­ition.  From an earlier blog trans­ition on August 8th 2006, the count was 371. There have been 390 entries since. Post trans­ition, there are now 940 posts.
  13. Raw trans­fer com­plete at 6:50pm 5th Septem­ber 2007.
  14. To com­plete: neater clas­si­fic­a­tion of the new entries.

Written by Nick Hodge

September 5th, 2007 at 7:04 pm