drush

Drupal 8 drush critical update commands

There are some new drush Drupal 8 commands that are critical to updating your site. The big new one here, is "drush entitity-updates".  Which should be initiated AFTER "drush updb".

Otherwise, if you check your Drupal 8 "Status Report" you may get an error showing "Entity/field definitions: Mismatched entity and/or field definitions"--which won't be apparent, unless you check the Status Report.

So here goes... 

Clear all cashes (no longer "drush cc all"):

drush cr 

or 

drush cache-rebuild

Update the database (this is still the same, however, you won't be done here):

drush updb

After running "drush updb", you should next run entity updates command:

drush entup

or

Tags: Drupal drupal 8 drush

Drupal remove deleted fields from database

Install and enable Field SQL norevisions, and use it to delete any revisions you don't need. Also set it to disable revisions for content/entity types that you don't want revisions being made.

Note: For entity content types, drupal will automatically make revisions for each update, but won't allow you to revert to any of these revisions, so this is pretty pointless; plus for very large databases this can degrade performance.

Tags: Drupal drush

How to install drush on Godaddy cPanel hosting

If you're using godaddy cpanel hosting, you have 2 options of installing drush

1. drush version from drupal (which is NOT being updated anymore--unlike the latest github version).

or 2. (Preferred) Install the latest github version:

Go here to view instructions on how to install the latest version of drush from github.

cd ~
wget http://ftp.drupal.org/files/projects/drush-7.x-5.9.tar.gz
tar xvf drush-7.x-5.9.tar.gz 

Now we add the drush paths to our .bash_profile.

vi .bash_profile 

Paste the following in toward the top:

Tags: cpanel godaddy drush Linux

How to install Composer and Drush LOCALLY and GLOBALLY

Drush 9.x Install Composer to your LOCAL user directory

cd ~
mkdir .composer
curl -sS https://getcomposer.org/installer | php
mv composer.phar ~/bin/composer
chmod +x ~/bin/composer
echo "PATH=$PATH:~/.composer/vendor/bin" >> ~/.bash_profile
. ~/.bash_profile

Install latest version of Drush locally

Get the latest (or whatever) version here:

https://github.com/drush-ops/drush/releases

cd /LOCATION/OF/DRUPAL
composer require drush/drush

And we done...

Tags: Drupal Administration Linux drush composer

Upgrade Drupal 6 to Drupal 7 using Drush site-upgrade

Ok... So you decided that it's time to upgrade from Drupal 6 to Drupal 7. It's not going to be easy, but using Drush will make life a little easier.

What this will do is save you the time of manually upgrading Drupal 6 core and drupal 6 modules to Drupal 7 core and drupal 7 modules. Of course likely your site will be broken after the drush site-upgrade, but at least you have the manual job of searching for upgraded modules taken care of.

So, let's begin...

Install latest version of Drush


cd /usr/local/share
# install GIT if not available
yum install git
git clone https://github.com/drush-ops/drush.git drush
ln -s /usr/local/share/drush/drush /usr/local/bin/drush
drush

Tags: Drupal drush