hey, i started to develop new site in drupal6 and i wonder what is the best way to set it up for dev/stage/production enviorment... svn? online paid service (i saw serval soultions sites that need to pay to do stuff) bash script for sync? please help
Here is how we do it: We have 2 servers 1 production and a second that houses dev environments for each developer and a "staging" environment. Code is stored in Git and we keep a master and live branch going at all times.
In a nutshell: "live" database is exported and distributed to developers using drush. Configuration and settings are "saved" using both features, and hook_update() and hook_install(). We use Feeds
After a depolyment We have a very simple shell script that leverages drush to copy the live database from the live server to staging on the dev server, and developers use the same simple shell script to pull the staging db to their own environment.
Configuration and Development that occurs in the database is exported via Features, and/or using install and update hooks. Using these three methods we are able to easily deploy about 99% of all settings, content types and other constructs that generally exist only in the database. The last 1% tends to be things that are easier handled with a deployment setup step rather than writing queries in hook_install and hook_update. 100% deployment is possible, but sometimes it's not really worth the effort.
Finally there are times when content needs to be deployed from stage to live. This is where the Feeds module comes in. using feeds and a simple csv import file we have successfully created and exported large taxonomy sets and even complex nodes and sets of nodes. Using feeds is also useful when you need a standard set of "test" data to populate your development databases.
When it comes time to deploy new features or settings we merge the developer changes in to the master branch, deploy and test on staging, which normally requires running update.php, and then "importing" the changes from the new or updated features. If everything passes tests and QA the changes are merged into the live branch and deployed on the production environment.
The biggest lessons we've learned are:
Check out drush and drush make. Drush is great for syncing stuff and be sure to check out the backup migrate module. Also take a look at the Features project which helps you capture database schemas in code (see also hook_update for that).
Also: Drupal is moving to git in a few weeks. Use git.
Wheeeee!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With