6

I need to update drupal install (core files + some contrib modules) through drush but as I run drush up it first correctly update the contrib modules but then fails on updating the core.

The main issue is that everything in the root directory is deleted and so is drush installation, plus a new folder (drupal 7.39) containing the new partial installation is created in the root.

This is the output:

(uiserver):uSOMENUMBER:~ > drush upc
Update information last refreshed: Ven, 08/21/2015 - 00:19
 Name                                  Installed Version  Proposed version  Message                   
 Drupal                                7.38               7.39              SECURITY UPDATE available 
 Advanced CSS/JS Aggregation (advagg)  7.x-2.14           7.x-2.15          Aggiornamento disponibile 
 Chaos tools (ctools)                  7.x-1.7            7.x-1.9           SECURITY UPDATE available 
 Markup (markup)                       7.x-1.1-beta1      7.x-1.2           Aggiornamento disponibile 
 Metatag (metatag)                     7.x-1.5            7.x-1.7           Aggiornamento disponibile 


NOTE: A security update for the Drupal core is available.
Drupal core will be updated after all of the non-core projects are updated.

Security and code updates will be made to the following projects: Advanced CSS/JS Aggregation [advagg-7.x-2.15], Chaos tool suite (ctools) [ctools-7.x-1.9], Markup [markup-7.x-1.2], Metatag [metatag-7.x-1.7]

Note: A backup of your project will be stored to backups directory if it is not managed by a supported version control system.
Note: If you have made any modifications to any file that belongs to one of these projects, you will have to migrate those modifications after updating.
Do you really want to continue with the update process? (y/n): y
Project advagg was updated successfully. Installed version is now 7.x-2.15.
Backups were saved into the directory /*/*/*/*/htdocs/drush-backups/*/*/modules/advagg.                                     [ok]
Project ctools was updated successfully. Installed version is now 7.x-1.9.
Backups were saved into the directory /*/*/*/*/htdocs/drush-backups/*/*/modules/ctools.                                     [ok]
Project markup was updated successfully. Installed version is now 7.x-1.2.
Backups were saved into the directory /*/*/*/*/htdocs/drush-backups/*/*/modules/markup.                                     [ok]
Project metatag was updated successfully. Installed version is now 7.x-1.7.
Backups were saved into the directory /*/*/*/*/htdocs/drush-backups/*/*/modules/metatag.                                    [ok]

Code updates will be made to drupal core.
WARNING:  Updating core will discard any modifications made to Drupal core files, most noteworthy among these are .htaccess and robots.txt.  If you have made any modifications to these files, please back them up before updating so that you can re-create your modifications in the updated version of the file.
Note: Updating core can potentially break your site. It is NOT recommended to update production sites without prior testing.

Do you really want to continue? (y/n): y
Unable to load class \Drush\VersionControl\Backup                                                                                                                         [error]
Unable to load class \Drush\VersionControl\Backup                                                                                                                         [error]
(uiserver):uSOMENUMBER:~ > ls
drupal-7.39  logs  sites

I'm on a 1and1 shared hosting and followed this guide for a proper installation.

