1

I converted a Drupal 7.xx site to Drupal 8.x manually. Updated it to 8.4.5 and tried to use composer to update it to 8.5.6 (Latest stable release). I have the original site as the public_html/drupal site and the 8.4.5 site is at public_html/drupal8/drupal-8.4.5. Composer, then drush seemed to work, but when I take the site out of maintenance mode, log in as admin, "Reports" still say it is at 8.4.5. Commands: composer update --with-dependencies and drush updatedb (I actually use vendor/drush/drush/drush updatedb) drush cr drush sset system.maintenance_mode 0 drush cr

I searched the docs, found a few suggestions elsewhere, but can't fix this. The bot on StackOverflow, where I have not gotten any response, suggested I post it here.

1
  • "drupal 8.x manually updated it to 8.4.5" -> this means you've downloaded Drupal as tar/zip to update? Then do the update to 8.5.6 the same way. If you want to update via composer create a composer based Drupal project, for example github.com/drupal-composer/drupal-project
    – 4uk4
    Commented Aug 16, 2018 at 12:36

2 Answers 2

1

Unless you created your site using composer create-project drupal-composer/drupal-project, Drupal core is not actually a dependency of your project; instead your composer.json file likely contains the line "name": "drupal/drupal". Effectively, your root composer file is the Drupal core package.

In this case you can only upgrade by manually downloading the new release.

See also: Why does "composer update drupal/drupal" not work?

Edit:

If you want to convert an existing D8 site to the composer-based workflow, the following steps should get you most of the way.

  • In a different location, use composer create-project drupal-composer/drupal-project:8.x-dev <my-new-site> to create the new project. (Confirm the removal of the existing git history, and if you are using version control, use git init; git add .; git commit to initialize the new repository.)
  • Look at the contrib modules installed in your current site's modules/ folder, go into the new project, and use composer require drupal/module1 drupal/module2 [...] to install them. (Any custom modules should be copied into the folder ./web/modules/custom/ in the new project.)
  • Copy the contents of your sites/ folder into the ./web/sites/ folder of the new project.
  • After backing up your database, go into your new project folder, and use vendor/bin/drush updatedb or vendor/bin/drupal upex to update your database with Drush or Drupal Console (both are installed by default).

At this point, your new project should be ready to serve the site; change your webserver configuration or symlinks to point at <my-new-site>/web (the web subdirectory, not the project folder itself).

2
  • So if I throw away the existing project, create a new project with composer, how do I migrate the 7.xx site to 8.5.6? (I used the migration tool to create the 8.4 site.)
    – Whitekn3
    Commented Aug 17, 2018 at 1:31
  • @Whitekn3 If you have already migrated from D7 to D8.4, it would be easier to reuse that database instead of starting from scratch. I have added some steps for creating a new composer project, and transferring your modules/configuration from the existing D8.4 site over to it. Commented Aug 17, 2018 at 6:11
0

I had the same issue, i found the answer in this discussion Update Core Using Composer Here is the 6 steps, works for me.

  1. Removed drupal/console package (if it already installed) composer remove drupal/console
  2. Removed drupal/console-* packages (if it already installed) composer remove drupal/console-core drupal/console-en drupal/console-extend-plugin.
  3. Removed vendor folder and composer.lock file.
  4. Edit composer.json : Add "drupal/core": "8.5.6" to require section, and remove replace section.
  5. Execute command composer update drupal/core --with-dependencies .
  6. Update database by Go to /update.php or drush updb -y.
1
  • I tried this, but step #1 doesn't work. If I run "composer remove drupal/console" I get "Your requirements could not be resolved to an installable set of packages". And problem 1 is the same as before: "drupal/core 8.2.x-dev requires symfony/psr-http-message-bridge ..."
    – arnoldbird
    Commented Apr 9, 2019 at 17:53

Your Answer

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

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