Very often, the wonderful Drupal security team comes up with a new security release of Drupal core itself.
When that happens, you want to upgrade relatively quickly (after waiting for 24 hours to make sure no-one is having problems...) you don't want to just copy the new version over the old, since it is possible that a single file is split into two, for example, or one is removed, and you don't want conflicting code hanging around in your file system. And you certianly don't want to be futzing around deleting stuff manually.
You want a clean, accurate and fast install every time.
(This assumes that nothing has ever been installed before. For a site running on a Drupal coreĀ not originally installed with CVS see the next section.)
To do that, make sure you carry out original install of Drupal core via CVS, then it is just a matter of a simple CVS update command specifying the new Drupal release.
To checkout a specific Drupal release (here 6.8) to a new specific sub-directory which will become Drupal document root, here "www", execute the following:
$ cvs -z6 -d:pserver:anonymous:anonymous@cvs.drupal.org:/cvs/drupal co -d www -r DRUPAL-6-8 drupalExecuting this statement on the command line will create a new Drupal document root just below the current directory, called "www". If I omit "-d www", then it will create a new Drupal document root called "drupal".
Just visit drupal.org homepage to see which is the current release, and which releases you should be upgrading to.
Well, a lot of us have sites we wish Drupal core had been installed via CVS, so we could just carry out the upgrade instructions in the following section. However, if the Drupal core was simply untarred from an installation tarball or FTP'd into place, you can neither carry out the upgrade, nor can you safely checkout anything (CVS won't overwrite stuff, and some new files will come down, leading to a big mess and unpredictable results).
You are going to have to futz around deleting the existing core very carefully, and then do the checkout into a blank space - but at least it will be the last time! The following would typically be the procedure to follow:
The ideal with default/settings.php would be:
However you got here, your Drupal core is a working copy of a CVS tagged release of Drupal. So you can now enjoy the benefits of being able to upgrade with a simple checkout statement for the remaining life of the site!
This is to be executed within document root! That is, if I had created a new Drupal install at document root "www", I would change directory to www and then executing the following will upgrade to Drupal 6.9:
$ cvs update -dPr DRUPAL-6-9If you omit "r{release tag}", in this case "DRUPAL-6-9", you will check out HEAD, which you won't be wanting to do on a production site!
Simple, clean, efficient, easily reversible: you can't beat it.