July 14th, 2012

Setting Up Your Local WordPress Development Environment

I gave a talk at Wordcamp Boston 2012 entitled Avoiding Disaster: Setting Up Your Local WordPress Development Environment. Slides available in PDF and Powerpoint. Here’s the description of the talk:

Editing a WordPress site on a live server is quick and simple. It’s also one step away from disaster. The goal of this talk is to give you all the knowledge and tools you need to develop WordPress on a local machine, and then to push those changes to a live website. We will automate as much of the process as possible, giving you more time to actually develop your site instead of copying files back and forth or clicking dozens of menus to export and import databases. Topics discussed will include local web servers and databases, file version control (Git), and database synchronization.

Feel free to email me with any questions. Want to work with me? Head on over to Adaro Consulting.

Here is a list of resources I mention in the talk:

Not mentioned during the talk, but here are my favorite Git clients

Here is the command SQL code I referenced:

1) Run this command on the live server:

mysqldump -umyusername -p database_name > database_name.sql

2) Transfer database_name.sql locally (using scp or sftp)
3) Run this command on the local server:

mysql -uroot -proot database_name < database_name.sql

4) Run this command on the local server:

mysql -uroot -proot database_name < update.sql

The contents of update.sql should look like so:

SELECT * FROM wp_options WHERE option_name = “home” OR option_name = “siteurl”; UPDATE wp_options SET option_value = “http://localhost/local_folder_name” WHERE option_name = “home” OR option_name = “siteurl”

Of course, replacing “local_folder_name” with the name of your website.

  1. Thanks for the presentation Jon. It was very helpful.

  2. Laura on July 14th, 2012 at 3:17 pm
  3. yes, thanks Jon, really enjoyed the presentation and learned a lot.

  4. andy on July 15th, 2012 at 10:51 am
  5. I found your talk helpful too. It was what I needed to apply get right then.

    I really liked the sad little programmer video (where’d you get that?) because that is what I am feeling like at the moment.

    Also, you said something about there not being “version control” on MYSQL. I’ve implemented it on SQL Server (not too hard) but I wonder if there is something you can implement on MYSQL. I will have to check that out.

  6. Patty on July 17th, 2012 at 5:27 pm
  7. Thanks for all the kind words! I’m glad you all found it helpful.

    That lovely animated gif can be found here: http://photobucket.com/images/bloody%20keyboard%20gif/

    Patty, I have found various attempts at version control with MySQL, but nothing easy to implement nor anything that would really help with the whole syncing process.

  8. Jon on July 18th, 2012 at 2:30 pm
  9. Hey Jon, I like the idea you provided, keep up good work, its informative for all.

  10. Mariya on July 23rd, 2012 at 8:56 am
  11. Just watched your WordPress.tv speech. Nice. Love the animation! It looks like I’ll have to add Git support to DesktopServer. Currently it makes trading and backing up your WP sites about as easy as a opening an excel file. I’m looking at support more ZIP formats.

  12. Steveorevo on August 13th, 2012 at 3:27 am
  13. Excellent points altogether, you just gained a new reader. What might you recommend about your put up that you just made some days ago? Any sure?

  14. Depression Can Be Cured When You've Got Some Good Solutions! on April 28th, 2013 at 3:44 am

Leave a Reply