Shell script to update a Drupal installation to a newer version.
I am hosted by MediaTemple gridserver, so the settings might be different depending on your hosting. However, it should be working on any LAMP (Linux-Apache-MySQL-PHP) server stack.
- SSH access to your server to execute shell script.
- versions : a PHP micro-site which allows you to have an overview of your Drupal installations, rading the json file generated bye versions.sh.
- update.sh : a tiny shell-script which download a specific version of Drupal and update a specific website. Doesn't perform database update.
- versions.sh : a tiny shell-script which browse a specific folder for Drupal installations, parse the CHANGE.txt looking for the version, and write a json report.
- Copy the two shell script (update.sh and versions.sh) to a path were script can be executed by SSH.
- Edit update.sh and set variables values :
downloadpath: path to a temporary folder where drupal installation folder will be downloaded.sitepath: path to your domains folder (where all your domains are listed).htmlfolder: path to the public html subdirectory, relative tositepath(where the index.html file is located, ex.: "/html", "/private_html").scriptdata: path to the scripts location (where versions.sh is located).
- Edit versions.sh :
root: path to your domains folder (where all your domains are listed).output: path to the json file, which should be located inside the versions micro-site folder.
- Copy the versions folder to a web-acessible location. This micro-site will allow you to have an overview of your drupal installations.
- Connect by SSH to your server and execute
sh update.sh. - It will ask for a version of Drupal to download (ex.: 6.28 or 7.22) and a website to update (ex.: example.com).
- The shell-script will also trigger versions.sh to update the json file.
- You can navigate to the versions micro-website to see an overall of your Drupal site status.