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
This page describes the best ways to handle configuration management for websites running the current Drupal version on Cloud Platform.
Drupal’s configuration management (CM) makes major improvements to how the current Drupal version manages the configuration, compared to earlier Drupal versions.
For websites running the current Drupal version, Cloud Platform requires you to define a default location for the configuration directory where you store Drupal configuration information in your code repository. Typically, this directory is located at:
config/[sitename]Here, config is a directory at the same level of your docroot directory. You must create the directory as it does not exist in the repository by default. If you do not create the config directory, Cloud Platform displays the following error message:
The directory docroot/../config/default does not exist.You cannot run update.php until you create the config directory. Also, you cannot commit empty directories in Git.
In the new directory, you must also add the .gitkeep text file before you can commit the directory to your repository. After creating the directory, you have the following file structure at the docroot level:
/docroot/
config/default/In the settings.php file for your application, define the following config path:
$settings['config_sync_directory'] = $app_root . '/../config/' . basename($site_path);Site Factory subscribers must also create a post-settings-php hook as described in Configuration management directory.
To understand the process of pushing the configuration, assume that you want to build or update an application named example that runs the current Drupal version in the Development environment in Cloud Platform. Acquia recommends you to use Acquia Cloud IDE or a local development environment as Cloud Platform is read-only.
To export and push the configuration:
Export the configuration with the following command:
drush config-export --uri=defaultThe system displays the following message:
[notice] The active configuration is identical to the configuration in the export directory (../config/default).Review the changes with the following command:
git showIf you are satisfied with the changes, push them with the following commands:
git add --all
git commit -m “export and push config”
git pushTo push the changes, you can use Git or the push artifact.
Remove the changes:
git reset --hard HEAD^1
drush config-export --uri=defaultAdjust the changes and run the following commands:
git add --all
git commit -m “export new change and push config”
drush config-export --uri=default
git pushdev to stage to deploy your configuration from the development environment to the staging environment.Import the configuration from the file system to the database for the staging environment:
drush config-import --uri=defaultTo apply database updates, run update on your staging environment:
drush updatedb --uri=default
If this content did not answer your questions, try searching or contacting our support team for further assistance.
If this content did not answer your questions, try searching or contacting our support team for further assistance.