Export and re-import a database with Drush and the command line
These are run from the project's web root, example/web, so that drush can run, but the database itself is stored outside the web root, example/db.
On the export side:
drush sql-dump > ../db/development.sql
On the import side:
drush sql-connect < ../db/development.sql
mysql -hlocalhost -uexample -pyMsx2rIP drupal-example < ../db/development.sql
(Agaric internal note: For getting database from a site on a server, Agaric's rake command rake test vlad:commit and rake prod vlad:commit handle this (as well as committing files). Stefan, who created this system, would like to move away from including the database and files in the project version control repository.)