8

This question already has an answer here:

I installed (or downloaded) drupal 8 via:

composer create-project drupal/drupal my_site_name 8.0.*

Which, at the time I ran it, downloaded Drupal 8.0.1. Now drupal 8.0.2 is available and I'd like to update to this version.

I'm not sure how to update core but I decided to try running composer update from my drupal site's root directory.

This updates many packages (e.g.):

$ composer update
Loading composer repositories with package information
Updating dependencies (including require-dev)
  - Removing composer/installers (v1.0.21)
  - Installing composer/installers (v1.0.22)
    Loading from cache

> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
  - Removing symfony/class-loader (v2.7.6)
  - Installing symfony/class-loader (v2.7.9)
    Downloading: 100%

> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
  - Removing symfony/console (v2.7.6)
  - Installing symfony/console (v2.7.9)
    Downloading: 100%

(...)

> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
  - Removing twig/twig (v1.23.1)
  - Installing twig/twig (v1.23.3)
    Downloading: 100%

However I don't see anything about updating drupal/drupal. And when I visit my site's status report it still shows 8.0.1.

So how do I actually update core via composer?

marked as duplicate by Mołot, Scott Joudry, Shawn Conn, kenorb, Krishna Mohan Jan 25 '16 at 6:11

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • @rreiss: no that question doesn't address the issue that I'm running into which is that composer update doesn't seem to actually update drupal. Also the accepted answer is for drupal-composer/drupal-project which is not the project that I'm using. I'm following the information at Using Composer in a Drupal project – User Jan 23 '16 at 12:10
  • I find Eyal's answer vert relevant.. – rreiss Jan 23 '16 at 14:59
5

The best way to get started with Drupal 8 is to use the project drupal-composer/drupal-project:

composer create-project drupal-composer/drupal-project:8.x-dev some-dir --stability dev --no-interaction

The Composer project drupal-composer/drupal-project is structured differently than the project drupal/drupal, although both will produce the same executable Drupal site. drupal/drupal uses the wikimedia/composer-merge-plugin to include the composer.json file from the core directory that is part of the drupal/drupal project itself, which is a non-standard (but functional) way to load Composer dependencies. The drupal-composer/drupal-project, on the other hand, requires the Composer project drupal/core, which contains only the core directory from drupal/drupal. This follows the standard Composer dependency management techniques, which makes it easier to use Composer to manage upgrades.

If you start your Drupal site using this as your base project, you can still use composer update to update your contrib files, exactly as you show in your question. To update Drupal core, run:

./scripts/drupal/update-scaffold

First update the version of Drupal core in your composer.json file, as described in the README.

Once #77 is merged, Drupal core will automatically update every time you run composer update.

This is discussed in more detail in the blog post Fixing Shortcomings in the Composer Update Process with Drupal-Composer.

  • What's the difference between drupal/drupal and drupal-composer/drupal-project? – User Jan 16 '16 at 8:39
  • I updated the answer to contain a brief description. – greg_1_anderson Jan 16 '16 at 20:33

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