composerize-drupal icon indicating copy to clipboard operation
composerize-drupal copied to clipboard

Drupal 8.9 site's public_html folder structure unchanged after running Composterize, next steps?

Open anobjectn opened this issue 3 years ago • 4 comments

Hey I realize this is a noob question but I don't see this addressed in the documentation I've been using (drupal.org and the readme of this project).

I ran this on a local copy of an 8.8.19 site that was installed from a zip, into a public_html folder.

composer composerize-drupal --composer-root=. --drupal-root=./public_html

It finished and the last part of the feedback was: 74/74 [============================] 100% 32 package suggestions were added by new dependencies, usecomposer suggestto see details. Generating autoload files 26 packages you are using are looking for funding. Use thecomposer fund` command to find out more! Scaffolding files for drupal/core:

  • Copy [project-root]/.editorconfig from assets/scaffold/files/editorconfig
  • Copy [project-root]/.gitattributes from assets/scaffold/files/gitattributes
  • Copy [web-root]/.htaccess from assets/scaffold/files/htaccess
  • Copy [web-root]/robots.txt from assets/scaffold/files/robots.txt
  • Copy [web-root]/sites/example.settings.local.php from assets/scaffold/files/example.settings.local.php
  • Copy [web-root]/sites/example.sites.php from assets/scaffold/files/example.sites.php
  • Copy [web-root]/sites/default/default.settings.php from assets/scaffold/files/default.settings.php Completed composerization of Drupal!`

I was kinda hoping this would have transitioned the site to the recommended file structure with the web folder. Instead I still have the public_html but also with (presumably) the old vendors folder within it (there is a vendor folder in the project root, above public_html).

When I got to this state before, I was not able to update drupal core using the instructions for upgrading a composer based site. Feels like Im missing a few steps after running composerize-drupal and before attempting to update the core - that or the composerize-drupal didnt execute properly or completely?

And after running composerize-drupal, I would have thought running composer install would basically have no effect but instead another rabbit hole starting with several of these prompts: $compiser install composer/installers contains a Composer plugin which is currently not in your allow-plugins config. See https://getcomposer.org/allow-plugins Do you trust "composer/installers" to execute code and wish to enable it now? (writes "allow-plugins" to composer.json) [y,n,d,?]

I believe I am either in a place where I'm missing some basic information, or I am in some weird edge case that isnt straightforward - or some combination of both. Any helpful suggestions appreciated.

anobjectn avatar May 16 '22 23:05 anobjectn

Actually after: composer install composer require 'drupal/core-recommended:^9' 'drupal/core-composer-scaffold:^9' 'drupal/core-project-message:^9' --update-with-dependencies --no-update composer update then /update.php because zsh: command not found: drush when attempting drush updatedb

i get new modules/ profiles/ sites/ and themes/ folders that look like they are stock fresh drupal download were created alongside my public_html folder and the new vendor folder siblings..

I know a complete "diagnose and resolution" post would be difficult / impossible but can i get hints even? thanks

anobjectn avatar May 17 '22 00:05 anobjectn

I dont even understand by my composer.json has practically nothing in it, but i have tons of stuff in composer.lock and a vendors folder full of dependencies. I would have thought that at least drupal 8.xx would be in there as Im running (and cannot update from) 8.9.20 composer.json.txt composer.lock.txt

anobjectn avatar May 17 '22 01:05 anobjectn

based on the creation of folders in my project root folder, i cd to my public_html folder to run the above composer require 'drupal/core-recommended:^9' 'drupal/core-composer-scaffold:^9' 'drupal/core-project-message:^9' --update-with-dependencies --no-update and composer update .... this made the update proceed, and the drupal admin ui shows things as updated so I guess if version alone was the goal, it worked, but now i have composer.json and composer.lock in my public_html as well as the parent folder.

Can i just filemerge the two versions into the parent folder and delete the ones in public_html OR just use the newest versions moving them up to replace the prior revisions?

anobjectn avatar May 17 '22 14:05 anobjectn

It looks like I need the drupal 9 things from the public_html composer files but the contrib modules are in the set in the project root (which has Drupal 8 info). is this fixable or is this OK / supposed to be like this? composer.json.projectroot.txt composer.json.publichtml.txt composer.lock.projectroot.txt composer.lock.publichtml.txt

anobjectn avatar May 17 '22 14:05 anobjectn