Using Drush on Hawk Host shared hosting & multisite


Drupal Padawan

Recommended Posts

First you need to download Drush from: http://drupal.org/project/drush Use the 7.X-x.x version as that version is also the same needed for drupal 6.x. According to the drush page it will also work with Drupal 5.x and 4.x but I have no way to verify that.

Extract the entire drush folder using whatever zip file software you use. Then you need to upload the drush folder to your Hawk Host server; I used Filezilla. Upload the drush folder to your main directory: this should be the directory above your public_html directory, which should also be the same directory you log onto when using PuTTY. While you can also upload drush to your public_html directory, I felt a bit uncomfortable having it there. If that doesn’t bother you, give it a try, it may save you a step when you run drush.

After installing drush, log on via PuTTY, change to your drush directory (cd drush), and Make the 'drush' command executable by typing # chmod u+x /drush/drush.

Then you need to append the following line to your .bashrc file:

PATH=$PATH:/home/your-main-directory/drush

While there is a linux command for appending a line the the end of a file, I simply downloaded my .bashrc file to my windows PC and edited it in my code editor (I use Aptana Web). DO NOT edit system files like .bashrc in notepad as bad things can result from that.

You then need to either close and re-open your PuTTY session or type in the command $ source .bashrc to re-load your PuTTY session.

To use drush: from the PuTTY command line type cd public_html to change to that directory (drush will throw errors unless you enter commands from that directory).

If you have a multisite drupal installation you will need to run a separate command for each site or subdomain. The command for updating everything is drush up. In multisite, you need to run this:

drush up --uri=http://yourdomain1.com

drush up --uri=http://yourdomain2.com

drush up --uri=http://yourdomain3.com

If you fail to do this for a multisite install, even if all your sites run the same modules, drush will NOT run update.php on any site except your main install domain. If a module update makes changes to your database tables, those changes may not be applied to your other sites and/or subdomains, possibly leaving you to manually edit your database tables (not my idea of fun).

Enjoy!

Link to comment
Share on other sites

  • 4 weeks later...

Here's a few points I should have covered in my post "Using Drush on Hawk Host shared hosting & multisite":

- Back up everything before you use Drush: I just learned the hard way that sometimes Drush can delete your current Drupal installation and fail to update. Fortunately I had everything backed up, so I manually updated core using FTP. Only the core was deleted, my 'sites' directory and databases were OK.

- You still must log in to your drupal site (or every site if a multisite installation) and run update.php to update your database tables. Drush does not update the database tables.

- You can get more information on drush commands at:

http://drupal.org/node/477684

Cheers!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...