Hi

I am currently setting up SVN to maintain changes to my Drupal website:

  • MySQL data
  • Drupal releases
  • Publicly available modules and themes
  • My developed modules and themes
  • Site configurations files: Drupal and Apache

Note: To be clear, I am not talking about how to connect to the Drupal CVS repository

Rather than duplicating an effort that I assume others have traveled, for committing to SVN (for example), what is the recommended source and site tree has others laid out?

Some issues that concern me are:

  • Where in the tree to maintain MySQL data, and possibly database dump?
  • How to manage Drupul and module and theme updates with SVN that occur dynamically while running my Drupal site?

Thanks

Jeff in Seattle

Comments

dwadson’s picture

I have a subversion repository that contains Drupal core versions, modules and themes. I use Vendor Branches (http://svnbook.red-bean.com/en/1.0/ch07s04.html) to tag the latest version of modules, themes, core as "current".

In the SVN repo for the individual sites, I use Piston (http://piston.rubyforge.org/) to checkout the "current" version of modules or themes into the appropriate Drupal folders (eg. /sites/sitename.com/modules, /sites/all/themes, etc.):

piston import http://my.svn.server/svn/drupalrepo/modules/cck/current sites/all/modules/cck

Piston is really sweet for working with vendor branches - when I've loaded a new "current" version (with svn_load_dirs.pl) into my Drupal repo (with svn_load_dirs.pl) it's a simple command to update the version installed in my site:

piston update sites/all/modules/cck

Piston takes care of any file deletes/updates/additions seamlessly without having to do multiple svn delete, svn add commands.

jeff00seattle’s picture

Thank you

Referring to http://piston.rubyforge.org/index.html, install is as follows:
$ gem install --include-dependencies piston

But what is gem?

Tried to find an install for Red Hat EL 5 and yum and did not find it.

Thanks

Jeff in Seattle

dwadson’s picture

RubyGems is a package manager for Ruby.

For CentOS 5, I installed ruby and rdoc with yum and then manually installed RubyGems.

You can find install instructions at http://www.rubygems.org/read/chapter/3. A current version of RubyGems can be found at http://rubyforge.org/frs/?group_id=126.

jeff00seattle’s picture

Hi David

As I am adding modules and themes to my Drupal site, and begin to add functionality to this site, then what SVN steps should I perform:

  • Complete source control coverage of all changes to site?
  • Revert undesired changes to site?
  • Should I do a periodic MySQL dump to SVN?

Thanks

Jeff in Seattle

dwadson’s picture

The Backup and Migrate module is great for making backups into /files which can get committed back into your SVN repo.

Myself, I mostly use SVN on my sites for easy installation and updating of modules. Before making any significant changes to the site, like adding some modules to develop a photo gallery, I'll do a backup of the database and svn commit. Same thing if I'm updating modules - site offline, backup, commit, update the modules with piston update.

It also makes it simpler to migrate between a test server and a live server. Commit the changes on the development site, pull the changes into the new site and use Backup and Migrate to pull in the revised database.