Skip to content Skip to navigation

Drupal Core Upgrade Script

Posted by: 
Topics: 

I use a script like this to do Drupal core upgrades in no time flat.

You can also download the attached .txt file and re-name it '6-x-upgrade.sh'.

Remember to change '6.22' to whatever the most recent version of Drupal is.

#!/bin/sh
 
# Place this script in the directory above your drupal directory
# Give it execute permissions by running 'chmod +x 6-x-upgrade.sh'
# Then run it with the command './6-x-upgrade.sh'
 
curl http://ftp.drupal.org/files/projects/drupal-6.22.tar.gz | tar zxv
mv -v drupal drupal-old
mv -v drupal-6.22 drupal
rm -frv drupal/.htaccess
rm -frv drupal/sites
cp -frv drupal-old/.htaccess drupal
cp -frv drupal-old/backup drupal
cp -frv drupal-old/files drupal
cp -frv drupal-old/sites drupal
cp -frv drupal-old/webauth drupal
cp -frv drupal-old/webauth_logs drupal

After it's done, just hit update.php in your browser and you're done!