Last updated August 13, 2015. Created on March 22, 2012.
Edited by hansfn, David_Rothstein, Steve -cc, NewSites. Log in to edit this page.

These instructions are for updating - not upgrading. Documentation for upgrading an existing Drupal site (for example, changing from Drupal 6 to Drupal 7) is at http://drupal.org/upgrade.

These instructions show how to update Drupal core to a new minor version within the same major release series (for example, Drupal 7.1 to 7.2). These instructions are a simplified version of the corresponding information in the Administration & Security Guide. If you are not intimidated by the more complex instructions there, you may find it to be a better source of information for this procedure. In addition there are alternative procedures for people that use a shell:

Follow these instructions:

  1. Make a backup of your Drupal instance (database). (For ex: with MySQL)
  2. Download the latest release of your current Drupal version.
  3. Extract the [tar ball or zip] Drupal package.
  4. Set your site on maintenance mode (For ex: How on D7)
  5. Delete all the files & folders inside your original Drupal instance except for /sites and its sub-folders. This assumes that all of your custom work - including themes - is in the recommended spot - the /sites folder tree. If you have made custom changes elsewhere you will need to either preserve them or plan to replace the later. .
  6. Copy all the folders and files except /sites from inside the extracted Drupal package [tar ball or zip package] into your original Drupal instance location.
  7. Some updates do not include changes to setting.php and some do. See There is a way - Comment below for more on this. If the update release includes changes to settings.php you will need to replace your old settings.php in .../sites/default/ with the new one, and then edit the site-specific entries (eg database name, user, and password) in the setting file.
  8. If you have modified files such as .htaccess or robots.txt re-apply those changes to the new files.
  9. If you have a favicon.ico file that was deleted replace it too
  10. Login to your site as administrator or as user no 1
  11. Run update.php by navigating to http://...yourdrupalsitename/update.php and follow the process to update your Drupal instance
  12. Disable maintenance mode

Troubleshooting

  • If you experience problems during your site upgrade, see the Troubleshooting FAQ.
  • Instead of commenting here, please read the module project page and, if necessary, post an issue or post a message in the forums.

Looking for support? Visit the Drupal.org forums, or join #drupal-support in IRC.

Comments

peterohman’s picture

I suggest you modify the step 5 to: create a new directory in the root with the name drupal-old, and move all the files & folders inside your original Drupal instance except for /sites folder and any custom files you added elsewhere into it. Then add a step 13: When you have checked that the updated version works as expected, you can delete the directory drupal-old. Otherwise you can probably find the files you should have kept in this directory, and move them into the updated core...
/Peter

augustofagioli’s picture

I don't like the idea of deleting my websites (even part of).

Once backup, download are ready, what I usually do is :

tar -zxvf drupal_LATEST.tar.gz
mv my_drupal_webiste_root   my_drupal_webiste_root_PREV
mv mv drupal_LATEST  my_drupal_webiste_root
cp -Rfv my_drupal_webiste_root_PREV/sites my_drupal_webiste_root/

Following this approach, I can quickly recover to PREV with an easy

mv my_drupal_webiste_root   my_drupal_webiste_root_BROKEN
mv my_drupal_webiste_root_PREV  my_drupal_webiste_root
JakeRogers’s picture

Here's a line from a typical upgrade.txt file for a minor update... "4. Download the latest Drupal 7.x release from http://drupal.org to a directory outside of your web root. Extract the archive and copy the files into your Drupal directory."

Note that it does NOT "except the Sites" folder (as so stated in above instructions), which means your existing Sites folder will be overwritten...another major Drupal SNAFU.

Jake

VM’s picture

Based on the following of all of step #3 in the core upgrade.txt file, overwriting the old sites folder with a new sites folder isn't an issue.

Changes in the 'new' settings.php generated in step three would overwrite the old.
If the update did not include any changes to default.settings.php then this file being overwritten isn't an issue.

The point to not removing the old sites folder is to avoid losing or copying back and forth important files/folders specific to the install e.g., the files folder.

MarkGoldfain’s picture

This guide is pretty clear and straightforward.
Except I find step 7 to be vague:
" If the update release includes changes to settings.php replace old
settings.php in .../sites/default/ with the new one, and edit site-specific
entries (eg database name, user, and password) "
It would be nice to have a description of precisely how to determine if the
update release includes changes to settings.php.

Marque

Chasen’s picture

If you view the release notes for the new Drupal version as they are released there is a statement about whether the .htaccess, robots.txt, settings.php, etc. files have been changed.

For example, see here: https://www.drupal.org/drupal-7.34-release-notes for the statement "No changes have been made to the .htaccess, web.config, robots.txt or default settings.php files in this release, so upgrading custom versions of those files is not necessary."

EDIT: For anyone wondering, you can view the release notes from the download page of any module/etc (eg https://www.drupal.org/project/drupal) by clicking the Notes link to the right of the download links. It's good practice to do this for all major (and potentially minor) updates as developers often put messages there about upgrade paths, major changes, potential issues, etc.