Since Composer is the widely accepted standard for building websites running the current Drupal version, Remote Administration (RA) uses only Composer builds and updates to ensure that dependencies are included in the current Drupal version or contributed module update.
RA will continue to use Drush to detect insecure modules.
Requirements
Installations of the current Drupal version
must be built with a fully functional composer.json
file including all
code necessary to run your codebase, and containing no package conflicts.
Important
Updating Drupal core using Drush does not guarantee dependency updates are included, which may cause errors on your website. Acquia recommends you to build and update websites running the current Drupal version using Composer. Acquia can provide only limited troubleshooting support for websites updated on production environments using Drush.
Minimum requirements for a composer.json file for RA
The following outlines the minimum requirements for a composer.json
file to be compatible with Remote Administration:
The
composer.json
file for your website must be located above thedocroot
directory in your repository. Do not move thecomposer.json
orvendor/
directory packaged with Drupal core, located inside of thedocroot
directory. The following example shows a repository with thecomposer.json
file andvendor/
directory in the correct locations relative to your repository’s root:The
vendor/
directory must be located in the repository’s root above thedocroot
directory. This directory must be managed through version control, and the proper autoloading must be set up to redirect Drupal to the newvendor
location. For more information, see Drupal scaffold.A Drupal
composer.json
file must specify at least the following basic information:"repositories": { "require": { "require-dev": { "config": { "conflict": { "extra": { "installer-paths": {
The require section of the
composer.json
file needs to list Drupal core and all contributed modules, packages required to run your Drupal website, and the minimum php version for your site requirement."require": { "php": "7.1" }
In the
config
section, you must specify your platform php version:"config": { "platform": { "php": "7.4" } }
All Drupal code must be located within the docroot folder.
All non-Drupal files added to any directory must either be added as a public repository, added as a private repository, excluded using drupal-scaffold, or recreated through patches declared in your
composer.json
.
Important
The RA composer.json
RA file templates includes everything
required to make your composer.json
file compatible with RA. If you
are building a new website or converting an existing website to a Composer
build, Acquia recommends you use this template as a starting point.
How RA automation works with Composer
The Remote Administration update process performs a series of update commands against your website on the RA environment, determines any needed updates, applies the changes, and notifies you, as described in the following steps:
The latest production code and a copy of your production database are copied to the RA environment.
Your codebase is examined for a valid
composer.json
file above thedocroot
directory.If a valid
composer.json
is located, RA will proceed with the update process.If no
composer.json
file is located, RA will revert to applying updates using Drush. For the current Drupal version, refer to the important note about the current Drupal version and using Drush for updates.
The code is scanned for the following types of updates with the
drush pm-updatestatus
command:Security updates for contributed modules
Bugfix updates for specified contributed modules
Bugfix and security updates for Acquia-managed modules
The most recent version of Composer is temporarily installed on the RA environment.
Composer updates are determined and applied with the
composer update --dry-run
command in your RA environment to ensure yourcomposer.json
file has no errors preventing updates from completing. No changes are made to your codebase. If conflicts requiring resolution before applying updates are detected in yourcomposer.json
file, you will receive an Acquia Support ticket notifying you of these conflicts so you can resolve them.Composer performs the
composer update package/name --with-all-dependencies
command to update your package to the highest available version allowed by the version constraints in yourcomposer.json
file.Database updates are applied with the
drush updb
command.To provide faster security updates, the Stage File Proxy module is enabled to mirror files—instead of copying them—from your production environment to your RA environment.
If new updates are identified, you will be notified with an Acquia Support ticket when these updates are ready for testing.
RA file templates
The Acquia RA Composer
GitHub repository has an example composer.json
file you can use
as a starting point for creating your website’s composer.json
. The
repository has the following files:
composer.json
: An example file for Composerreadme.md
: How to use thecomposer.json
annotated.composer.json
: An annotated example file with explanations of the configuration sections
To use the example Composer file, you can download the file and copy its
contents into your own composer.json
file. Alternately, clone the
repository and then copy the file to your website’s repository.
Important
You must change the example Composer file to include all the modules your website requires. Copying the example file into your code repository without modifications will prevent RA from providing you with updates, and may also cause website downtime.