Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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.

share|improve this question

migrated from stackoverflow.com May 16 '11 at 5:36

This question came from our site for professional and enthusiast programmers.

    
Do you want your local version to mirror your live version in real time, or do you just want something to test out production and wanted the comments and content to stay so that you actually have content to test it out on? By the by, I'd look into perhaps increasing that accept rate. It's not shocking, but it's not great either. –  DouglasMarken May 16 '11 at 4:35
    
The latter. Something to test out production, try new themes and want comments and content to stay so I can test it out. Noted on accept rate. -Hiren. –  HM1 May 16 '11 at 19:34
    
We have some questions that deal with similar issues on this site: Easily Move a WordPress Install from Development to Production?, What process do you use for WordPress development?, or other questions in the "Related" column to the right. –  Jan Fabry May 27 '11 at 20:12

2 Answers 2

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.

share|improve this answer

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

share|improve this answer
    
Although that is what they want. But they also want to mirror the content on the live site instead re downloading the en files –  xLRDxREVENGEx May 27 '11 at 20:23

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.