Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top


Development server (testing environment): Windows 7 with XAMPP, Visual SVN Server and Trac

Live server (staging and live environments): Amazon EC2 with Ubuntu 10, Apache, PHP, MySQL and VNCServer

Developer machine: Putty, TortoiseSVN, TightVNC and WinSCP.


  • We are working in a WordPress website
  • The edition of content is done in the "live environment"
  • The programming of the theme is done in the "testing environment"
  • The "staging environment" is just for testing everything before deploying to "live"
  • We have 3 copies of the same WP db for "testing", "staging" and "live"
  • I connect to Amazon server using an SSH connection and several tunnels for Remote Control, MySQL Administration and SFTP


  1. What's the best way to syncronize the live, staging and testing WP databases?
  2. Can I create a .bat file or use a program to automatize the deployment from testing to staging?


share|improve this question

migrated from May 12 '11 at 19:32

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

If your just working on the theme do you need to keep the dbs synced?

See this very detailed answer on for some best practices on moving from development to production.

One of the answers includes a plugin (direct download link) that handles the database changes for you.

share|improve this answer

Thanks Chris,

I find this script very nice for the job:

Althouh I already found a problem. I don't know how to extract the sql.gz file in windows using php...

I'm looking at exec()...

The other problem is, should I connect via SSH to Amazon EC2, create a tunnel and then connect to MySQL using "localhost" or should I connect to Amazon EC2 MySQL directly thru the IP address?

I still have to install the SSH module in Apache in the local server

share|improve this answer

Your Answer


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