Attempting to import an existing Drupal website into Site Factory both requires that you understand how Site Factory structures the websites that it hosts, and that you complete the required preparatory work to ensure a smooth, repeatable migration process, which can provide you a local backup of your work should a rollback of your migration be needed.
The information on this page is intended as preparation for actually migrating your website into Site Factory.
Acquia has identified a common list of tasks to consider as part of your initial sprint (Sprint 0) planning for an Site Factory migration. Although the activities described on Checklist for migrating your sites to Site Factory are not a complete list, they can help you to identify the work that is necessary for a successful launch, and also identify the tools (such as BLT) that can assist you.
When you are preparing to migrate a website, it helps to understand how files are organized in a Site Factory installation. Migrating a website into Site Factory involves all three major sections of a Drupal website:
Your website’s files
directory should contain the binary file assets
(images and videos) your website needs that cannot be easily stored in version
control. This files
directory, and its contents, reside on a writable,
distributed file system shared by all of your Site Factory-hosted
websites. Since this file system is external to your shared codebase, access
times for files stored in your files
directory will be slower than access
times for files stored in the shared codebase.
The files
directory for your website is located at
sites/g/files/[abcde]
, where [abcde]
is a random string.
Public files reside in the sites/g/files/[abcde]/files/
directory.
Your website-specific directories each contain a themes
directory. Acquia
strongly encourages that you store your per-website themes in this location, as
storage and retrieval are far faster than the distributed storage system used
in your website-specific files directory. For information about creating a
theme repository for each of your websites in Site Factory, see
Adding external themes to your site.
If you configure a dedicated theme repository for a website,
sites/g/files/[abcde]/themes/site
will be a symlink to local storage
for that repository.
Drupal 9 or later requires writable directories for importing configuration
values, such as user roles and permissions. The default location for the
vcs
and sync
directories (config/default
) is not writable on
Site Factory, and must be configured by a post-settings-php hook as described in
Importing a configuration directory.
The import process uses Drush commands, so creating Drush aliases for your target website allows you to execute Drush commands without needing to sign in to your target website to copy files using SSH.
Note
You should use Drush 10 when deploying a Drupal 9 codebase, and Drush 6 when deploying a Drupal 7 codebase.
To configure your aliases to run the correct version of Drush, create a Drush aliases file based on the following example, altering the code to meet your needs:
$aliases['cloud-platform'] = array(
'path-aliases' => array(
// uncomment this line if deploying a D8 codebase
// '%drush-script' => 'drush8',
// uncomment this line if deploying a D7 codebase.
// '%drush-script' => 'drush6',
'%dump-dir' => '/mnt/tmp/',
),
);
$aliases['target'] = array(
'parent' => '@cloud-platform',
'uri' => 'mynewdomain.customername.acsitefactory.com',
'root' => '/var/www/html/AH_SITE_GROUP.AH_SITE_ENVIRONMENT/docroot/',
'remote-host' => 'managed-12345.defaultrealm.hosting.acquia.com',
'remote-user' => 'YOURUSERNAMEHERE',
'path-aliases' => array(
# the following is optional if you want to have a dedicated temp dir
# without many other files in there:
'%dump-dir' => '/mnt/tmp/AH_SITE_GROUP.AH_SITE_ENVIRONMENT/drush-import/',
),
);
If you need assistance determining what these values should be, contact Acquia Support.
Note
The instructions in the website migration process that reference the
@target
alias assume you have created and implemented this file, and
will execute @target
commands from your local computer to affect your
intended target website.
To verify that your Drush aliases are functioning properly, from a command line window, run the following command:
drush @target status
Examine both the Site path to determine if it matches the path
sites/g/files/[abcde]
(where [abcde]
is a random string), and
the File directory path to determine if it matches
sites/g/files/[abcde]/f
(where [abcde]
is a random string).
If both the Site path and the File directory path values match the described strings, your Drush aliases are connecting to your server.
Common sources of problems with this file include the following:
Incorrect values for uri
, remote_host
, or remote-user
Not committing the sites/g/
directory to the codebase after
executing drush acsf-init
After you ensure that your website will work with the Site Factory directory structure and you test your Drush aliases, you should review Checklist for migrating your sites to Site Factory.