Setting up for local development

Downloading the site from Site Factory

  1. Select Backup the site from Site Factory’s site card drop-down list, located to the right of the Log in button.
  2. Once the site has finished backing up, an email will be sent with a link to download the site.
  3. Click on the link or go directly to
  4. Click the “Download” link which will download a tar.gz file.
  5. If you are on a Windows computer, you will need a program like 7zip to open the file.
  6. Extract the contents to your computer and rename the folder to something useful.

Set-up your local environment

You will need a LAMP style development environment setup with Apache, PHP, and MySQL. There are many options available such as MAMP, WAMP,  or Drupal VM

  1. Create a local domain such as sitename.local pointed at the docroot folder of the downloaded site’s code.
  2. Create a new Database.
  3. Import the database.sql file that downloaded with the site’s code.

Drupal settings for local development

There are 3 files needed in the /docroot/sites/default/ directory that Drupal will rely on for doing local development.

  1. Download the settings.php, settings.local.php and services.local.yml from Click the “Download repository” link which will download the files to your computer.
  2. Place these 3 files into the /docroot/sites/default/ directory.
  3. Customize the settings.local.php file to make it specific to your local environment.
    • Edit the $databases['default']['default'] array by changing the database name to the name set up earlier.
    • Edit the $config_directories['sync'] to match the /docroot/sites/default/files/config_[HASH]/sync directory.
      • In your files structure it will look something like config_f522e50bd94f2207e3dc21e94388ac59ca5015a7

The settings.local.php file can be customized for your local environment as needed.

Preparing a subtheme of “SiteFarm One”

  1. Download a subtheme starter kit from
    • There are 2 starter kits: Basic and Advanced.
    • The Basic branch is a simple starting point for doing CSS, Javascript, and Templates.
    • The Advanced branch allows using Sass, es6 Javascript, and advanced theming with BrowserSync.
  2. Extract the starter kit into /docroot/sites/default/themes/ and rename the folder to site.
  3. Using a terminal, cd into your theme's site directory and type “git init”.
  4. Commit the subtheme code and push it to bitbucket or github.

Connect the theme repository to Site Factory

  1. Navigate to your site card in Site Factory (
  2. From the drop-down arrow next to the Login button, select Manage theme repository from Site Factory’s site drop-down menu.
    Location of the "Manage theme repository" button in your site card.
  3. Click Connect site repository.
  4. Grant access to the Repository
    • Bitbucket: Click Show SSH public key and copy it. Add this to a git repo.
      • Click “Settings”, then “Access keys”, and then “Add key”.
    • Github: Click “Settings”, then “Collaborators and Teams”.
      • Add "ietwebdev" to the "Collaborators" list.
  5. Add the git URL into “Git URL” like
  6. Add a branch or tag into “Branch or tag” such as “master”.
  7. Click Save.
  8. Clear your site's cache by selecting Clear caches from Site Factory’s site drop-down menu.

More information can be found here:

Local Dev Tips

  1. Use “Drush” in a console from the docroot directory with:
    $ ../vendor/bin/drush
  2. Log in as an Administrator:
    $ ../vendor/bin/drush uli --uri="sitename.local"
  3. Use “Drupal Console” in a console from the docroot directory with:
    $ ../vendor/bin/drupal
  4. Create a subtheme using a wizard:
    $ ../vendor/bin/drupal sitefarm:generate:subtheme
  5. The following modules can be disabled
    • acsf_*
    • Acquia_connector
    • SamlAuth