ADVANCED: Incorrectly migrating a website without proper preparation can cause data loss or website outages.
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.
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.Avoid migrating content to non-production Site Factory environments using acli push:database to prevent potential disruptions to Site Factory SSO.
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:
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:
sites/[domain]/modules directories.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 command in Site Factory will overwrite the contents of the file and you will lose any customizations you made.
Your website is now live on Site Factory. You can add a custom domain name to complete the migration.
acsf-initFor 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.
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.sqlDo 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.sqlEnable and configure Site Factory modules by performing the following steps:
Open a command prompt window, and then run the following Drush command, based on your installed version of Drupal:
| Drupal version | Command |
|---|---|
| Current Drupal version | drush @target pm-enable acsf acsf_duplication acsf_theme acsf_variables |
| Drupal 7 | 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.
If this content did not answer your questions, try searching or contacting our support team for further assistance.
acsf-initFor 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.
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.sqlDo 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.sqlEnable and configure Site Factory modules by performing the following steps:
Open a command prompt window, and then run the following Drush command, based on your installed version of Drupal:
| Drupal version | Command |
|---|---|
| Current Drupal version | drush @target pm-enable acsf acsf_duplication acsf_theme acsf_variables |
| Drupal 7 | 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.
If this content did not answer your questions, try searching or contacting our support team for further assistance.