Drupal Updates
You can now find a drupal upgrade script on github and for drupal modules installation! Beware that this script was written for my site setup and works for me, maybe not for you, as you have other site setups, etc. I wrote it with respect to other setups though, but will never guarantee that :) If you are reluctant, try drush instead - though drush screwed my page up at least :/
Recently, I needed to upgrade my drupal installation and was quite surprised by the complexity of a drupal system update. Therefore, I sum up the steps necessary here, to simplify the process next time.
- Put site into maintenance mode (switch to garland?)
- Backup database (mysql) -> use phpmyadmin (save in dedicated directory) with a template like
nesono.com_%Y-%m-%d
- Unpack drupal in
/var/
(will be e.g. in directory /var/drupal-6.11) - Copy stuff (check
settings.php
vsdefault.settings.php
first!) cp /var/www/sites/default/settings.php /var/drupal-6.11/sites/default/
cp -r /var/www/tmp /var/drupal-6.11/
cp -r /var/www/sites/default/files /var/drupal-6.11/sites/default/
cp -r /var/www/sites/all/modules /var/drupal-6.11/sites/all/
cp -r /var/www/sites/all/themes /var/drupal-6.11/sites/all/
cp -r /var/www/sites/all/libraries /var/drupal-6.11/sites/all
chown -R www-data:www-data /var/drupal-6.11
- stop apache
- Move the new drupal directory to the document root
rm -rf www.bup
mv www www.bup
mv drupal-6.11 /var/www
- Run
update.php
within document root - start apache
http://www.nesono.com/update.php
- Put site back online (deactivate maintenance mode again)
As a shortcut for steps 5 to 7.1, you can copy & paste the following line into your terminal:
/etc/init.d/apache2 stop && rm -rf www.bup && mv www www.bup && mv drupal-6.11 www && /etc/init.d/apache2 start
And boom! That’s it.
Cheers, iss