After you have completed the preparatory work described in Preparing to migrate sites into Site Factory and completing the items in the Checklist for migrating your sites to Site Factory, you are ready to start the process of importing a website into Site Factory.
Note
The website migration process depends on the preparation described in Preparing to migrate sites into Site Factory. Failing to review and follow those instructions before migrating may cause your migration to fail.
files
directory or theme, as these paths will change
during the database import process.Use the following steps to migrate your website into Site Factory:
Initialize and deploy the theme repository. Although you can place
your website’s themes in your sites/all/themes
directory, Acquia
recommends you use a dedicated, external theme
repository. If you create an external theme
repository, complete the following steps:
Create a dedicated directory for themes, which will contain
subdirectories for the website-specific themes. If you move all base
themes into the main target repository, you can use the
sites/[domain.com]/themes
directory.
Add all the files in your theme to a Git repository you have newly initialized with the following commands:
git init
git add .
git commit -m "Example message: commit all themes"
For more information, see Connecting to a theme repository.
Initialize and deploy your codebase. Acquia has identified the following best practices for preparing and deploying your website’s codebase to Site Factory:
The versions of Drupal core and contributed modules on your source and target websites must be identical.
All necessary modules and themes must be reachable for your target website, though their exact locations may differ.
Custom modules must be in the shared codebase across all
websites, and not in
website-specific sites/[domain]/modules
directories.
Small, custom configuration files can remain in the sites/default
directory.
Move any customizations to your website’s sites/default/settings.php
file into another file or a post-settings.php hook, as the acsf-init
command in Site Factory will overwrite the contents of the
file and you will lose any customizations you made.
Note
For more information about acsf-init
’s role in code deploys,
see Updating with the acsf-init command.
After you have prepared your source website’s codebase for migration, follow the instructions at Building your Drupal distribution to import it.
Create a complete and recent back up of all portions of your website, including the database, files directory, codebase, and themes.
If your website is active, enable maintenance mode before starting your migration. Maintenance mode prevents your website’s users from making changes to the website that may disappear during the migration process.
Simultaneously make a local backup of your website’s files directory while copying the files to your target website by executing the following commands:
mkdir /tmp/local-site-archive
drush -v rsync @source:%files/ /tmp/local-site-archive/files/
drush -v rsync /tmp/local-site-archive/files/ @target:%files/
If you already have a local backup, you can copy your files directly from your source website to your target websites by executing the following command:
drush -v rsync @local-source:%files/ @target:%files/
When migrating your website from one host to another, you should review your database for differences between your source environment and target environment, paying close attention to any tables including references to file system paths.
You should perform any needed changes on a local copy of your database, instead of your currently-live source website. To make a local backup of your website’s database, execute the following commands:
drush -v @target sql-drop
drush @source sql-dump > /tmp/local-site-archive/archive.sql
Important
Do not use the -v
flag on the sql-dump
command as it may
corrupt your database export.
Perform any needed changes (such as Secure Pages settings or file paths) to the database on your local copy of the database, and then upload the database to your target environment with the following command:
drush -v @target sql-cli < /tmp/local-site-archive/archive.sql
Enable and configure Site Factory modules by performing the following steps:
drush @target pm-enable acsf acsf_duplication acsf_theme acsf_variables
drush @target pm-enable acsf acsf_duplication acsf_theme acsf_variables acsf_pingdom acsf_openid
[domain].acsitefactory.com/node/[ID]
, replacing
[domain]
with your Factory’s default domain name, and [ID]
with
the numeric website ID you identified in the previous step.acsf-connect-factory
Drush command listed under
ACSF connect factory drush command, which contains the
following parameters:--include
: Full path to your ACSF module--site-admin-mail
: Email address of your
Site Factory administrator; the email address for user 1
will be set to this value--site-owner-name
: Drupal username of the user who created
the website from the Factory user interface; this user can sign in to
the Site Factory Management Console--site-owner-mail
: Email address of the user who created
the website from the Factory user interfaceacsf-connect-factory
command from the command line to
update your target website with the information you provided.After initialization, themes in dedicated repositories connected as described in Initialize and deploy the theme repository should display properly.
Sign in to your migrated website as an administrator, and then test the website to ensure the migration succeeded.
Disable maintenance mode on your newly-imported website.
Your website is now live on Site Factory. You can add a custom domain name to complete the migration.