2

I checked the other questions related to this topic, but half of them didn't get any useful answer and the other half didn't help me out.

I face with several issues building up a site using Drupal 8:

  1. The view exposed date filter doesn't work properly in 8.3.x
  2. The administrative theme doesn't work for roles other than administrator users

I wanted to upgrade a site from 8.3 to 8.4 as most of the patches are provided for 8.4, and I hoped that I would get less troubles.

Drupal 8.4 is just available as development snapshot, at this moment, and Drush didn't let me update the site to this version.

On top of all, the installed Drush version (v8.1.9) is not compatible with Drupal 8.4.

How do I update Drupal to 8.4 using the version of Drush I installed?

6
  1. Make a database backup.
  2. Make a Drupal code source backup.
  3. I had to know which drush I use:

    $ drush version
    Drush Version   :  8.1.9
    

    which isn't good for me.

  4. I had to find out whether it is a local or a global installation

    $ locate drush
    /usr/local/bin/drush
    $ dpkg -l | grep drush
    rc  drush    5.10.0-2ubuntu1
    

    it looks like the ubuntu package was removed before and it wasn't installed by pear:

    $ pear list
    
    Installed packages, channel pear.php.net:
    =========================================
    Package          Version State
    Archive_Tar      1.4.0   stable
    Console_Getopt   1.4.1   stable
    HTTP_Request2    2.2.1   stable
    Net_URL2         2.2.0   stable
    PEAR             1.10.1  stable
    PEAR_Manpages    1.10.0  stable
    PHP_CodeSniffer  2.5.1   stable
    Structures_Graph 1.1.1   stable
    XML_Util         1.3.0   stable
    

So, it can be only a global phar installation.

  1. I chose the WRONG WAY of the installation in the beginning which resulted a lot of more issues (I don't list them here) and finally a drush installation which I wasn't able to update my drupal
    Just for the record here is the wrong way: I decided I install drush by composer and if the global version confuses its functionality I will remove the old one from the file system manually

    I ran this command from the root directory of my drupal project
    $ composer require drush/drush
    This installed a lot of other packages and updated my drush from 8.1.9 to 8.1.12. Everything looked good at this point.

    $ drush version
Drush Version   :  8.1.12

$ drush up drupal
resulted

Unable to load class \Drush\VersionControl\Backup.

I removed the drush 8.1.12 and installed the drush 9.x version.
I wasn't able to update my drupal site, so I removed the local drush package and its dependencies.

  1. the WORKING WAY
    remove the composer version if that exists and install drush globally by phar
# Download latest stable release using the code below or browse to github.com/drush-ops/drush/releases.
wget https://github.com/drush-ops/drush/releases/download/8.1.16/drush.phar

# Test your install.
php drush.phar core-status

# Rename to `drush` instead of `php drush.phar`. Destination can be anywhere on $PATH. 
chmod +x drush.phar
sudo mv drush.phar /usr/local/bin/drush
  1. I updated my drupal from 8.3.4 to 8.3.5
    $ drush up drupal

  2. I got the package name of the drupal 8.4 by this command
    $ drush dl drupal-8 --select

 [0]  :  Cancel                                               
 [1]  :  8.4.x-dev  -  2017-Jul-22  -  Development            
 [2]  :  8.3.5      -  2017-Jul-05  -  Supported, Recommended 
 [3]  :  8.3.4      -  2017-Jun-21  -  Security

I chosed 0

  1. I updated my drupal from 8.3.5 to 8.4
    $ drush pm-update drupal-8.4.x-dev
Update information last refreshed: Mon, 06/26/2017 - 18:31
 Name    Installed Version  Proposed version  Message                     
 Drupal  8.3.5              8.4.x-dev         Specified version available

Do you really want to continue? (y/n): y

At the end I got 3 errors, but the update was successful.
Unfortunately the drupal 8.4.x-dev version didn't fix any of my issues.

  • 3
    Your test is exactly what is expected from this issue drupal.org/node/2874827. Drush 8.1.12 site-local Drush + Drupal 8.4.x: Does not work - Drush 8.1.12 phar + Drupal 8.4.x: Works (Not officially supported, this configuration runs with two autoloaders: one from Drush, and one from Drupal. This is a fragile configuration that can be broken over time) – 4k4 Jul 22 '17 at 20:10
5

It's best to update dependencies using composer:

composer update drupal/core --with-dependencies

Have a look at https://www.drupal.org/docs/8/update/update-procedure-in-drupal-8

Note that you'll also need drush 9.x: composer require drush/drush:9.*

See https://github.com/drush-ops/drush/issues/2738.

2

A tutorial is related to the update of 8.3 to 8.4 'Update to Drupal core 8.4, a step by step guide'

Also, not a direct answer to the question, but a good place to mention that this Drupal Composer helper intends to facilitate the update process.

The motive behind writing this plugin was to make a Drupal composer based setup more maintainable. It is easy to start with the template provided by drupal-composer/drupal-project but upgrading it is difficult. The plugin solves that problem by keeping all the code outside your project and in the plugin which would make upgrading as easy as running composer update.

1

When I ran composer update drupal/core --with-dependencies, I got the following error:

Package "drupal/core" listed for update is not installed. Ignoring.

So I moved "drupal/core": "~8.3" from the replace to the require section of the composer.json file.

I think it isn't recommended, but it works.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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