Useful Drupal commands
Drupal
Here are a list of commands that come in handy when developing in Drupal.
-
It's really common to have a workflow in Drupal that uses the commands `updb` `cr` `cim` `cr` consequently. I don't know why it took me so long to discover this command so I am posting this. This command runs all of the previous commands in a single line, it saves so much time!
Drush deploy drush deploy## Will perform the followingdrush updatedb --no-cache-cleardrush cache:rebuilddrush config:importdrush cache:rebuilddrush deploy:hook -
Importing a .sql file into a Drupal installation. First we'll drop the current database as we're importing a new version. Then we'll pass the .sql file into the `drush sql-cli` command.
Importing Drupal dump into database drush sql-drop -ydrush sql-cli < ~/path/to/db-file.sql -
Logging into a Drupal instance when you've lost your password and don't want to go through the process of resetting it.
Drush command to login to /user/login area drush user-login# Shorthanddrush uli# Login as username ryandrush uli --name=ryan# Login as user with email address [email protected]# Login with user id 2drush uli --uid=2