Shared publicly  - 
 
WooHoo! Published on Smashing Magazine! Check out my newest WordPress tutorial yay!
This article explains how to develop your WordPress sites using MAMP.
3
Tom Graber's profile photoRyan Olson's profile photoPauli Price's profile photoMelissa Vargas's profile photo
4 comments
 
Nice!

I am too lazy & stupid for this. I just go MAMP > Backup Buddy > production site. If I wanted to do it right, this would be the definitive guide.

Well done sir. Well done indeed.
 
Congratulations on being published on Smashing Mag.

One thing I noticed. You don't mention the problem of serialized data in the wp-options table. The wp-options update statement you provide will break any serialized data that has the domain name in it, unless the dev and production domains have the same character length.

Serialized data look like this:

a:2:{s:6:"alumni";s:3:"Yes";s:11:"custom_logo";s:76:"http://www-dev.example.com/wp-content/uploads/company_logo_swoosh.gif";}

a:2 means array with two elements
s:6, s:3, s:11 and s:76 indicate string values of a given length

The options data work out to this:

alumni: "Yes"
custom_logo: "http://www-dev.example.com/wp-content/uploads/company_logo_swoosh.gif"

If the length of the custom_logo value changes, because the production domain name has a different character count, the s:76 part has to change in line with the new data. Otherwise the serialization is invalid - the options data will fail to 'unserialize', and the theme, widget or plugin will loose all the settings in the serialized option -- the entire array will be discarded, not just the one element with the mismatched string length.

Perhaps you could get the Smashing Mag editors to allow you to add a footnote? Your readers will thank you.
 
Congrats Ryan! And thank you for all the insights you share with, you know, regular folk.
Add a comment...