Commonly used Drush commands

Developer Services Portal v. 4.17.01

Drush is the Drupal command line interface. You can use it to perform many tasks as a Drupal administrator. Drush is installed for you when you install the portal.

How to run Drush commands

You have to run Drush commands from the root directory of the portal site. By default, the Developer Portal is installed at:

  • /opt/apigee/apigee-drupal (Nginx)
  • /var/www/html (Apache)

Therefore, you should first change directory to the correct root directory before running Drush commands:

If you did not install the portal in the default directory, change to your installation directory.

Determining the portal root directory on Apache

If you do not know the installation directory, use the following command to locate the devportal.conf file:

>  apachectl -S

That command displays a line showing the location of the devportal.conf file:

*:80   192.168.52.155 (/etc/httpd/conf/vhosts/devportal.conf:1)

Use the cat command to view the file:

> cat /etc/httpd/conf/vhosts/devportal.conf

The output from this command lists the installation directory:

<VirtualHost *:80>

 DocumentRoot "/var/www/html"

Example Drush Commands

The following table lists common Drush commands:

Command Use

drush status

Check Drupal status.

drush archive-dump --destination=../tmp/dc.tar

Backup Drupal to a specific location.

drush dc-getorg

Return the Edge organization associated with the portal.

drush dc-setorg {ORGNAME}

Set the Edge organization associated with the portal.

drush dc-getauth

Get the Edge organization administrator user name (email address) and password associated with the portal.

drush dc-setauth {orgAdminEmail}

Set the Edge organization administrator user name (email address). You will be prompted to set the password.

drush dc-getend

Get the Edge endpoint associated with the portal.

drush dc-setend http://{SERVERENDPOINT:8080/v1

Set the Edge endpoint associated with the portal.

drush dc-test

Test the connection from the portal to the Edge organization using the organization administrator's credentials.