admin管理员组

文章数量:1123198

Is there anything in the setup of drush on ddev that would prevent me from running drush with a site alias?

e.g.

ddev drush @dev-server status

ddev drush @dev-server sqlc

I ask because status works OK and seems to show the details of the remote server, but other commands seem to indicate my local ddev-based drupal site setup. For example I'm attempting to delete nodes with certain IDs which I know are on the remote server but not on my local and drush is responding to say that the node does not exist.

Related to set up - adding ssh key:

Is there anything in the setup of drush on ddev that would prevent me from running drush with a site alias?

e.g.

ddev drush @dev-server status

ddev drush @dev-server sqlc

I ask because status works OK and seems to show the details of the remote server, but other commands seem to indicate my local ddev-based drupal site setup. For example I'm attempting to delete nodes with certain IDs which I know are on the remote server but not on my local and drush is responding to say that the node does not exist.

Related to set up - adding ssh key: https://drupal.stackexchange.com/questions/321291/how-should-the-name-and-location-of-the-ssh-key-file-be-specified-in-the-yml-fil

Share Improve this question asked 8 hours ago therobyouknowtherobyouknow 6,78013 gold badges58 silver badges74 bronze badges 1
  • 1 Yes, you just need to put your SSH key into DDEV first: ddev auth ssh && ddev drush -y sql:sync @test @self – leymannx Commented 1 hour ago
Add a comment  | 

1 Answer 1

Reset to default 1

Drush inside the DDEV web container is the same as Drush anywhere, so you should be able to do anything you want, if the aliases are set up correctly. All ddev drush does is run drush inside the web container.

My approach to a problem like this would be to ddev ssh and then use drush there to understand and debug.

If you're having specific problems using that approach, the Drupal slack #drush or DDEV Discord would be good places to discuss them.

本文标签: aliasCan ddev drush be used with site aliases to run drush on remote serversStack Overflow