With Copilot
Acquia Copilot is a conversational AI connected into our product documentation and knowledge base. Ask Copilot about product features, technical details, troubleshooting and how to get started with Acquia products.
Sign in to use Acquia Copilot
To install a Drupal distribution (or Drupal core), use one of the following:
A Drupal distribution is a custom edition of Drupal, tuned and extended with custom developed and contributed modules to enable desired features. Such a distribution includes Drupal core, Drupal contributed modules, themes, libraries, and installation profiles that together provide a Drupal solution. You can install most of the popular Drupal distributions in Cloud Platform. To import a Drupal distribution to Cloud Platform, you can leverage one-click selection.
The following are the prerequisites for installing Drupal 11:
PHP 8.3 is not set as the default version. Therefore, update your environments and developer tools such as Code Studio and Cloud IDE to use PHP 8.3.
MySQL 8 is currently not available on Cloud Platform. Therefore, use the MySQL 8.0 to 5.7 backport database driver module to allow Drupal 11 to run on MySQL 5.7. For more information, see MySQL 8.0 to 5.7 backport database driver for upgrading to Drupal 11.
If you use the mysql57 module with Cloud IDE, PHPUnit tests that use the database fail with an error stating that the database server version of 5.7 is less than the minimum required version of 8.0. To resolve this error, update the SIMPLETEST_DB environment variable to add ?module=mysql57:
export SIMPLETEST_DB="mysql://drupal:[email protected]/drupal?module=mysql57"Cloud IDE also offers a convenient and opinionated way to install Drupal.
To install a Drupal distribution using a Cloud IDE:
From the IDE Get Started page, click CREATE A NEW APPLICATION.
A terminal pane pops up and prompts you to install the Acquia Drupal recommended project or the Acquia Drupal minimal project.
Select your target version by typing the number associated with your distribution selection in the terminal prompt and press Enter. Acquia CLI takes care of automatic installation of Drupal in Cloud IDE’s /home/ide/project directory.
After Drupal is installed, you can start developing or push from the IDE terminal to Cloud Platform with acli push:db and acli push:files. As a best practice, your codebase remains to be managed with Git.
To install a Drupal distribution on Cloud Platform, you can a Cloud Platform compatible or file of the latest Drupal release and complete the following steps:
Ensure that your development environment has the following:
Clone your Acquia repository into a new folder such as ProjectName, and create a branch:
git clone [email protected]:Sitename.git ProjectName
cd ProjectName
git checkout -b MyBranchNameCreate composer.json and composer.lock files:
composer create-project --no-install drupal/recommended-project .Ensure that you include the dot at the end of the command.
Modify the composer.json file by replacing web with docroot. Use your preferred editor or run the following command:
sed -i'.original' 's/web\//docroot\//g' composer.jsonRun the following command to install the latest version of Drush in your codebase:
composer require drush/drush --no-updateAdd asset-packagist.org as another repository to provide access to supplement packages.drupal.org and additional packages:
composer config repositories.1 composer https://asset-packagist.orgConfigure the location and name of the vendor directory:
composer config vendor-dir vendorauto
composer config preferred-install distAdd the following useful future project patches:
composer require cweagans/composer-patches --no-updateTo add a patch to core or a module, include the following lines in the extra section in your composer.json file for future patches:
{
"enable-patching": true,
"patches": {
"drupal/[module_name]": {
"Note regarding the nature of the patch being applied": "https://www.drupal.org/files/issues/[patch_name].patch"
}
}
}For more information, see Patching with Composer.
Configure Composer to continue if a patch fails:
composer config extra.composer-exit-on-patch-failure falseTo remove .git folders after each update to ensure that git tracks all files, include the following lines after the extra section in your composer.json file:
{
"scripts": {
"post-install-cmd": [
"find docroot vendor -name '.git' | xargs rm -rf",
"find docroot vendor -name '.github' | xargs rm -rf"
],
"post-update-cmd": [
"find docroot vendor -name '.git' | xargs rm -rf",
"find docroot vendor -name '.github' | xargs rm -rf"
]
}
}Run the following command to install all dependencies:
composer update --lockComposer performs the following:
Copy default.settings.php to the settings.php file to add your database connection.
cp docroot/sites/default/default.settings.php docroot/sites/default/settings.phpFor instructions about modifying the settings.php file, see Acquia require line.
Add the following to your settings.php file for configuration management:
$settings["config_sync_directory"] = $app_root . '/../config/' . basename($site_path);Add and commit your code:
git add .
git commit -m "Initial commit of new Drupal core site."Run the following command to push your changes to the Acquia repository and create a tracking branch on the remote repository:
git push --set-upstream origin MyBranchNameUse Drush to drop the database on your Cloud Platform environment so that you have a clean database for your Drupal site install:
../vendor/bin/drush @my.alias sql-drop/core/install.php..tar.zipdocroot directory of your Acquia Git repository.settings.php file and update it by following the instructions on Acquia require line.Use Drush to drop the database on your Cloud Platform environment (replace @my.alias with the appropriate alias for your application and environment) as displayed in the following example:
./vendor/bin/drush @my.alias sql-dropThis ensures you have a clean database for your Drupal install.
/core/install.php.If this content did not answer your questions, try searching or contacting our support team for further assistance.
Ensure that your development environment has the following:
Clone your Acquia repository into a new folder such as ProjectName, and create a branch:
git clone [email protected]:Sitename.git ProjectName
cd ProjectName
git checkout -b MyBranchNameCreate composer.json and composer.lock files:
composer create-project --no-install drupal/recommended-project .Ensure that you include the dot at the end of the command.
Modify the composer.json file by replacing web with docroot. Use your preferred editor or run the following command:
sed -i'.original' 's/web\//docroot\//g' composer.jsonRun the following command to install the latest version of Drush in your codebase:
composer require drush/drush --no-updateAdd asset-packagist.org as another repository to provide access to supplement packages.drupal.org and additional packages:
composer config repositories.1 composer https://asset-packagist.orgConfigure the location and name of the vendor directory:
composer config vendor-dir vendorauto
composer config preferred-install distAdd the following useful future project patches:
composer require cweagans/composer-patches --no-updateTo add a patch to core or a module, include the following lines in the extra section in your composer.json file for future patches:
{
"enable-patching": true,
"patches": {
"drupal/[module_name]": {
"Note regarding the nature of the patch being applied": "https://www.drupal.org/files/issues/[patch_name].patch"
}
}
}For more information, see Patching with Composer.
Configure Composer to continue if a patch fails:
composer config extra.composer-exit-on-patch-failure falseTo remove .git folders after each update to ensure that git tracks all files, include the following lines after the extra section in your composer.json file:
{
"scripts": {
"post-install-cmd": [
"find docroot vendor -name '.git' | xargs rm -rf",
"find docroot vendor -name '.github' | xargs rm -rf"
],
"post-update-cmd": [
"find docroot vendor -name '.git' | xargs rm -rf",
"find docroot vendor -name '.github' | xargs rm -rf"
]
}
}Run the following command to install all dependencies:
composer update --lockComposer performs the following:
Copy default.settings.php to the settings.php file to add your database connection.
cp docroot/sites/default/default.settings.php docroot/sites/default/settings.phpFor instructions about modifying the settings.php file, see Acquia require line.
Add the following to your settings.php file for configuration management:
$settings["config_sync_directory"] = $app_root . '/../config/' . basename($site_path);Add and commit your code:
git add .
git commit -m "Initial commit of new Drupal core site."Run the following command to push your changes to the Acquia repository and create a tracking branch on the remote repository:
git push --set-upstream origin MyBranchNameUse Drush to drop the database on your Cloud Platform environment so that you have a clean database for your Drupal site install:
../vendor/bin/drush @my.alias sql-drop/core/install.php..tar.zipdocroot directory of your Acquia Git repository.settings.php file and update it by following the instructions on Acquia require line.Use Drush to drop the database on your Cloud Platform environment (replace @my.alias with the appropriate alias for your application and environment) as displayed in the following example:
./vendor/bin/drush @my.alias sql-dropThis ensures you have a clean database for your Drupal install.
/core/install.php.If this content did not answer your questions, try searching or contacting our support team for further assistance.