Chris J. Lee

Dallas Drupal Developer

You are here

Drush / drushrc site aliases example

an example drushrc file is very helpful. I've provided below a more practical barebones example of what you need to put in a drush aliases file:


// Local dev environment
$aliases['local'] = array(
'root' => '/var/www/mysite',
'uri' => 'mysite.local',
'db_url' => 'mysql://root:@127.0.0.1/mysite',
'path-aliases' => array(
'%dump' => '/tmp/local.mysite.sql',
'%files' => '/var/www/foo/sites/default/files',
),
);

//this is the alias for the remote development site
$aliases['dev'] = array(
'root' => '/var/www/dev.mysite',
'uri' => 'dev.mysite',
'remote-host' => 'dev.mysite',
'remote-user' => 'foo',
'db_url' => 'mysql://db_admin:@127.0.0.1/mysite',
'path-aliases' => array(
'%dump' => '/tmp/dev.mysite.com.sql',
'%files' => '/var/www/dev.mysite/sites/default/files',
),
);
// Staging
$aliases['staging'] = array(
'root' => '/var/www/stage.mysite',
'uri' => 'mysite.com',
'remote-host' => 'stage.mysite.com',
'remote-user' => 'foo',
'db_url' => 'mysql://db_admin:@127.0.0.1/dbname',
'path-aliases' => array(
'%dump' => '/tmp/stage.mysite.com.sql',
'%files' => '/var/www/stage.mysite/sites/default/files',
),
);

© 2017 Chris J. Lee