drush

Drupal Logo

Drupal 9: Sanitising Data With Drush

13th June 2021 - 15 minutes read time

When copying a database from your production environment to your dev or local setup you should probably be sanitising it. This means to remove all user identifiable information from the database. You would assume that this means removing passwords and email addresses, but it also includes any fields you might have added to the user that might contain information. Things like name, address, company or even gender should all be sanitised.

Sanitisation is important from a data security point of view as you do not want any user data leaking out from your development (or testing) platforms. You want your users to have confidence in your abilities to protect their data and sanitisation allows you to keep their user data only on your production environment (and any production backups).

If you are using Drupal 9 and Drush then you can sanitise your data easily using the sql:sanitize command. This comes with Drush and should be available out of the box.

Drupal Logo

Setting Up Drush Aliases And Using sql-sync

2nd May 2018 - 8 minutes read time

Drush sql-sync is a very easy way of grabbing a copy of a Drupal database from one site and installing it on another site. The normal application of this task is to copy the database from the production site to your local environment for facilitate local development. There are one or two steps to sort out before you can use the command

This post assumes you have Drush 8 installed on your machine as Drush 9 uses a different syntax for sotring Drush aliases. This also assumes that you have setup SSH key access to all servers you need to get access to.

Setting Up Aliases

The first thing you need to do is set up your Drush aliases, this allows you to connect to the remote Drupal instance from your local machine. Drush aliases are kept in your ~/.drush directory. To see what aliases you have on your system use the command.

Drupal Logo

Getting Started With Drush Make

12th May 2012 - 13 minutes read time

Drush is a command line tool that allows interaction with a Drupal site. The tool itself is incredibily useful and provides mechanisms to download modules, backup databases and most other things that can be done with Drupal. Drush Make was a plugin for Drush which has now become part of the Drush core and allows Drupal sites to be created via a make file. What Drush Make does is to use the make file to download the modules, themes and libraries needed for a Drupal site ready for the site to be installed. This means you can give this make file to another developer who can then build their own Drupal site.