How to get that site on localhost?
Submitted by clemens on Mon, 2011/05/23 - 12:20pm
Make sure you have your drush aliases file setup properly. Below a snippet from my b2b.aliases.drushrc.php
$aliases['dev'] = array(
'uri' => 'http://build2be.dev', 'root' => '/Users/clemens/Sites/build2be.dev/www/',
'path-aliases' => array(
'%dump-dir' => '/Users/clemens/Sites/build2be.dev/store',
'%files' => '/Users/clemens/Sites/build2be.dev/www/sites/build2be.dev/files',
),
);
Now we can run
drush rsync @b2b.prd @b2b.dev
Now you have a file tree from production. But that clone is not runnable yet as you need a local database. Create or copy a proper settings.php into ./sites/build2be.dev otherwise drush cannot sql-sync. (I should try to add the db settings to the aliasses file.)
cp old/settings.php ./sites/build2be.dev/
# vi ./sites/build2be.dev/settings.php
Now grab the remote db contents with
drush sql-sync @b2b.prd @b2b.dev
Make sure you read the warning carefully ... reversing the source and target is a little fatal.
Enter your site by magic through uli.
drush @b2b.dev uli
then use the one time login ... etc voila.
Drush rocks.
Comments
Thanks for the nice write-up.
Thanks for the nice write-up.
Note that in the first step, you can add the flag
--include-conf
, and drush will copy settings.php along with all of the other files.You may also want to add
--create-db
to your initial call tosql-sync
to have drush create the db for you as well; you might need to use--db-su
and--db-su-pw
if your regular Drupal user account does not have permissions to create databases.