Community Documentation

Upgrade process

Last updated May 1, 2011. Created by bekasu on September 6, 2009.
Edited by wmostrey, eliza411, Carolyn, jensimmons. Log in to edit this page.

Note: DO NOT run install.php at any time during an upgrade. It will empty your content from the database.

Upgrade Steps

  1. Backup your existing site and database.
  2. Log in as user ID 1 (the site maintenance user).
    This is the user name that you created during the installation process for your site.
  3. Put your site in maintenance mode
    Go to the site maintenance page (Administer > Site configuration > Site maintenance or http://www.example.com/admin/settings/site-maintenance). Select "Off-line" and save the configuration. If you have defined a custom maintenance theme in your settings.php file, comment it out before proceeding.
  4. Change all themes to Garland
    Go to the Themes page (Administer > Site building > Themes or http://www.example.com/admin/build/themes). Enable "Garland" and select it as the default theme. If you have been using a separate theme for administration, select "Garland" for your administration theme as well. You can find the administration theme setting at (Administer > Site configuration > Administration Theme or http://www.example.com/admin/settings/admin)
  5. Disable non-core modules
    Go to the Modules page (Administer > Site building > Modules or http://www.example.com/admin/build/modules). Disable all modules that are not listed under "Core - required" or "Core - optional". It is possible that some modules cannot be disabled, because others depend on them. Repeat this step until all non-core modules are disabled.

    If you know that you will not re-enable some modules for Drupal 7.x and you no longer need their data, then you can uninstall them under the Uninstall tab after disabling them.

  6. Remove default settings file
    On the command line or in your FTP client, remove the file sites/default/default.settings.php
  7. Remove all old core files and directories
    Remove all old core files and directories, except for the 'sites' directory and any custom files you added elsewhere. If you made modifications to files like .htaccess or robots.txt, you will need to re-apply them from your backup, after the new files are in place.
  8. Remove uninstalled modules
    If you uninstalled any modules, remove them from the sites/all/modules and other sites/*/modules directories. Leave other modules in place, even though they are incompatible with Drupal 7.x.
  9. Download Drupal 7
    Download the latest Drupal 7.x release to a directory outside of your web root. Extract the archive and copy the files into your Drupal directory.

    On a typical Unix/Linux command line, use the following commands to download
    and extract:

    wget http://drupal.org/files/projects/drupal-x.y.tar.gz

    tar -zxvf drupal-x.y.tar.gz

    This creates a new directory drupal-x.y/ containing all Drupal files and directories. Copy the files into your Drupal installation directory:

    cp -R drupal-x.y/* drupal-x.y/.htaccess /path/to/your/installation

    If you do not have command line access to your server, download the archive using your web browser, extract it, and then use an FTP client to upload the files to your web root.

  10. Re-apply modifications to core files
    Re-apply any modifications to files such as .htaccess or robots.txt.
  11. Make your settings.php file writeable
    Make your settings.php file writeable, so that the update process can convert it to the format of Drupal 7.x. settings.php is usually located in sites/default/settings.php
  12. Run the update script
    Run update.php by visiting http://www.example.com/update.php (replace www.example.com with your domain name). This will update the core database tables.

    If you are unable to access update.php do the following:

    • Open settings.php with a text editor.
    • Find the line that says:

      $update_free_access = FALSE;

    • Change it into:

      $update_free_access = TRUE;

    • Once the upgrade is done, $update_free_access must be reverted to FALSE.
  13. Backup your database
    Backup your database after the core upgrade has run.
  14. Upgrade fields
    If you were using CCK (and perhaps additional modules) to create fields for your content types, you will need to upgrade the data in those fields as a separate step. Download the Drupal 7 CCK module, and turn on Content Migration. Go to Structure > Migrate Fields or http://example/com/admin/structure/content_migrate for a page to walk you through the migration process. There are now several types of fields in core, but not every type. You might need to download Drupal 7 versions of contributed modules to support other types of fields. Learn more about migrating content from CCK to Core Fields.
  15. Update contrib modules and themes
    Replace and update your non-core modules and themes, following the procedures at http://drupal.org/node/948216
  16. Check the Status Report
    Go to the Status Report page (Administration > Reports > Status or http://www.example.com/admin/reports/status). Verify that everything is working as expected.
  17. Make sure setting.php is secure
    Ensure that $update_free_access is FALSE in settings.php.
  18. Remove write permissions.

  19. Remove your site from Maintenance Mode
    Go to the Maintenance Mode page (Administration > Configuration > Development > Maintenance or http://www.example.com/admin/config/development/maintenance). Disable the "Put site into maintenance mode" checkbox and save the configuration.

Comments

UPGRADE YOUR 6.X SITE TO the MOST RECENT LEVEL B4!!

I went through the process above, but my site was at an older version of 6.0. Nowhere does it state (as far as I could see) I must be on the most recent version of 6.x before I can upgrade. I followed the steps, uploaded 7.X files, updated db and it hosed my site. FML.

Getting the following error:
PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'mobiles_job.blocked_ips' doesn't exist: SELECT 1 FROM {blocked_ips} WHERE ip = :ip; Array ( [:ip] => x.x.x.x) in drupal_is_denied() (line 1635 of /home2/mobiles/public_html/includes/bootstrap.inc).

Yes it does say to do this, 2

Yes it does say to do this, 2 pages back in this book http://drupal.org/node/550152

Edit update.php

I had the same error while running the update script, but opening the settings.php-file, doing the changes described in step 12 ($update_free_access = TRUE;) and rerunning update.php solved the problem.

upgrade from drupal6 to 7

7. Remove all old core files and directories, except for the 'sites' directory and any custom files you added elsewhere. If you made modifications to files like .htaccess or robots.txt, you will need to re-apply them from your backup, after the new files are in place.

Step 7, are we deleting all directories in the root drupal directory and remaining with only with "sites" directory?

Yes, after making a backup

Yes, after making a backup (or two). You'd have a backup before you start, then the post-update backup, and of course, you are doing all of this first on a copy of your site.

Step 7 - yes remove all old

Step 7 - yes remove all old files except for the 'sites' directory.
then you bring in the core files from Drupal 7, and continue with the upgrade process.
You don't need the old core D6 files or directories and you are replacing with the new D7 files and directories

E Ismail
econpost.com

Clear your browser cache before running update.php!

This should be added to the instructions.

Clear your browser cache before running update.php!

If your browser still has an open session with your D6 site when you run update.php, it will throw an error. This also corrupts your database, making it impossible to upgrade to D7 without first restoring your database from a backup.

The error will look something like:

DatabaseSchemaObjectExistsException: Cannot add index <em class="placeholder">system_list</em> to table <em class="placeholder">system</em>: index already exists. in DatabaseSchema_mysql->addIndex() ( ...

"There is nothing, absolutely nothing, half so worth doing as simply messing around in boats!"
Grasmash.com - Drupal Tech Blog

So did emptying cache work?

So when you emptied your cache then your upgrade worked?

So did emptying cache work?

So when you emptied your cache then your upgrade worked?

Upgrade to 7

Just simply sucks if you have any contributed models.

Error in upgradation

Displaying the following error in upgradation:

PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'seoabcin_seoabc.blocked_ips' doesn't exist: SELECT 1 FROM {blocked_ips} WHERE ip = :ip; Array ( [:ip] => 127.0.0.1 ) in drupal_is_denied() (line 1779 of C:\wampz\www\seoabc\includes\bootstrap.inc).

Please help