How to perform drush commands on a self-managed Drupal devportal 17.05?

I have installed the Drupal-based developer portal on a CentOS 7 machine.

When I login as administrator to the portal, I get a notice that drupal core needs to be updated.

The Drupal way to do this is:

drush vset --exact maintenance_mode 1 
drush cache-clear all 
drush pm-update drupal

When I try that from the machine, I get this:

Command variable-set needs a higher bootstrap level to run - you will need to invoke drush from a more functional Drupal environment to run this command.                   [error]
Command variable-set requires Drupal core version 6 or 7 to run.                                                                                                            [error]
The drush command 'vset maintenance_mode 1' could not be executed.

How do I tell drush to update core?

maybe the answer is, I cannot update drupal core with drush and I need to wait for an OPDK patch from Apigee. OK. But how can I download and enable a new module with drush? This is normally done with something like;

drush dl module_name
drush en module_name -y
	

But that won't work currently. How do I make it work?

Related questions:

  • How do I set up a site alias? Where do I put aliases.drushrc ? Contents of that file?
Solved Solved
0 3 1,373
1 ACCEPTED SOLUTION

Not applicable
@Dino

You need to run those commands from the location where settings.php is located, which on OPDK is at : /opt/apigee/apigee-drupal-7.53-0.0.12/sites/default

Example from my local install:

[root@devportalarun default]# pwd

/opt/apigee/apigee-drupal-7.53-0.0.12/sites/default

[root@devportalarun default]# /usr/bin/drush pm-update drupal

Update information last refreshed: Tue, 06/27/2017 - 16:32

 Name    Installed Version  Proposed version  Message                   

 Drupal  7.53               7.56              SECURITY UPDATE available 

Code updates will be made to drupal core.

WARNING:  Updating core will discard any modifications made to Drupal core files, most noteworthy among these are .htaccess and robots.txt.  If you have made any modifications to these files, please back them up before updating so that you can re-create your modifications in the updated version of the file.

Note: Updating core can potentially break your site. It is NOT recommended to update production sites without prior testing.




Do you really want to continue? (y/n): 

View solution in original post

3 REPLIES 3

Can you change the directory and run those commands again

cd /opt/apigee/apigee-drupal
drush vset --exact maintenance_mode 1
drush cache-clear all

Not applicable
@Dino

You need to run those commands from the location where settings.php is located, which on OPDK is at : /opt/apigee/apigee-drupal-7.53-0.0.12/sites/default

Example from my local install:

[root@devportalarun default]# pwd

/opt/apigee/apigee-drupal-7.53-0.0.12/sites/default

[root@devportalarun default]# /usr/bin/drush pm-update drupal

Update information last refreshed: Tue, 06/27/2017 - 16:32

 Name    Installed Version  Proposed version  Message                   

 Drupal  7.53               7.56              SECURITY UPDATE available 

Code updates will be made to drupal core.

WARNING:  Updating core will discard any modifications made to Drupal core files, most noteworthy among these are .htaccess and robots.txt.  If you have made any modifications to these files, please back them up before updating so that you can re-create your modifications in the updated version of the file.

Note: Updating core can potentially break your site. It is NOT recommended to update production sites without prior testing.




Do you really want to continue? (y/n): 

@Dino

Did you try this dir:

/opt/apigee/apigee-drupal/wwwroot

Stephen