Skip to main content

Import Drush Site Archives with Terminus

Import a Drupal Drush site archive using Terminus, the Pantheon CLI tool.


This section provides information on how to import Drush site archives with Terminus.

The easiest way to move an existing Drupal site to Pantheon is to import a Drush archive file using Terminus command-line interface. This automates the packaging of the existing installation, and improves the chances of success.

Follow the steps below carefully to ensure that you import your Drupal site correctly.

Before You Begin

  • Create a Pantheon account with at least one free Dev site slot open.

    • A Pantheon account is free, and if you need an extra Dev site to try this out, reach out to your Account Manager and they can grant you one.
  • Verify that you are using Drush 8 if you have a non-Composer managed Drupal 7 site. Note that Composer-managed sites are not supported.

  • Verify that you are using Drush 11 if you have a Composer-managed Drupal site. Note that only Composer-managed sites are supported.

  • Verify that you have Drush access on your existing Drupal site.

Generate a Drush Archive

The first step to importing your Drush archive is to generate the Drush archive of your existing site.

  1. Navigate to site root.

  2. Run the command below if you have Drush access to the site direct via the shell:

    drush archive-dump --destination=drush-archive.tar.gz
    • This creates a file called drush-archive.tar.gz that's available via the public internet. You can put it on Dropbox, S3, or any number of other places if you have the file locally. The important thing is that you have a Drush archive that can be downloaded via a URL.

Install Terminus

Install Terminus 3.

Import Your Archive

  1. Authenticate into Pantheon with Terminus:

    terminus auth:login --email=<email> --machine-token=<machine_token>

    You're now ready to perform command-line operations with Pantheon. For example, you can run terminus site:list to get a list of your existing sites.

  2. Start an import:

    terminus site:import <site> <url>
    Info:
    Note

    Make sure you have an existing site on your account before you start an import.

    The script will begin to poll as the site containers are spun up and the archive is imported. You can wait for that to complete, or cancel out and check back in your Dashboard.

Automate Imports

Terminus is designed to support automation. You can script imports to run several concurrently (or to run imports serially).

Terminus is a rapidly evolving project, so check back frequently for updates. Forks and pull requests for improvements are welcome.

More Resources