The updatephp Script

The update.php script, pictured in Figure A-12, automatically runs through any underlying database changes that a module requires in order to move from one version to another. Whether you're updating between minor or major versions of Drupal and contributed modules, update.php is the piece that ensures your data ends up in the places that it should when all is said and done.

The script lists all of the enabled modules on your site, and specifies whether updates are required to be run. A progress bar counts up as each module is updated. And finally, at the end, a report is generated with the database changes that were performed, along with any errors that occurred.

Because update.php performs updates against the database, it's very important to create a backup of your database before running this script. The Drupal handbook has instructions at http://drupal.org/upgrade/ backing-up-the-db.

Drupal

y Overview

Updating

y/ Select updates ► Run updates

Remaining 0 of 4. Updating imce module

100%

Review log

Figure A-12. The update.php script, which performs database updates between versions

Figure A-12. The update.php script, which performs database updates between versions

The update.php script is intended to be run by User 1. If you are not using the User 1 account, you need to edit the settings.php file manually in order to be able to run the update script. You must change the $update_free_access variable in settings.php so that it is equal to TRUE rather than FALSE.

But be careful, if you change this value in settings.php, make sure that you change it back to FALSE as soon as you are done running the update script! Failure to do so means that anonymous users might be able to rerun database updates, which could cause all manner of problems.

0 0

Post a comment