Upgrading Drupal Core

How to upgrade the Drupal core.

We've been recommending that you use Subversion to manage your Drupal site, so these instructions are geared towards using it to upgrade.

The instructions also presume that your site can be taken offline during the upgrading process. If you've have a site that you can't take offline while the process is completed, you've got a whole other set of complicated issues to deal with!

These instructions were written based on upgrading Drupal 5.7 to Drupal 5.10.

Prepare the current site
Before you proceed with upgrading the site, there's a few recommended steps to take to ready the live site for updating:

  1. Log into your site as USER 1 (the root user, created during initial install), and place the site in Offline mode (/admin/settings/site-maintenance).

  2. Backup your existing site and database
    Using the Backup and Migrate module, make a backup of your database (/admin/content/backup_migrate).
    IMPORTANT! Multi-site installs using a single Drupal core need to backup each site's database!

  3. Commit the live site to the Subversion repository.
    svn commit -m "Site prepped for Drupal core update."

  4. Optionally, at this point you can create a tag of the site in your svn repo. Change the release number as necessary for your particular site.
    svn copy http://svn.example.com/svn/projectname/trunk \
    http://svn.example.com/svn/projectname/tags/release-1.0 \
    -m "<projectname> prior to Drupal core 5.10 upgrade"
  5. Switch your theme back to the default theme (''Garland' in 5.x) (/admin/build/themes).
    IMPORTANT! Multi-site installs need to do this for every site using the codebase!

  6. Turn off all modules that are not Core Modules (/admin/build/modules).
    IMPORTANT! Multi-site installs need to do this for every site using the codebase!

Create the updated site copy

  1. Download the new Drupal core:

    cd /var/websites/projectname
    wget http://ftp.drupal.org/files/projects/drupal-5.10.tar.gz
    tar zxvf drupal-5.10.tar.gz
    rm drupal-5.10.tar.gz
  2. Copy the following files from the backup directory into your Drupal site directory:
    • .htaccess

      cp -p htdocs/.htaccess drupal-5.10/
    • sites/default/settings.php (but see section on older sites below)
      cp -p htdocs/sites/default/settings.php drupal-5.10/sites/default/
    • the files directory
      cp -pr htdocs/files drupal-5.10/
    • any other files you need from the 'backup' directory, such as your cron scripts in scripts/ or subdomain folders. Ex:
      cp -r htdocs/sites/all drupal-5.10/sites/
  • IMPORTANT! Delete any .svn from the folders you've copied into the new Drupal core:
    rm -rf `find drupal-5.10 -type d -name .svn`

    Activate the new Drupal core and upgrade your modules

    1. Adjust your Apache configuration to serve the new copy of the site. This likely means editing /usr/local/apache2/conf/extra/httpd-vhosts.conf and changing the DocumentRoot and <Directory> directives to the new Drupal 5.10 folder. Remember to restart Apache after you make the changes.

    2. Run update.php by going to http://www.example.com/update.php with your web browser.
    3. Check the site status page (/admin/logs/status) and confirm that things are working ok.
    4. Delete any of your outdated modules and download the new versions for your Drupal core. Ex:
      cd drupal-5.10/sites/all/modules
      rm -rf date
      wget http://ftp.drupal.org/files/projects/date-5.x-2.0-rc3.tar.gz
      tar zxvf date-5.x-2.0-rc3.tar.gz
      rm date-5.x-2.0-rc3.tar.gz
    5. Activate the non-core modules that your site was using prior to the upgrade (/admin/build/modules).
    6. Download new versions of any custom themes that need upgrading.
    7. Run update.php by going to http://www.example.com/update.php with your web browser.
    8. Check the site status page (/admin/logs/status) and confirm that things are working ok.
    9. Change your theme back if you weren't using Drupal's default theme.
    10. Put your site back online (/admin/settings/site-maintenance).
  • Recent Updates

    • 1 year 11 months ago
    • 1 year 11 months ago
    • 1 year 12 months ago
      php 8.x
    • 1 year 12 months ago
      10.6.7
    • 1 year 12 months ago
      Drop Centos 5/6 stuff