Reputation: 2449
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
Upvotes: 4
Views: 2296
Reputation: 1
Once you setup multiple environments (dev /stage/ prod), you can use git, subversion in order to keep and sync the code accross multiple environmets. But after that, you will face the following problem: how to push - pull content between environments.I know this is a very old question, because is a very old problem too. We work on this problem for a year, in our company, darwoft. Please, take a look to our tool. www.drumine.com . Basicly, we can assign the same id to objects accross multiple environments. We are going to be in december 10th 2015, in http://camp.drupalchile.org/ explaining how it works.
Upvotes: 0
Reputation: 1831
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:
Upvotes: 5
Reputation: 168705
This is probably one of the mist asked questions about Drupal - it's one area where Drupal is fairly weak.
You may want to have a look into Aegir. This is a Drupal-based platform designed to make deployments and updates easier.
It uses Drush behind the scenes, so if Aegir seems like overkill for your needs, Drush may be what you need. Drush is Drupal's command-line shell, which allows you to do actions on a Drupal site using the command prompt or within batch scripts.
Between them, these two pieces of software are Drupal's recommended way of managing your deployments.
Note that Drush (and therefore Aegir) has some features that only work when running on a Linux platform, so if your Drupal system is hosted on Windows, you may find things a bit harder.
Upvotes: 1
Reputation: 38418
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!
Upvotes: 3