[wp-hackers] Using Live Database with Development environment

Simon Dunton simon at wpsites.co.uk
Fri Mar 2 11:32:19 UTC 2012


I'm working on a project that I'm hoping eventually will integrate
with git but it's not in the code base yet, just a planned feature.

Your project sounds interesting is it on github or anything online?

My project is https://github.com/WPsites/WPide/tree/v2dev - that's the
dev branch that I hope to have completed soon and pushed to the
WordPress repo. Contributions welcome.

As for "Using Live Database with Development environment" I've been
trying a new approach recent. Our web server stack is Nginx -> Apache
so at the Nginx level we can route the dynamic requests (WordPress) to
the live server or duplicated the codebase and put it on another
server and route the requests to a dev install that may or may not use
the same database as your live site. It's totally transparent from the
frontend whether you're on the dev site or live, it's all happening
behind Nginx. The key here is the domain is the same on dev and live
so the dev code and even database could be applied directly to the new
site when you're ready to push the changes.

Ordineraly Nginx routes all requests to the live site. Then you add
some extra stuff to the Nginx config to route requests to the dev
server that either come from a certain users IP or what I'm doing is
routing requests to the dev site based on logged in cookies. So if my
WP logged in cookie is detected then I see the dev site, everyone else
carries on as usual with the live site.

Since dev and live will look identical from the frontend it's good
practice to put some banner code in the dev site so that you get a
good indication of which site you're looking at.

Simon

Message: 4
Date: Fri, 2 Mar 2012 12:04:03 +0100
From: Kokarn <kokarn at gmail.com>
Subject: Re: [wp-hackers] Using Live Database with Development
       environment
To: wp-hackers at lists.automattic.com
Message-ID:
       <CAPbD_NNXaV0Fz4EAfTU=zc2SumxzLzkFtxG1ZuzpRVS9CDwjfw at mail.gmail.com>
Content-Type: text/plain; charset=ISO-8859-1

We're working on this as well.
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.

It's a challenge, to be sure :)


More information about the wp-hackers mailing list