Notes on Pantheon - Local Development
I've been lucky enough to have been involved with the Pantheon Beta project for several months now. Pantheon is a Drupal developers dream, built by Drupal folks for Drupal folks, I must say that the platform is absolutely awesome.
Following are a few of the tips and tricks I've picked up along the way. Please keep in mind that these are my own tricks, your mileage may vary.
Setting up a local development environment for working with Pantheon sites.
I set up my local database using phpmyadmin. I set up the Apache virtual host using my local copy of webmin.
I run 'git clone.....' command to clone the site from Pantheon. Now I can download the sites database from the Pantheon dashboard and uncompress it somewhere. Next I import the db into my local using phpmyadmin, or if it is too big I use a mysql command such as the following:
mysql -u database-username -p -h localhost database-name < /home/twooten/Downloads/databases.sql
Next is a rather important point that had me stuck for a bit. The database is imported but you might not be able to log in because perhaps you do not know the admin password. Pretty easy to fix this with a Drupal 6 install. Simply use phpmyadmin, navigate to the database in question and go browse the 'user' table. Click to edit user #1. Find the password field and enter in the password you want to use. Look under the 'Function' column in the phpmyadmin UI and set it to MD5 for the password field. Click save and you're all set. This will not work with Drupal 7.
Drupal 7 does things a little different as far as passwords. I looked around and found http://drupal.org/node/1023428. I was not able to get the scripts/password-hash.sh to work for me. It kept throwing errors on the command line. But I was able to get the Drush command to do the job.
drush @your-site-alias user-password username --password="new_password"
Note that you'll have to actually have your sites alias setup for this to work. I explain that next.
Couple of things to point out here about using Drush and Pantheon. You can download a ready made Drush alias file from the Pantheon dashboard. First thing I like to do is download that file and place it in my Drush install directory. I edit the file and add an alias for my local copy of the site I am working on.
By default the aliases that come from Pantheon look like 'site_dev', and 'site_test'. I like to change mine to 'dev.site' and 'local.site'. I usually simply comment out the 'site_test' and 'site_live' since you really shouldn't be mucking around with those. It is preferable to just use git to push your code to dev, then use the Pantheon dashboard to handle all the code pushing, content copying, etc.
One really sweet Drush command that I just found is 'drush site-alias @your-alias-name --with-db --show-passwords' That command will print out code that is perfect for copying and pasting into your alias file.
One last thing about local development. Your database user/password is probably different than what you might download from Pantheon. The way to solve this issue is to create a folder in sites to hold your local settings.php file. My habit is to use local.sitename.com for my local development copies, meaning that is what I call the site in my Apache virtual host file. So what I do is create the folder sites/local.sitename.com and then just copy settings.php from sites/default and simply change the database connection section to match what my database username and password are.