Upgrade Your Drupal Skills
We trained 1,000+ Drupal Developers over the last decade.
See Advanced Courses NAH, I know EnoughUpgrading Drupal Core With Vendor Branches and svn_load_dirs: Almost Perfect
Manual upgrades of Drupal core are more time-consuming and error-prone than need be. svn vendor branches can help, but it's still not perfect.
The critical thing to realize is that the basic unit of work in svn is the changeset. When I first started playing with vendor branches, I tried to take a shortcut and just diff two arbitrary branches anywhere in my repository. But without a changeset between two revisions, that will get you nowhere. svn can't automatically diff the branches - it will just delete every element and then re-add it. And that will only bring more chaos to a process where we are trying to restore order.
So we need to create a changeset between two revisions of Drupal. But remember why we want to automate upgrades in the first place. For major releases, this set of changes is going to be so complex that doing it manually would be prohibitively error-prone. It's also going to be a huge number of changes, which makes it time-consuming. What to do?
svn_load_dirs
This script will look at a (source) set of files in an svn repository, compare it to a (destination) set of files, and then automate whatever adds, changes, and deletes are necessary to make the source like the destination. It will check the changes in for you, and it will optionally tag the changeset.
If svn_load_dirs isn't already installed on your system, it can get a little tricky. You need to get svn_load_dirs.pl.in, rename it to svn_load_dirs.pl, then point it to your svn binary, which you can find like this:
$ which svn
/usr/bin/svn
Run svn_load_dirs with an older version of core as the source, and the new version as the destination, and we have a changeset that represents all the differences between those versions of core. Now we can merge that changeset with any other existing installation in the repository, and it will upgrade core without touching any of your contrib modules or themes. If you've hacked core at all, it should prompt you to perform a merge.
This worked beautifully for a little while, but there's a catch. Because I frequently partner with other developers, or work with code-savvy clients who need access, putting all my Drupal projects in the same repository won't work for me. And the catch is: you can't merge across repositories.
It would be nice, perfect actually, to have one repository where I maintain vendor branches, and upgrade core on all my Drupal projects from there. Having to maintain vendor branches in every repository that contains a copy of Drupal core is a hassle, but it works.
About Drupal Sun
Drupal Sun is an Evolving Web project. It allows you to:
- Do full-text search on all the articles in Drupal Planet (thanks to Apache Solr)
- Facet based on tags, author, or feed
- Flip through articles quickly (with j/k or arrow keys) to find what you're interested in
- View the entire article text inline, or in the context of the site where it was created
See the blog post at Evolving Web