Cloud Platform

Importing an existing application using Drush

This procedure is for Mac and Linux platforms. If your Drupal application is on a Windows platform, you must manually import your application to Cloud Platform.

Note

The current Drupal version requires Drush version 11 or later. Newer versions of Drush, that is, version 11 and later, must be installed via Composer. Acquia does not manage the update to the newer versions. For more information, see About Drush on Cloud Platform.

To import your application to Cloud Platform using Drush, you must create a site archive file, and then import the file to Cloud Platform.

Before you import your application using Drush, review Importing an existing application to familiarize yourself with the other available import approaches.

Creating a site archive file

For information about how to create a site archive file with Drush, see Creating a Drupal site archive for import. Copy mysite.tar.gz to your local computer.

Importing the site archive file with Drush

To import the site archive file with Drush:

  1. Confirm you’ve enabled SSH access to your Cloud Platform infrastructure.

  2. Copy mysite.tar.gz to /mnt/gfs/[site].[env]/import on your Cloud Platform infrastructure, using the following scp command:

    scp mysite.tar.gz [SITE].[ENV]@[INFRASTRUCTURE]:/mnt/gfs/[SITE].[ENV]/
    import
    

    where

    • [SITE] is the sitename of your application on Cloud Platform.

    • [ENV] is the Cloud Platform environment (frequently prod, test, or dev).

    • [INFRASTRUCTURE] is the full DNS name of the infrastructure hosting your website.

    To find your [SITE] and [INFRASTRUCTURE] names, sign in to the Cloud Platform user interface and view the Infrastructure page for the environment. For more information on obtaining infrastructure information, see Managing Cloud Platform infrastructure.

  3. Using SSH, sign in to your environment on Cloud Platform using the SSH address displayed on the Infrastructure page for the environment.

  4. In this SSH session, use the ah-site-archive-import command to import your application:

    drush @[SITE].[ENV] ah-site-archive-import /mnt/gfs/[SITE].[ENV]/import/mysite.tar.gz
    

    where:

    • [SITE] is the same value from step 2.

    • [ENV] is the environment you’re updating (frequently prod, test, or dev).

After you import your site archive, you can import your files and check out a local copy of the application from your Cloud Platform code repository.