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.
The acsf-init Drush command (provided as part of the Site Factory Connector module) prepares a custom Drupal
distribution for development and deployment on Site Factory. The command
appends information to your website’s sites/default/settings.php file,
while also creating any necessary directories, identifying database
credentials, creating a sites.php file, and copying files required by
Site Factory.
Important
Since acsf-init will make changes to your website’s
sites/default/settings.php file, move your customizations in your
settings.php file to another file or into a
post-settings.php hook.
Failing to move your customizations could cause you to lose them when
your settings.php is overwritten.
You must execute the acsf-init command whenever you update Drupal core or
the Site Factory Connector module to a newer version.
Add the module to your composer.json by using the composerrequiredrupal/acsf command.
Do not install the module in more than one location in your code repository
(such as both docroot/profiles/profilename/modules/contrib and
docroot/modules/contrib). Multiple instances of the module can prevent
Site Factory from discovering and using the module.
To determine if your code repository contains more than one version of the
module, run the following Git command in the docroot directory:
git ls-files "*acsf.info*"
Executing acsf-init after module or Drupal core updates
Whenever you update the Site Factory Connector module to a newer version,
complete the following steps to update the module in your Drupal distribution:
Download and extract the updated Site Factory Connector module from
Drupal.org into your distribution with the command appropriate to your
version of Drupal, replacing
[path/to/acsf/acsf_init] with the path to your acsf_init module:
The Drush command creates several directories and then copies files
that Site Factory requires for its tasks, including locating
the correct database credentials.
Run the following Drush command from the docroot directory to ensure
everything is in order before you commit the custom distribution
to the repository:
Commit and push your custom distribution’s files to
Site Factory. For the specific procedure to guide you through
this process, see Preparing for the code deployment.
Update your Prod environment with the custom distribution’s files
you pushed. For the specific procedure to guide you through
this process, see Performing a production deployment.
If you fail to execute the acsf-init command, or Site Factory
cannot determine the Site Factory Connector module version, your deployment
will fail.
Modifying settings.php for local development
The Site Factory Connector module ensures the settings.php
file includes only the required settings for Site Factory. When
developing a custom Drupal distribution locally for use on
Site Factory, you may need to modify settings.php in ways
conflicting with the requirements enforced by the Site Factory
Connector module.
You can avoid conflicts by executing the acsf-init command with the
--skip-default-settings parameter to skip the settings.php validation
when running a Drupal website that includes the Site Factory
Connector module, but is not on
Site Factory, as in the following example:
This parameter enables you to locally deploy and test a version of
settings.php with settings needed for local development, while still
ensuring your production websites use the version of settings.php required
by Site Factory.
Note
You must execute acsf-init without --skip-default-settings
before you commit and push your custom distribution’s files to
Site Factory.
Troubleshooting: Is settings.php included in .gitignore?
The acsf-init command writes your sites/default/settings.php file when
you prepare a custom Drupal distribution for development and deployment on
Site Factory. If you cannot create new websites using your custom
Drupal distribution, examine the .gitignore file in your code repository.
Your .gitignore file may be set to exclude the settings.php file, so
settings.php never gets pushed to the Site Factory. If your
.gitignore file contains a line similar to the following example, delete
it from .gitignore:
# Ignore configuration files that may contain sensitive information.
sites/*/settings.php
If you do not execute the acsf-init command after an Site Factory platform
release, or execute the command incorrectly, you may encounter one or more of
the following error messages:
The acsf-init command was executed from a directory without Git
checkout or write permissions. Execute the command from a directory
with these permissions to resolve the problem.
settings.php included in .gitignore
If the command fails, even when executed from the correct
directory and by a user with correct permissions, check that your
website’s is not included in your file,
which will cause to fail. Remove from
your file to resolve the problem.
Updating with the acsf-init command
The acsf-init Drush command (provided as part of the Site Factory Connector module) prepares a custom Drupal
distribution for development and deployment on Site Factory. The command
appends information to your website’s sites/default/settings.php file,
while also creating any necessary directories, identifying database
credentials, creating a sites.php file, and copying files required by
Site Factory.
Important
Since acsf-init will make changes to your website’s
sites/default/settings.php file, move your customizations in your
settings.php file to another file or into a
post-settings.php hook.
Failing to move your customizations could cause you to lose them when
your settings.php is overwritten.
You must execute the acsf-init command whenever you update Drupal core or
the Site Factory Connector module to a newer version.
Add the module to your composer.json by using the composerrequiredrupal/acsf command.
Do not install the module in more than one location in your code repository
(such as both docroot/profiles/profilename/modules/contrib and
docroot/modules/contrib). Multiple instances of the module can prevent
Site Factory from discovering and using the module.
To determine if your code repository contains more than one version of the
module, run the following Git command in the docroot directory:
git ls-files "*acsf.info*"
Executing acsf-init after module or Drupal core updates
Whenever you update the Site Factory Connector module to a newer version,
complete the following steps to update the module in your Drupal distribution:
Download and extract the updated Site Factory Connector module from
Drupal.org into your distribution with the command appropriate to your
version of Drupal, replacing
[path/to/acsf/acsf_init] with the path to your acsf_init module:
The Drush command creates several directories and then copies files
that Site Factory requires for its tasks, including locating
the correct database credentials.
Run the following Drush command from the docroot directory to ensure
everything is in order before you commit the custom distribution
to the repository:
Commit and push your custom distribution’s files to
Site Factory. For the specific procedure to guide you through
this process, see Preparing for the code deployment.
Update your Prod environment with the custom distribution’s files
you pushed. For the specific procedure to guide you through
this process, see Performing a production deployment.
If you fail to execute the acsf-init command, or Site Factory
cannot determine the Site Factory Connector module version, your deployment
will fail.
Modifying settings.php for local development
The Site Factory Connector module ensures the settings.php
file includes only the required settings for Site Factory. When
developing a custom Drupal distribution locally for use on
Site Factory, you may need to modify settings.php in ways
conflicting with the requirements enforced by the Site Factory
Connector module.
You can avoid conflicts by executing the acsf-init command with the
--skip-default-settings parameter to skip the settings.php validation
when running a Drupal website that includes the Site Factory
Connector module, but is not on
Site Factory, as in the following example:
This parameter enables you to locally deploy and test a version of
settings.php with settings needed for local development, while still
ensuring your production websites use the version of settings.php required
by Site Factory.
Note
You must execute acsf-init without --skip-default-settings
before you commit and push your custom distribution’s files to
Site Factory.
Troubleshooting: Is settings.php included in .gitignore?
The acsf-init command writes your sites/default/settings.php file when
you prepare a custom Drupal distribution for development and deployment on
Site Factory. If you cannot create new websites using your custom
Drupal distribution, examine the .gitignore file in your code repository.
Your .gitignore file may be set to exclude the settings.php file, so
settings.php never gets pushed to the Site Factory. If your
.gitignore file contains a line similar to the following example, delete
it from .gitignore:
# Ignore configuration files that may contain sensitive information.
sites/*/settings.php
If you do not execute the acsf-init command after an Site Factory platform
release, or execute the command incorrectly, you may encounter one or more of
the following error messages:
The acsf-init command was executed from a directory without Git
checkout or write permissions. Execute the command from a directory
with these permissions to resolve the problem.
settings.php included in .gitignore
If the command fails, even when executed from the correct
directory and by a user with correct permissions, check that your
website’s is not included in your file,
which will cause to fail. Remove from
your file to resolve the problem.
acsf-init
settings.php
.gitignore
acsf-init
settings.php
.gitignore
Did not find what you were looking for?
If this content did not answer your questions, try searching or contacting our support team for further assistance.
acsf-init
settings.php
.gitignore
acsf-init
settings.php
.gitignore
Did not find what you were looking for?
If this content did not answer your questions, try searching or contacting our support team for further assistance.