Skip to content

Upgrading to a Drupal minor version

October 25, 2008 by Amr

If you use Drupal like me, then upgrading to the next minor release must be something you do every couple of months. I never asked anybody how they do it. So here I will write how I do it, in the same time I will be actually upgrading my blog to Drupal 6.6. My directory structure:
www/
    `-- amrmostafa.org/

Download and unpack

$: cd www
$: wget http://ftp.drupal.org/files/projects/drupal-6.6.tar.gz
$: tar -zxvf drupal-6.6.tar.gz
$: rm *gz

Examine the trees

Instead of moving files from Drupal-6.6 tree, we will move ours there. First step is to find which files we have added to the current drupal:
$: diff <(find amrmostafa.org | cut -d'/' -f2-) <(find drupal-6-6 | cut -d'/' -f2-)
Hail to the GNUs! In my case here is what I found (shortened for weblog use):
< sites/default/settings.php
< sites/default/files
< sites/default/files/.htaccess
< sites/default/files/color
< sites/default/files/color/minnelli-d374532c
< sites/default/files/color/minnelli-d374532c/....
< sites/default/files/color/minnelli-d374532c/...
So it's pretty clear to me now. The changes are settings.php of course, files directory and color module cache for minnelli theme which I use. Also. a usual difference is usually the contrib modules you have added. Alternatively, if you are using a revision control system like me (I use git), you could get away with this:
$: git status
Which produces:
# Untracked files:
#   (use "git add ..." to include in what will be committed)
#
#       sites/default/files/
#       sites/default/settings.php
That gives you the untracked files, which are probably cache, settings and that sort of stuff. What else would be there? The contrib modules/themes.

Merge the trees

Of course, we could have scripted the merge, but I never do this. Why? Because settings.php and others like .htaccess could have been changed between releases so I want to capture my personal customizations as well as any newly added bits in the 6.6 release. This is not easy. What I usually do is diff settings.php and .htaccess (if it had any changes) and move my customizations manually to the 6.6's one. The rest (files/, contrib modules ..etc) are probably safe to move right away.
$: diff -Nur amrmostafa.org/sites/default/settings.php drupal-6.6/sites/default/default.settings.php
In my case, there were no changes in the root's .htaccess file, so no need to diff. And for settings.php the only change were the database line. So it's safe to overwrite.
$: cp amrmostafa/sites/default/settings.php drupal-6.6/sites/default/settings.php
$: cp -rp amrmostafa/sites/default/files drupal-6.6/sites/default/
I've nothing else to move, but if you do have things like contrib modules, just move them over to the drupal-6.6.

Backup and conclusion

$: cp -r amrmostafa.org /path/to/backup/amrmostafa.org.$(date +%s)
$: cp -rp amrmostafa.org/.git drupal-6.6/
$: rm -rf amrmostafa.org/
$: mv drupal-6.6 amrmostafa.org/
Now just execute: http://example.com/update.php to get any possible new db updates. You are done! I know that's is ain't short as it ought to be. That's why I'm going to think about my approach a bit. I'm sure at least git would have helped me do it in few seconds. Suggestions? Please!

Comments

I like boobs!

October 26, 2008 by digital_sin, 1 year 39 weeks ago
Comment id: 7

I like boobs!

We all like boobs

October 26, 2008 by Anonymous, 1 year 39 weeks ago
Comment id: 8

n/t

boobs are great

January 13, 2010 by Anonymous, 28 weeks 3 days ago
Comment id: 3021

boobs are great! enjoy boobs!!
http://www.garbageetc.com/tag/b00bs/

LOL

January 22, 2010 by Anonymous, 27 weeks 1 day ago
Comment id: 3143

Nice comments going on here! Application Performance Management Software

http://www.bestcashadvanceonline.com

January 30, 2010 by Anonymous, 26 weeks 1 day ago
Comment id: 3178

great blog thanks for sharing that with me i will be using that soon.

tour golf shoes

January 31, 2010 by Anonymous, 25 weeks 6 days ago
Comment id: 3184

After reading you blog,Your blog is very useful for me .I bookmarked your blog!

lol

March 16, 2010 by Anonymous, 19 weeks 4 days ago
Comment id: 3495

very good post but the comments...hmmmm lol

than you for info

March 17, 2010 by Anonymous, 19 weeks 3 days ago
Comment id: 3502

tnank and good luck

Thank you!

April 10, 2010 by Anonymous, 16 weeks 6 hours ago
Comment id: 3631

Thank you for full description of the upgrading procedure. I hate when there appear new updates/fixes, it is always a risk for me to do something that I know nothing about :)

Virginia from Tips to lose weight faster

Very interesting site!

June 15, 2010 by Anonymous, 6 weeks 4 days ago
Comment id: 3894

Very interesting site! Thanks. I would like to create BEAUTIFUL but simple websites for myself. I want to do it myself so I am not dependent on a 3rd party for each and every update to the content. But I only want to spend about 3 hrs training myself. My other criteria is to be able to create visually attractive sites, not like the cartoonish feel of something built on Yahoo Sitebuilder.

oahu helicopter tours

Post new comment

  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

More information about formatting options

AdaptiveThemes