Information for: DEVELOPERS   PARTNERS   SUPPORT

Building your Drupal 7 distribution

For Drupal 9 or later installation and configuration instructions with Site Factory, see Building your Drupal distribution.

Although Acquia maintains the core platform of Site Factory, you have the freedom to develop your websites to meet your specific needs, including selecting a Drupal distribution to use for the websites on your platform.

If you have some websites that must use Drupal 9 or later, and others that must use Drupal 7, you will need to manage them in separate Site Factory stacks. A single stack can only operate one major version of Drupal at a time (for example, Drupal 7 or Drupal 9, but not both). For more information, see Using Site Factory stacks.

Be sure to use the Site Factory Connector for Drupal 7 version of the Site Factory Connector module.

Installing and configuring a custom distribution

To use a custom distribution with your Site Factory websites:

  1. Add your SSH key to Cloud Platform, and then clone the code repository for the website that you want to use to your local computer.

  2. On your local computer, delete all of the files and subdirectories contained in the docroot directory that you cloned from Site Factory. When removing its contents, be sure to not delete the actual docroot directory.

    You can run the following Git command from the docroot directory to remove the files:

    git rm -r * .htaccess .gitignore

    Do not run this Git command after you have installed your Drupal distribution in the docroot directory.

  3. Move your custom Drupal distribution into the now empty docroot directory. The docroot directory should contain the distribution’s index.php file, along with all other files and subdirectories.

  4. Download the Site Factory Connector module from Drupal.org, and then extract its contents into your distribution.

    You can use the following Drush command to do this:

    drush dl acsf

    Note

    Be sure that you do not install the module in multiple locations in your code repository (such as both docroot/profiles/gardens/modules/contrib and docroot/sites/all/modules/contrib). Multiple instances of the module can prevent Site Factory from discovering and using the module.

    You can run the following command in the docroot directory to determine if your code repository contains more than one version of the module:

    git ls-files "*acsf.info*"

  5. Ensure that each of the following files can be read, written to, and executed by its owner, its group, and by other users:

    • hooks/common/pre-web-activate/000-acquia-deployment.php
    • hooks/common/post-db-copy/000-acquia_required_scrub.php

    To do this on Unix-like operating systems, use a command similar to the following:

    chmod 0755 [file names]

  6. Configure your installation profiles to require the module using the appropriate instruction by adding the following line to one of your profiles’ .info files:

    dependencies[] = acsf

  7. Run the following Drush command from the docroot directory to initialize your custom distribution:

    drush --include=/path/to/acsf/acsf_init acsf-init

    Note

    This command does not bootstrap a Drupal website, so you must run it with the --include argument that points to acsf/acsf_init/acsf_init.

    The Drush command creates several directories and then copies files that Site Factory requires for its tasks, including locating the correct database credentials.

  8. Run the following Drush command from the docroot directory to ensure that everything is in order before you commit the custom distribution to the repository:

    drush --include=/path/to/acsf/acsf_init acsf-init-verify

    The following results should be returned by the acsf-init-verify command:

    acsf-init required files ok

  9. Commit and push your custom distribution’s files to Site Factory.

  10. Update your Production environment with the custom distribution’s files that you just pushed.

  11. If your custom distribution includes more than one installation profile, enable any installation profiles that you want site builders to be able to select when creating new websites.

Now that your new Drupal distribution is installed and configured, site builders can select the distribution for their use when create new websites. For information regarding how to select your custom profile when creating a new Site Factory website, see Managing installation profiles in your Factory.