Join the open source coding forum

Is it possible to update Drupal 7 core automatically?

Is it possible to run a module for Drupal 7 which allows the automatic update process of the core files? What about all modules. Do I really need to update all modules and the core files always manually?

shah's picture

I would suggest to use drush to update Drupal core

Vote the answer: 
5
Average: 5 (1 vote)

Tarraccas's sandbox - is a module which updates the Drupal core by only one click. But it doesn’t update the modules and themes. You can update these from a native Drupal environment. And it is an experimental project suggested only to developers.
 
Except this, you can update your Drupal in two ways-
Update by a patch file - Before we start updating using patch file, it is safer to take a backup of your site. Backup some files like custom profiles, custom modules, custom themes, custom features, robots.txt is a must if you have changed any configuration in them. Then you can either create a patch file all by yourself or download the patch file itself from the Drupal server. Now just patching the file will update your Drupal. Now at the drive test the patch. The following command will do that for you-

patch -p1 --dry-run < drupal-current-to-drupal-latest.patch

Now if you don’t get any error message, then proceed to the final cut with the following command -

patch -p1 < drupal-current-to-drupal-latest.patch

 Update using drush - Backup is a good practice before this kind of change. Run the following command-

drush vset --exact maintenance_mode 1 
drush cache-clear all

These will take your site to maintenance mode. Now the update is just one command away.

drush pm-update drupal

The command will update database according to your necessity. Now, check whether the site is working properly. If so, it is time to go online.

drush vset --exact maintenance_mode 0 
drush cache-clear all

The above commands will do the job for you.

Among the three above-mentioned procedure, updating using drush is easy to follow. Hope this will answer your question.