composer – Installing Acquia BLT on an existing site

We have a working Drupal 9 installation (running within Docksal), which has pretty much the whole install living in docroot/ except for the config/ directory, which is a sibling of docroot/. This application is fairly plain-vanilla–no custom modules, just some well-known contrib modules and normal config. I will refer to it herein as the “working app.”

In order to get this application onto Acquia Cloud and set up our CI/CD we hope to use their BLT utility.

We have tried several approaches to get BLT working with this application:

  1. Create a Docksal Drupal 9 BLT boilerplate application and attempt to use
    composer install to get the same set of modules as the working app, and
    then import the working app’s configuration with fin drush cim.
  2. Create a Drupal 9 BLT
    boilerplate application
    and hand-edit composer.lock with selections
    from the working app’s composer.lock file, run composer install, and
    then import the working app’s configuration using fin drush cim.
  3. Install BLT within the
    working app as described here:
    https://docs.acquia.com/blt/install/adding-to-project/.

Approaches 1 & 2 did not work because of incompatibilities between the BLT boilerplate app’s composer configuration requirements (minimum-stability dev and prefer-stable true) and those configurations in the composer.json file of the working app. There were also version incompatibilities between the contrib modules in the working app and those which the BLT boilerplate app wanted to install. Hand editing the composer.json file also proved equally fruitless.

Using approach 3 we got as far as installing BLT in that the blt/ directory and associated files are now present, but blt doctor complains of a missing docroot/docroot directory. Looking at the differences in the filesystem layout between the BLT boilerplate app and the working app made it seem like it might be worth trying to move vendor/, sites/, composer.json and composer.lock up one level from within docroot/ such that those two directories and two files are now siblings of docroot/ and seeing if that satisfies blt doctor. Doing this of course breaks the application and makes composer unhappy. I have tried the following:

  1. Deleting everything in vendor/ and running composer install
  2. Running composer dump-autoload
  3. Hand-editing docroot/autoload.php looking for and
    attempting to edit incorrect filesystem locations within the
    relocated vendor/ directory

As you can imagine, none of the above have worked and we are just about at the end of our patience with this endeavor.

I have a few general questions:

  1. Are any of the three approaches above likely to result in a successful BLT install?
  2. With regard to approach 3, is there a generally accepted method of moving either vendor/, composer.* and/or the sites/ directory as described above?

Thank you in advance for any general or specific help you can offer.