Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

SETUP

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.

FACTS

  • 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

QUESTIONS

  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?

Thanks!

share|improve this question

migrated from stackoverflow.com May 12 '11 at 19:32

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

add comment

2 Answers

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

See this very detailed answer on WordPress.StackExchange.com 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
add comment

Thanks Chris,

I find this script very nice for the job:

http://www.bin-co.com/blog/2008/10/remote-database-backup-wordpress-plugin/

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
add comment

Your Answer

 
discard

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