I want to share local developement and staging DB — Is this very smart or very stupid?

Basically: I want my work to be meaningful and efficient. I am considering making my local development AND staging database the same thing.

I would develop on my local machine but have the SQL data stored on a web server.

I could build the site and move the important parts to staging where I can give the client access for writing text when they want to supply their own copy. I could keep building other features and pages while the client edits the contents on the staging and the database stays up to date for both parties.

I then sync project files (not database) from local to git + staging and client sees new pages up for text editing.

Is this viable? Are there shortcomings I'm not foreseeing? Has anyone done this?

If this is not how your agency does things, what's your way of development?

Topic workflow development-strategy mysql Wordpress

Category Web


this is actually the same method I follow when I'm about 60-80% complete with the total theme build. it allows my client (or my co-workers) to work on the content and update the pages and thus the database on the staging server while I continue working locally on other custom page development, templates, etc.

the only downside I've experienced is that it basically restricts you to theme coding-only during this timeframe since any database modifications you make locally will start to get difficult to track against the more active database on staging ... and if you aren't clear with communications or tracking progress, changes, etc. it can get messy real quick and content updates can get lost if you didn't know your local database was actually behind the staging db, etc.

probably works best for smaller teams, and strict compartmentalization of tasks you are assigning to other people!


Wordpress, and many of its plugins, store configuration data in the database. That alone could cause issues for the setup you described, but the urls of every link will also be stored fully canonicalized. So, unless you plan to test your staging setup from "http://localhost", you will have serious issues trying to click around multiple resources for testing.

It is far better to setup separate databases, and not just because of the difficulties I have outlined. Having completely separate environments frequently exposes flaws in programmers' assumptions. The more often you distribute and re-test software, the more flaws appear before they reach your production environment.

If you want the same exact content in both places, I recommend you write an automation script or two, to perform the migration as quickly as possible.

In any case, I would very strongly recommend against pursuing the environment you described.

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.