Hey all,
I've been scouring the web & forums for a foolproof method to merge databases from multiple developers. If I have developer 'A' working on theming certain parts of a site and developer 'B' working on theming others, I need a way to keep all changes in sync.
I have an SVN repository set up to handle web files. This works great for files but I cannot find a similar system for keeping my databases in sync.
I know there are several modules out there to assist with this (DatabaseScripts, Deploy etc) but none of these seem to offer a full, comprehensive solution.
How do others deal with this problem?
If need be, willing to pay a small consulting fee to help develop a solution.
Thanks,
Arthur
Comments
Typically we just don't
Typically we just don't ...
Our workflow generally follows this path. (We have a local dev environments (MAMP), a shared dev environment, & production)
That should be most possible change. Note: With this workflow, content creation should be done directly on the production env (or if you have a staging env that can be used too, but that gets more complicated.)
The key to this workflow is that you always backup/restore in the Prod->dev direction; NEVER the other way around.
Views via SVN
Since Views allows other modules to define their own custom views, we get the ability to move views around as files for free. The first step is to create a custom module, or add to an existing one. Then use the bulk export tool (admin/build/views/tools/export). This will output code that you can copy and paste into your module.
The workflow ends up looking like this: Developer makes changes to the view with Views UI module. Developer then exports that view, and (re)places that view in the custom module. The developer then commits the changed module to the svn repository. Once the other developers update their working copies, they will need to clear their views cache, but the changes to the view will be there. With this method you should even be able to turn off Views UI on the production site.
I should also add that the above workflow is the one I have been using on almost every project lately; it actually seems to be are really popular method. If you go that route, the one thing that we have found to work quite well is to keep a narrative document about your database changes. With your list in hand, when it comes time to push those changes live by clicking through forms, nothing gets forgotten.
just so you know, this is an
just so you know, this is an age-old issue that many folks have spent a lot of time trying to solve! the basic problem is that so many configuration options are set via the web UI and saved in the db.
we use a nasty manual method not unlike bleen18 above, but are trying to move to a better solution that can be properly tracked by revision control. in addition to the deploy module, have a look at features, and custom approaches like this one from Sacha Chua. i'd love to see the community hone in on a canonical solution to this problem, though.
good luck!
Thanks all for the quick
Thanks all for the quick responses.
It seems like Features and Context modules are a good solution. Bleen18 have you ever looked into those?
Another approach I am thinking about is using a shared database and using SVN to manage all codefiles.
This is all quite frustrating... appreciate the help.
--
ROOT DOWN!
Design & dev specializing in music industry
Brooklyn, NY
A tale of frustration
I've actually had "Investigate Features Module" on my to do list for longer than I care to admit...
As for your "shared db" approach... I suspect you're not going to like that solution. Here is a sample use case that illustrates why:
Ha! Hysterical. But yea I see
Ha! Hysterical. But yea I see your point.
It seems like your approach (listed earlier in thread) applies to sites that have already launched. Does it also apply to sites in early development (sandboxes, repo and staging server)? I ask b/c I will be adding a lot of content directly onto my sandbox, so I have some nodes to work with while Im theming.
Really appreciate everyones input. Ill do my best to contribute whatever I can!
--
ROOT DOWN!
Design & dev specializing in music industry
Brooklyn, NY
Our workflow works (for us)
Our workflow works (for us) in both situations ... early dev and post launch...
1) for early dev, we just use the super-cool "devel generate" module (part of devel) to make bogus content for theming, etc...
2) for post launch, we are grabbing the whole DB (content included) form backup & migrate so we already have content to work with
Genius. Just checked out the
Genius. Just checked out the SVN blog post on your site.
Are you available at all on phone or in person (as a consultant) if I have more questions?
--
ROOT DOWN!
Design & dev specializing in music industry
Brooklyn, NY
I've sent you an email so we
I've sent you an email so we can take this offline...er...online...um... so we can speak privately.
What about drush?
Bleen,
Any way to make this work with Drush on both local and live?
$dev = ($_SERVER['HTTP_HOST'] == 'local.bleen.net');
$db_url = $dev ? 'mysqli://root@localhost/db_name' : 'mysqli://username:pAsSwOrD@mysqlhost/db_name';
$db_prefix = '';
$_SERVER['HTTP_HOST'] doesn't seem to apply, therefor defaults to the live db.
Thanks
yes ... for Drush support I
yes ... for Drush support I typically use some unique value in the $_ENV superglobal ... something like this:
if(isset($_SERVER['HTTP_HOST'])){
$server = $_SERVER['HTTP_HOST'] == 'local.bleen.net' ? 'dev' : 'prod';
}else{
$server = $_ENV['user'] == 'local_user' ? 'dev' : 'prod';
}
$db_url = $server == 'dev' ? 'mysqli://root@localhost/db_name' : 'mysqli://username:pAsSwOrD@mysqlhost/db_name';
At DrupalCamp 7 Dan from
At DrupalCamp 7 Dan from Agaric actually presented a method using Git with Capistrano that achieves what you are looking for (merging multilpe developers' work, and I think this method retains timestamped changelogs per user submission so that indvidual changes can be reviewed).
Might be something to look into, though I'm not 100% on what advantages it may have over standard SVN and what its drawbacks might be.
I'm personally reading up on Features, it's pretty dope.
Yes, everything-in-code plus features is a good approach
Some raw notes / links here:
http://data.agaric.com/node/480
Working on releasing a write-up of updates in code with features assist best practices.
benjamin, agaric
Check out this link from
Check out this link from Development Seed.
Seems like a great way for adding functionality (views, content types, blocks etc) but it doesnt cover migrating actual content (nodes).
Anyone have a simple way to deploy from an SVN repo to a staging server?
--
ROOT DOWN!
Design & dev specializing in music industry
Brooklyn, NY
Experience with Context & Features?
Does anyone have any first hand experience with context & features working?
From reading the description it sounds like it would help quite a bit, but just wondering whether it works as promised?
another discussion about this
another discussion about this has sprung up at http://groups.drupal.org/node/44232
So exporting / importing
So exporting / importing module config settings, views, content types etc are straightforward using the Features module.
How does everyone solve the content migration problem? There are a few modules out there (biggest ones are DBscripts & Deploy) but neither seem to be foolproof.
Anyone have a solid dev > prod workflow?
--
ROOT DOWN!
Design & dev specializing in music industry
Brooklyn, NY