I would like to have WordPress on my local OS X machine to test out different themes, content, etc and then deploy it on to the production Linux server. I’m using WordPress for my website and blogging will be a secondary thing. What is the best way to do this? Please elaborate on the key steps to create it.
I googled around and people talk of using Git, capistrano, editing something to fix some links, some are just the simple blog type setup on server, etc… all sounded too complicated for the basic blog setup.
I would like to keep user comments when updating production website. Not too worried about loosing my content but would be nice if I didn’t loose it.
See Codex for running a development copy of wordpress. You can make all the changes you want on the blog without affecting the production site by testing out new themes/etc which is what it seems like you’re looking to do.
http://codex.wordpress.org/Running_a_Development_Copy_of_WordPress#WordPress_2.7_-_3.0
The only way I can think of is through a backup/migration protocol. Unfortunately both server’s cannot point to the same DB because the site url and your widget/theme configurations are stored in the DB. So you still need two databases.
The secret sauce would just be how you migrate / copy. What you’ll be doing is taking a “snapshot” of your production database and migrating it to your test box. You don’t need to do this every time since you just need to have a “sampling” of the content from the live server. So backup your production database, migrate and deploy it to your development box, then do the same for your production files (the ‘wordpress’ directory and all its contents). Alternatively you may choose to just copy the ‘wp-content’ directory.
Mess around in your dev box to your heart’s content. Install plugins, edit themes, edit any php inside wp-content.
When you’re ready to deploy something to production, just make sure you don’t migrate the database from dev to prod! You can migrate the FILES from wp-content pretty easily.
Do note that if you are trying a plugin or new theme, just migrating the files isn’t enough: you still have to enable them in the back-end, since that’s a database write operation.
If you DO want to migrate all your configuration changes, BE CAREFUL. Before backing up and migrating the wp_options table of your database on the dev server make sure you set your production server into RELOCATE mode, since the wp_options also contains the site url.
Hope this makes sense. I’m writing shorthand, so if you need more explanation of anything, just leave a comment.