« Drupal and JQuery UI | Main | Color Blind simulator »

August 25, 2010

Upgrade/Update Drupal Core

This post was originally for Drupal 6.15-6.16. I'm generalizing it for all core updates. Hopefully, I will convert to Drush soon which will make this post obsolete.

A catalog of steps. Mostly drawing from:

$ gedit drupal-6.19/UPGRADE.txt

1. Backup up the database using phpMyAdmin and this tutorial.

- This downloads a sql.gz file to your local drive. I use filezilla to sftp it to a backup directory on the webserver (~/blah/drupal)

2. Backup the sites folder and .htaccess

Confession - I once "backed" up my development Sites/ folder only to find that it was faulty. Probably a command line error but I discovered it AFTER deleting the original Sites/ folder!! I would strongly advise you to unpack the file created below to ensure that the backup was successful before completing step 6.

$ ssh uniqname@itcs_sftp_login.umich.edu (get to ITS Linux console)

% cd sites/
% tar -czf live_sites_Aug25_2010.tar.gz *
% mv live_sites_Aug25_2010.tar.gz /blah/drupal/Aug2010/
% cp blah/.htaccess blah/drupal/Aug2010/

3. Take the site off-line at Administer > Site Configuration > Site Maintenance

4. Disable all contributed modules. Update this list when updating again. I'm fairly certain the core modules can be left on.

If you're wondering whether this step is necessary you can pine with these folks. Note, I didn't disable modules while updating my dev site and had no problems. I'm disabling them on the live site though. Paranoia.

*See below the fold for a list of enabled modules.

5. Use Filezilla to transfer new Drupal core package to webserver (e.g. drupal-6.19.tar.gz).

Put new drupal files into place

6. Destroy old Drupal directory, recreate it and populate it with new Drupal files:

% rm -rf blah/research/
% mkdir research
% tar -xzf drupal-6.19.tar.gz
% mv drupal-6.19/* blah/research/

7. Copy .htaccess back in

% cp -rf blah/.htaccess blah/research/

8. Place old sites folder into new install

% rm -rf Public/html/research/sites/
% mkdir Public/html/research/sites

% cp blah/live_sites_Aug25_2010.tar.gz blah/sites/
% cd blah/sites/
% tar -xzf live_sites_Aug25_2010.tar.gz

9. If you are also updating modules at this time, upload them to the web server (again, I use Filezilla and put them into a Private directory) and unpack them.

% cp -rf blah/newModules/*.tar.gz blah/sites/all/modules/
% tar -xzf phone-6.x-2.17.tar.gz
% rm -rf *.tar.gz

10. Run update.php

11. Enable modules (see list below the fold.)

12. Run update.php again

13. Several file permission errors crop up at this point (due to ITS server configuration rules), run this command to solve those:

% find blah/sites/default/files/ -type d -exec fs sa {} umweb:servers write \;

CTools was also complaining about permission settings for files/ctools and files/ctools/css. This command got rid of those errors (note that, due to ITS server settings, these permissions are not very important):

% chmod 777 default/files/ctools/
% chmod 777 default/files/ctools/css

14. Run update.php once more to confirm that the error log has nothing new. I'm pretty sure steps 10-14 can be done more efficiently.

15. Check out the site to make sure everything is working correctly.

16. Put site back online.


*4a. List of enabled modules:(as of Aug 25, 2010):


Autocomplete Widgets
CCK Fieldgroup Tabs
Content Copy
Location CCK
Node Reference
Node Referrer
Option Widgets
Phone - CCK

Chaos tools
Chaos Tools Custom Plugins
Page manager
Views content panes

Date API
Date Popup
Date Timezone

Node import

ImageAPI GD2
ImageCache UI

GMap Location
Node Locations

Advanced help
Image resize filter
Nice Menus
Node Export
Node Export Files
Panels stylizer

Mini panels

jQuery UI

Bonus: Views Export
Views UI




/.htaccess webBackup/
$ sudo cp -rf /blah/sites/ webBackup/
$ sudo cp -rf /blah

I also did a backup of the whole drupal directory due to paranoia:
$ tar czf alpha_backup.tar.gz /var/drupal/

9. Got this error:
The selected file /tmp/fileKxVVzn could not be uploaded, because the destination sites/default/files/js/gmap_markers.js is not properly configured.

Fixed following this comment.
$ sudo chmod a+w /sites/default/files/js/

10. I had to mess with the image folder permissions to get things going:

$ sudo chmod 777 files
$ sudo chmod 777 files/imagefield_thumbs/images/blogs/
$ sudo chmod 777 files/resize/images/blogs/

11. Put site back on-line!

Posted by kkwaiser at August 25, 2010 11:23 AM


Login to leave a comment. Create a new account.