Minor changes I did from what the guide says are:

  • Disregarding the paragraph on access from remote machine & aliasing (as I'm not interested in it)
  • Using php5.5-cli instead of php5.5 for DRUSH_PHPexport in my .bash_profile: this was done to fix this issue (anyway it fails even by using php5.5).

I'm using drush 8.0-dev.

This is the file structure before updating:

(uiserver):uSOMENUMBER:~ > ls -la
total 39808
drwx---r-t 16 uSOMENUMBER ftpusers     4096 Aug 21 00:56 .
drwxr-xr-t  6 root      root         4096 Aug 21 00:14 ..
-rw-------  1 uSOMENUMBER ftpusers      638 Jul 27 13:23 .bash_history
-rwx---r-x  1 uSOMENUMBER ftpusers      764 Aug 20 22:54 .bash_profile
-rwx---r-x  1 uSOMENUMBER ftpusers      507 Jul  2 15:36 .bashrc
drwx---r-x  4 uSOMENUMBER ftpusers     4096 Jul  2 15:36 .composer
drwx---r-x  3 uSOMENUMBER ftpusers       32 Jul  2 15:36 .drush
-rw----r--  1 uSOMENUMBER ftpusers      174 Jun 21 10:51 .gitignore
-rw----r--  1 uSOMENUMBER ftpusers     5826 Jul  2 15:52 .htaccess
drwx---r-x  3 uSOMENUMBER ftpusers      124 Aug 21 00:46 .subversion
-rw----r--  1 uSOMENUMBER ftpusers    98401 Jun 21 10:51 CHANGELOG.txt
-rw----r--  1 uSOMENUMBER ftpusers     1481 Jun 21 10:51 COPYRIGHT.txt
-rw----r--  1 uSOMENUMBER ftpusers     1717 Jun 21 10:51 INSTALL.mysql.txt
-rw----r--  1 uSOMENUMBER ftpusers     1874 Jun 21 10:51 INSTALL.pgsql.txt
-rw----r--  1 uSOMENUMBER ftpusers     1298 Jun 21 10:51 INSTALL.sqlite.txt
-rw----r--  1 uSOMENUMBER ftpusers    17995 Jun 21 10:51 INSTALL.txt
-rw----r--  1 uSOMENUMBER ftpusers    18092 Jun 21 10:51 LICENSE.txt
-rw----r--  1 uSOMENUMBER ftpusers     8167 Jun 21 10:51 MAINTAINERS.txt
-rw----r--  1 uSOMENUMBER ftpusers     5382 Jun 21 10:51 README.txt
-rw----r--  1 uSOMENUMBER ftpusers     9642 Jun 21 10:52 UPGRADE.txt
-rw----r--  1 uSOMENUMBER ftpusers     6604 Jun 21 10:51 authorize.php
drwx---r-x  2 uSOMENUMBER ftpusers       48 Jul  2 15:34 bin
-rw----r--  1 uSOMENUMBER ftpusers      720 Jun 21 10:51 cron.php
-r-----r--  1 uSOMENUMBER ftpusers 40437884 Aug 20 23:26 d.tgz
-rw----r--  1 uSOMENUMBER ftpusers      872 Jul 28 18:29 drupal-update.sh
drwx---r-x  4 uSOMENUMBER ftpusers       84 Aug 20 22:36 drush-backups
drwx---r-x  4 uSOMENUMBER ftpusers     4096 Jun 21 10:53 includes
-rw----r--  1 uSOMENUMBER ftpusers      529 Jun 21 10:51 index.php
-rw----r--  1 uSOMENUMBER ftpusers      703 Jun 21 10:51 install.php
drwxr-xr-x  3 root      root         4096 Aug 21 00:14 logs
drwx---r-x  4 uSOMENUMBER ftpusers     8192 Jun 21 10:53 misc
drwx---r-x 42 uSOMENUMBER ftpusers     4096 Jun 21 11:00 modules
-rw----r--  1 uSOMENUMBER ftpusers      105 Nov  3  2014 php.ini
drwx---r-x  5 uSOMENUMBER ftpusers       98 Jun 21 10:51 profiles
-rw----r--  1 uSOMENUMBER ftpusers     1479 Jun 21 10:51 robots.txt
drwx---r-x  2 uSOMENUMBER ftpusers     4096 Jun 21 10:52 scripts
drwx---r-x  4 uSOMENUMBER ftpusers      144 Aug 20 22:36 sites
-rwx---r-x  1 uSOMENUMBER ftpusers      128 Aug 20 22:11 test.sh
drwx---r-x  7 uSOMENUMBER ftpusers     4096 Jun 21 10:53 themes
-rw----r--  1 uSOMENUMBER ftpusers    19986 Jun 21 10:52 update.php
-rw----r--  1 uSOMENUMBER ftpusers     2178 Jun 21 10:52 web.config
drwx---r-x  2 uSOMENUMBER ftpusers       74 Nov  3  2014 webscripts
-rw----r--  1 uSOMENUMBER ftpusers      417 Jun 21 10:52 xmlrpc.php

How can this be fixed?

3 Answers 3

5

I was having a similar issue. I tried to run drush up drupal and it was returning Unable to load class \Drush\VersionControl\Backup. I can confirm that removing drush from my composer.json file solved this issue. My steps were: remove drush from the composer.json, run composer update and then re-run drush up drupal.

I'm also using Drupal 8.1.9. Just updated to 8.2.

Hope this also helps others.

Thanks Marco.

2
  • I know this is old, but... what if you only have Drush installed in /usr/local/bin/drush and still get the Unable to load class \Drush\VersionControl\Backup error?
    – TerranRich
    Jan 22, 2018 at 14:42
  • Actually, I followed your steps and still get the …Backup error. Weird. :(
    – TerranRich
    Jan 22, 2018 at 14:45
4

After some testing, I found a solution: although installing drush in the same drupal folder may work for updating single modules, it will break your site if you try to update the core.

Apparently, you should never install drush in the same folder of drupal. So the issue is solved by moving the drupal installation into ~/drupal/ and install drush into ~/.

2

You are using Drush 8, but your Drupal is Drupal 7. Try to use Drush 7.

2
  • I tried this - it doesn't work. Feb 21, 2018 at 23:57
  • This issue has appeared with Drupal 7.57 and downgrading Drush 8 to 7 solved the issue to me. Thanks @ccosta
    – caligari
    Feb 22, 2018 at 11:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.