Back up & Restore / migrate your composer-managed site using the command line

Overview

Taking regular backups of your website is an important step in ensuring the long-term health and stability of your application.

With Drupal, there are a few things to keep in mind when considering your backup approach.

Recommended Method for Installing, Updating, and Managing Contributed Module Libraries Using Composer

The best-recommended method for handling libraries required by the Contrib modules is through Composer. The Contrib  modules includes a composer.libraries.json file that lists all the required libraries. To install and manage these libraries, you will merge the Contrib composer.libraries.json with your site's composer.json file.

How to install the module

Guidelines on possible ways of module installations.

Installation

It's highly recommended to install the module by using Composer 2. For example:

composer require 'drupal/cloudinary:^3.0'

This way, all module dependencies like Cloudinary PHP SDK will be installed automatically.

Besides, it will be easy enough to update the module in the future. For example:

Tricks for using Composer in local development

When you are developing or maintaining a contrib project, you may find that the process of modifying code, pushing changes to Drupal.org, and then having Composer update your local environment to pull down what you pushed is tedious and time-consuming. In addition, Drupal.org does not allow history to be rewritten, but if you are developing something experimental you might not want to make your changes final until you've had a chance to test them.

Introduction

Note: This guide manually sets up Solr in Docker for educational purposes. The recommended and easiest method according to the search_api_solr team is to use the pre-configured Solr solution in DDEV.

Starting a Site Using Drupal Composer Project Templates

As of Drupal 8.8.0, Composer project templates (similar to drupal-composer/drupal-project) are now available as part of Drupal core. These project templates serve as a starting point for creating a Composer-managed Drupal site. Once you have selected a template project and created your own site, you will take ownership of your new project files. Thereafter, future updates will be done with Composer.

Templates

There are two project templates to choose from.

Pages

Subscribe with RSS Subscribe to RSS - Composer