Just some notes I jotted down while managing a first Drupal 8 site entirely with composer.
Local Setup
Composer template for Drupal projects. Quick installation via composer create-project drupal-composer/drupal-project
This project template should provide a kickstart for managing your site dependencies with Composer.
Further Info: Composer template for Drupal projects
Initial Deployment:
- Transfer
composer.json
andcomposer.lock
to your server. - Transfer the directory
scripts
(and its contents) manually to your server. At least for me Composer didn’t manage to create it. - Make the Root-Directory writable.
- Exectute
composer install
. - Manually transfer the files (not directories) in the root level of the
web
directory if they haven’t been created by Composer (web/*.php
undweb/.htaccess
). - Import a MySQL-Dump and add credentials to either
settings.php
(if deploying to production) orsettings.local.php
when deploying to a stage environment. Make sure to include local settings and don’t mix up local settings of different instances.
Backup Migrate with Composer
Generally editing a composer.json file directly is frowned upon. Installing this with the command line worked for me in a three step process.
Add the vcs repository dependency:
composer config repositories.backup_migrate vcs https://github.com/backupmigrate/backup_migrate_core
Note you can call the repository what you want.
Add psr/log dev dependency:
composer require "psr/log":"dev-master"
Add backup migrate
composer require drupal/backup_migrate
This worked for the backup_migrate alpha
Source Problem installing with composer. #2822885 | Drupal.org