Cloud Platform

Custom Drush commands for 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.
  • Custom Drush commands are not supported in Cloud Next environments.

 

Cloud Platform provides the following custom Drush commands for your use:

CommandDescription
ah-db-backupCreates a database backup from the command line.
ah-db-importImports a database from the command line. For more information, see Downloading database backups from the command line or Importing your database.
ah-site-archive-importImports a website archive file, as described in Importing an existing application using Drush.
ah-sql-cliOpens a MySQL command-line interface using Drupal’s credentials.
ah-sql-connectDisplay a MySQL command for connecting to a Cloud Platform database.

ah-db-backup

This command backs up a database on Cloud Platform from the command line.

AliasArguments
(none)
  • site: Specify a website to back up.
  • roles: The comma-separated list of database roles to back up. Defaults to all database roles for the website.

This command accepts the following options, in the format --option=value:

  • retain: The number of daily backups to retain.
  • ah-syslog: Log the output of this command via syslog,
  • structure-tables-list: Comma-separated list of tables to backup only the structure (no data, only the CREATE TABLE command)
  • skip-tables-list: Comma-separated list of tables to skip in the backup.
  • structure-tables-key: A key in the $structure_tables array. See example.drushrc.php.
  • skip-tables-key: A key in the $skip_tables array. See example.drushrc.php.

ah-db-import

Imports a Drupal database, using MySQL, converting tables to InnoDB format in the process.

AliasArguments
(none)file: The SQL file to import, with a file path relative to the Drupal root. If the filename ends in .gz, the file will first be extracted to $TMP.

ah-site-archive-import

Import a Drupal site archive file into Cloud Platform. This command requires a Drush alias for the Cloud Platform environment into which to import, such as drush @[sitename].[env] ah-sari ./archive.tgz.

AliasArguments
ah-sar-import, ah-sarifilename: The archive file to import.

This command accepts the following option, in the format --option=value:

  • extract-into: The temporary directory into which to extract the archive.

ah-sql-cli

Open a SQL command-line interface using Drupal’s credentials.

AliasArguments
ah-sql-cli(none)

This command accepts the following option, in the format --option=value:

  • db: The environment-agnostic database name. Defaults to the default primary Drupal database for the website. For more information, see Viewing database information.

Note

When you run drush ah-sql-cli, Cloud Platform may display the following message:

Reading table information for completion of table and column names
                        You can turn off this feature to get a quicker startup with -A
                        

The -A option is a MySQL option and not a drush ah-sql-cli option. You should ignore it when you run drush ah-sql-cli.

ah-sql-connect

Display a MySQL command for connecting to a Cloud Platform database.

AliasArguments
(none)(none)

This command accepts the following option:

  • db: The environment-agnostic database name. Defaults to the default primary Drupal database for the website. For more information, see Viewing database information.