grasmash / composerize-drupal

Convert a non-Composer-managed Drupal application (e.g., one created via tarball) to a Composer-managed Drupal application.
MIT License
125 stars 20 forks source link

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

Open anobjectn opened 2 years ago

anobjectn commented 2 years ago

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:

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 commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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