[wp-hackers] Using Live Database with Development environment

Andrew Spratley aspratley at gmail.com
Wed Mar 7 12:17:00 UTC 2012

If anyone's interested I've knocked together a very simple script to
do a DB dump and restore and search and replace so it's relatively
easy to sync a live DB to a dev environment.


****N.B I haven't widely tested this and it's still very much a work
in progress, use at your own risk.

This is just for DB syncing, you will need to handle the file sync yourself.

2012/3/2 "Matthias P. Würfl" <mpw at taquiri.de>:
> Am 02.03.2012 12:04, schrieb Kokarn:
>> Trying to build a development environment based on git that works with
>> multiple wordpress installations.
>> The problems we are facing right now is that some things we do in the
>> database data and some we do in the structure.
>> When we then try to push the changes we need to figure out a good way to
>> prioritize what changes to be made and stuff like that.
> We use svn and figured out how to cope with the file changes. The solution
> is to handle [A] 3rd-party code (Wordpress), [B] own code and
> site-configuration (Theme), [C] Data and [D] host-dependent configuration
> different. This can be done, because these four "file-classes" can live in
> seperate directories.
> Because with the database changes it isn't as simple as with the files we
> store the most relevant parts of the configuration in files (i.e. Database
> conn, Base URLs and directory names). Every host knows the configuration of
> each other host and replaces URLs pointing to other hosts on the fly with
> own URLs with an output_buffer. The Hosts knows which files to use by
> comparing their names with HTTP_Host.
> Our remaining problem is changes to the host-independent Configuration (i.e.
> theme options) in db. We can't just copy the DB from live to dev, check it
> and copy it back because we would lose changes made to live in the meantime.
> We can't use the live-DB on the dev machines beacause the whole purpose of
> dev and staging is that changes are checked before the go live.
> Grüße, Matthias
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers

More information about the wp-hackers mailing list