These instructions describe how to set up a development copy of your live Drupal site within the Stanford web environment.
- Create a new database (at https://tools.stanford.edu/cgi-bin/sumysql/sumysql). This will give you a database user name and password, stored in a file at /afs/ir/group/mygroup/db_private/db_info
- SSH into corn
ssh sunetid@corn.stanford.edu
Enter your password when prompted - Change into the production Drupal directory
cd /afs/ir/group/mygroup/cgi-bin/drupal
- Create a dump file of the database
drush sql-dump --result-file=dbdump.sql
- Move up one directory
cd ..
- Make a copy of the production directory
cp -r drupal drupal-dev
- Move into the development directory
cd drupal-dev
- Edit the .htaccess file; you want to change the line that starts with "RewriteBase" so that it reflects the new development directory
RewriteBase /group/mygroup/cgi-bin/drupal-dev
- Edit the settings.php file (usually in sites/default) to point to your new, development database
Drupal 6Drupal 7$db_url = 'mysqli://newusername:newpassword@127.0.0.1/newdatabasename';
- (If applicable) Comment out the line that starts with $base_url in sites/default/settings.php:
// $base_url = 'https://myvanityurl.stanford.edu'; // NO trailing slash!
- Populate the new database from your database dump file
mysql -f -u username -ppassword -h 127.0.0.1 databasename < dbdump.sql
- (If applicable) Disable the Reverse Proxy module
drush -y dis reverse_proxy
- Visit your site at http://www.stanford.edu/group/mygroup/cgi-bin/drupal-dev. (Note: the WebAuth Module for Drupal (WMD) may not work on the development site.)
- Remember to delete your database dumps (dbdump.sql) from the Drupal directory in both the production and development Drupal installs. These should not be web-accessible.