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.
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 9 site.Note that only Composer-managed sites are supported.
Use one of the following guides if you are migrating a Drupal 7 or 8 site and want to upgrade to a Drupal 9 site:
Your site is Composer-managed: Migrate a Composer Managed Drupal 9 Site from Another Platform
Your site is not Composer-managed: Migrate a Drupal 9 Site from Another Platform
Verify that you have Drush access on your existing Drupal site.
The first step to importing your Drush archive is to generate the Drush archive of your existing site.
Navigate to site root.
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.gzthat'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.
- This creates a file called
Install Terminus 3.
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:listto get a list of your existing sites.
Start an import:
terminus site:import <site> <url>
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.
Install the Terminus Conversion Tools plugin.
Run the command below to create the site on Pantheon. Change the
site-machine-nameto a unique name that you would like to use for your site.
terminus conversion:import-site site-machine-name /path/to/archive.tar.gz --site-label="Site Label"
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.