Get the live site's DB to your localhost with drush


If you use drushrc you can get the live site's database. With this shell script you can download the the live site's db to your localhost, sanitize it, set you favorite password :) and enable drush.

In the second line you can see pv, which tool monitors the progress of data through the pipe, so if you didn't install it, remove it form the line.

Get raw version
  1. #!/bin/sh
  3. drush sql-drop -y &&
  4. drush sql-dump |pv| drush sqlc &&
  5. drush sql-sanitize -y &&
  6. drush updb -y &&
  7. drush upwd admin --password="asd" &&
  8. drush en -y devel >/dev/null 2>&1